To pass through an Android device to an unprivileged LXC container under Proxmox Virtual Environment (PVE), you can follow these steps:

  1. Enable IOMMU in the BIOS of the Proxmox server. This is required for device passthrough.

  2. Connect the Android device to the Proxmox server via USB.

  3. Run the following command on the Proxmox server to list the connected USB devices:

    lsusb
    

    Note down the Vendor ID and Product ID of the Android device.

  4. 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
    
  5. 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=file
    

    Replace <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.

  6. Save the configuration file and exit the editor.

  7. Restart the LXC container for the changes to take effect:

    pct stop <container_id>
    pct start <container_id>
    
  8. Log in to the LXC container and check if the Android device is available:

    lsusb
    

    You should see the Android device listed.

Note: Please ensure that you have the necessary permissions and meet the system requirements for device passthrough

how to passthrough an android device to unpriviliged lxc under pve

原文地址: http://www.cveoy.top/t/topic/iSpR 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录