ventoy / PXE

The open source part of iVentoy.
501 stars 31 forks source link

Can't run server on an unprivileged LXC container #53

Open Frew777 opened 9 months ago

Frew777 commented 9 months ago

Got a Debian 12 LXC container. It's unprivileged, nesting enabled. Trying to run iVentoy server bash iventoy.sh start got this error

2024/02/09 17:02:26.140 [PXE]  ==========================================================
2024/02/09 17:02:26.140 [PXE]  ##########################################################
2024/02/09 17:02:26.140 [PXE]  ##################### IVENTOY RUN ########################
2024/02/09 17:02:26.140 [PXE]  ##########################################################
2024/02/09 17:02:26.140 [PXE]  ==========================================================
2024/02/09 17:02:26.140 [UTIL] Failed to open file <./data/sys/class/dmi/id/product_uuid> errno:13
2024/02/09 17:02:26.140 [UTIL] read sys directory failed 1, errno:13
2024/02/09 17:02:26.140 [PXE]  ### iVentoy start failed. ###

I'm not the only one who has this problem. Following this, trying to start server with command bash iventoy.sh -A start. So, got same error.

Please, fix it.

dontreffi commented 8 months ago

same here started an lxc with debian 12 and got the same error. -A start did not help.

cafec0ffee commented 6 months ago

if you give read permissions to /sys/class/dmi/id/product_uuid then it works in an unprivileged container

on pve(Proxmox host):

root@pve:~# chmod 444 /sys/class/dmi/id/product_uuid
root@pve:~# ls -l /sys/class/dmi/id/product_uuid
-r--r--r-- 1 root root 4096 may 24 20:27 /sys/class/dmi/id/product_uuid

and restart unpriveleged container iventoy

but after rebooting the pve it will return the permissions to 400

to fix this I added it to cron

root@pve:~# crontab -e
@reboot /usr/bin/chmod 444 /sys/class/dmi/id/product_uuid

as I understand it, access to /sys/class/dmi/id/product_uuid is necessary to link the purchased version to a specific motherboard