Passing USB Z-Wave stick to Cloud-Init VM (not LXC)

bachya

New Member
Mar 25, 2021
2
0
1
39
Hello,

Summary

I am having issues attaching USB Z-Wave dongles to Cloud-Init-enabled Debian 10 VMs created in PVE 6.3-2. I've read a variety of posts here, but nothing so far has solved my issue; hoping someone can help me debug further.

In short, my PVE host correctly detects and loads each dongle without issue. When I pass through the USB device into a VM, I am able to see the low-level device (via lsusb), but no /dev entry is created (perhaps indicating that the kernel isn't loading drivers correctly?).

Details

I've plugged both dongles into my host and can see them low-level:

Code:
root@pmc-node-1:~# lsusb | grep Cygnal
Bus 001 Device 007: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 001 Device 006: ID 10c4:8a2a Cygnal Integrated Products, Inc.

...and high-level:

Code:
root@pmc-node-1:~# ls -l /dev/serial/by-id/*
lrwxrwxrwx 1 root root 13 Mar 25 11:30 /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_aad82be5b23ce911af28f18e34a3b55e-if00-port0 -> ../../ttyUSB2
lrwxrwxrwx 1 root root 13 Mar 25 11:34 /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_612027EB-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 Mar 25 11:34 /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_612027EB-if01-port0 -> ../../ttyUSB1

(001.006 contains both Z-Wave and Zigbee antennas, so that's why two devices are created)

In the VM Hardware GUI, I can see both dongles as attachable USB devices:

CleanShot 2021-03-25 at 11.45.20.png
(since these are USB 1.x devices, I've unchecked Use USB3)

When I add one (or both, which is what is represented below) and reboot the VM, I see the low-level devices:

Code:
root@debian:~# lsusb | grep Cygnal
Bus 003 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 003 Device 002: ID 10c4:8a2a Cygnal Integrated Products, Inc.

...but the high-level devices are missing:

Code:
root@debian:~# ls /dev/serial
ls: cannot access '/dev/serial': No such file or directory

Cloud-Init

I think this has to do with Cloud-Init: when I build a "traditional" VM, this pass-through works fine. I'm curious if the serial device that I create in my Cloud-Init template (per the official instructions) is somehow interfering? If so, I'm unclear on what to do – I understand that many Cloud-Init images require this serial port... Anyone run into this before?
 
Last edited:
I don't know if you still need assistant but i ran into the same issue and i solved it like this:
the problem is related to the linux-kernel and cloud-init i installed a old kernel and magic it works again.
pain in the ass to find this stupid error


first uncheck Upgrade packeges in Proxmox UI

than remote into your vm.

i used this Script to change my kernel: https://linux.how2shout.com/how-to-change-default-kernel-in-ubuntu-22-04-20-04-lts/

//Please make a grub backup ;)

">>" is used to mark the changed lines

after kernel changed some stuff in my to my /etc/default/grub
Bash:
>> GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.10.65-051065-generic"
>> GRUB_SAVEDEFAULT=true
>> GRUB_TIMEOUT_STYLE=hidden
>> GRUB_TIMEOUT=0
>> GRUB_DISABLE_OS_PROBER=false
>> GRUB_DISABLE_SUBMENU=
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
[/ICODE][/CODE]


here ist my /etc/default/grub.d/50-cloudimg-settings.cfg
Bash:
# Cloud Image specific Grub settings for Generic Cloud Images
# CLOUD_IMG: This file was created/modified by the Cloud Image build process

# Set the recordfail timeout
GRUB_RECORDFAIL_TIMEOUT=0

# Do not wait on grub prompt
GRUB_TIMEOUT=0
#GRUB_DEFAULT=0
# Set the default commandline
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0"

# Set the grub console type
GRUB_TERMINAL=console
[/ICODE]

now you need to update your grub
Bash:
sudo update-grub

after reboot hit your console with

Bash:
uname -r

and you should see the new kernel

now with this command you should get your device id
Bash:
ls /dev/serial/by-id/*

don't rant to mutch about my englisch and quality of my post.... my first forum Post of my life :D
nice to know:
https://docs.digitalocean.com/products/droplets/how-to/kernel/use-non-default/
https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry
 
Last edited: