[SOLVED] USB Pass through Failing in LXC Ubuntu 20.04

Jul 22, 2021
33
2
8
27
Hi, I am running a Ubuntu 20.04 LXC on top of PVE 6.4

I am trying to access an HSM module USB from LXC.

contents of lsusb:
Code:
Bus 001 Device 016: ID 1050:0030 Yubico.com

Using the lsusb details, I have trying mounting the below directory where My USB is mounted in the PVE Node.
Code:
/dev/bus/usb/001/016
to lxc by editing
Code:
/var/lib/lxc/102/config

to do so I have added these lines to the /var/lib/lxc/102/config file:
Code:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001/016 dev/bus/usb/001/016 none bind,optional,create=file

After saving the file. The moment I restart the container to apply the new configuration. the config file is resetting to the original file(Losing all the changes that I have made).


Regards.
 
It is working fine. I was editing the wrong file. I was editing the /var/lib/lxc/<name>/config . it started working fine once after adding the same config in /etc/pve/nodes/pve/lxc/<CTID>.conf.

Restarted the container. after changing the config file.