Hi.
I'm trying to convert a KVM machine with Ubuntu 15.10 to a LXC 17.10 with CUPS and passthrough a USB printer. (Brother HL-2130). I'm using VE 5.1-41.
I've managed to get it working, but only works if in the host the file /dev/usb/lp0 exists. I can see that this file is created when the KVM machine is started, and if I stop it, the file doesn't delete which allow me to start the LXC.
The reason why this file is needed is because I've in my LXC config this lines:
Without those lines, the printer is recognized by CUPS but it really doesn't work. (More info: https //forum.proxmox.com/threads/lxc-usb-passthrough-zwave-stick.30058/ and https //forum.turris.cz/t/lxc-usb-printer-passthrough/2130)
But, if I don't start the KVM from a cold reboot (which obviously is the idea), the /dev/usb/lp0 is not created and when I start the LXC an error shows up:
So the question is: How can I create the /dev/usb/lp0 for the LXC to start, the same way the KVM is handling that.
When I start the KVM, I see this in the host log:
Thank you very much.
I'm trying to convert a KVM machine with Ubuntu 15.10 to a LXC 17.10 with CUPS and passthrough a USB printer. (Brother HL-2130). I'm using VE 5.1-41.
I've managed to get it working, but only works if in the host the file /dev/usb/lp0 exists. I can see that this file is created when the KVM machine is started, and if I stop it, the file doesn't delete which allow me to start the LXC.
The reason why this file is needed is because I've in my LXC config this lines:
Code:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry = /dev/usb/lp0 dev/usb/lp0 one bind,create=file 0 0
Without those lines, the printer is recognized by CUPS but it really doesn't work. (More info: https //forum.proxmox.com/threads/lxc-usb-passthrough-zwave-stick.30058/ and https //forum.turris.cz/t/lxc-usb-printer-passthrough/2130)
But, if I don't start the KVM from a cold reboot (which obviously is the idea), the /dev/usb/lp0 is not created and when I start the LXC an error shows up:
Code:
~# /usr/bin/lxc-start -n 107 -F
lxc-start: 107: cgroups/cgfsng.c: create_path_for_hierarchy: 1337 Path "/sys/fs/cgroup/systemd//lxc/107" already existed.
lxc-start: 107: cgroups/cgfsng.c: cgfsng_create: 1433 Failed to create "/sys/fs/cgroup/systemd//lxc/107"
lxc-start: 107: utils.c: safe_mount: 1707 No such file or directory - Failed to mount /dev/usb/lp0 onto /usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/usb/lp0
lxc-start: 107: conf.c: mount_entry: 1854 No such file or directory - Failed to mount "/dev/usb/lp0" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/usb/lp0"
lxc-start: 107: conf.c: lxc_setup: 3188 failed to setup the mount entries for '107'
lxc-start: 107: start.c: do_start: 944 Failed to setup container "107".
lxc-start: 107: sync.c: __sync_wait: 57 An error occurred in another process (expected sequence number 5)
lxc-start: 107: start.c: __lxc_start: 1477 Failed to spawn container "107".
lxc-start: 107: tools/lxc_start.c: main: 371 The container failed to start.
lxc-start: 107: tools/lxc_start.c: main: 375 Additional information can be obtained by setting the --logfile and --logpriority options.
So the question is: How can I create the /dev/usb/lp0 for the LXC to start, the same way the KVM is handling that.
When I start the KVM, I see this in the host log:
Code:
pve kernel: usb 3-9.3: usbfs: interface 0 claimed by usblp while 'kvm' sets config #1
Thank you very much.