how to passthrough an android device to unpriviliged lxc under pve
To pass through an Android device to an unprivileged LXC container under Proxmox Virtual Environment (PVE), you can follow these steps:
-
Enable IOMMU in the BIOS of the Proxmox server. This is required for device passthrough.
-
Connect the Android device to the Proxmox server via USB.
-
Run the following command on the Proxmox server to list the connected USB devices:
lsusbNote down the Vendor ID and Product ID of the Android device.
-
Edit the LXC configuration file for the unprivileged container. You can use the following command to edit the configuration file:
pico /etc/pve/lxc/<container_id>.conf -
Add the following lines to the configuration file to pass through the Android device:
lxc.cgroup.devices.allow = c 189:* rwm lxc.mount.entry = /dev/bus/usb/001/<bus_number> /dev/bus/usb/001/<bus_number> none bind,optional,create=dir lxc.mount.entry = /dev/bus/usb/001/<bus_number>/<device_number> /dev/bus/usb/001/<bus_number>/<device_number> none bind,optional,create=fileReplace
<bus_number>and<device_number>with the appropriate values for your Android device. The bus number and device number can be obtained from the lsusb command output. -
Save the configuration file and exit the editor.
-
Restart the LXC container for the changes to take effect:
pct stop <container_id> pct start <container_id> -
Log in to the LXC container and check if the Android device is available:
lsusbYou should see the Android device listed.
Note: Please ensure that you have the necessary permissions and meet the system requirements for device passthrough
原文地址: http://www.cveoy.top/t/topic/iSpR 著作权归作者所有。请勿转载和采集!