xcp-ng / xcp

Entry point for issues and wiki. Also contains some scripts and sources.
https://xcp-ng.org
1.32k stars 74 forks source link

pusb-list not listing z-wave smarthome dongle #125

Open R0flcopt3r opened 5 years ago

R0flcopt3r commented 5 years ago

Z-wave dongle not detected by xe pusb-list, but is listed properly with lsusb as shown below.

Bus 003 Device 023: ID 0658:0200 Sigma Designs, Inc.

I need to pass this device through to a virtual machine running on the host.

panixx commented 5 years ago

You can get it to show up in 'xe pusb-list' by modifying the file located at /etc/xensource/usb-policy.conf and allowing it access (I dont remember off hand which device I had to allow....I believe it was one of the CDC devices).

I have not been able to get it to show up in my vm though. I see passthrough enabled and it attached to my vm, but no /dev/ttyACM* devices show up in the vm. I also tried allowing all devices in the usb-policy.conf file but still did not show up in my vm.

panixx commented 5 years ago

Tried this with 2 different Z-Wave usb sticks: Aeotec Z-Stick Gen 5, and Nortek HUSBZ-1 with the same results as above. Shows in xe pusb-list, but does not show up in guest vm. Both seem to use the Sigma Designs chips.

dylonsease commented 5 years ago

I have an issue with this type of usb device as well. It is a HUSBZB-1 Device manufacture link: https://www.nortekcontrol.com/products/2gig/husbzb-1-gocontrol-quickstick-combo/ The device appears on the host correctly. I can see the usb device in XCP Center and attach it to a VM, but the usb device is never available in the VM OS. I have tried Ubuntu 18 and Windows Server 2019. I have also tested this usb device with two different host hardware platforms, one is a home built PC and the other is a newish Dell server R610 I believe. Both hosts can identify the device and offer it in XCP Center for pass through, but neither hosts can successfully allow a VM to use the device. I also have a usb tv tuner that does pass through to a VM just fine, so I don't think it is the steps I'm taking causing the issue.

I have tried to edit the usb-policy.conf file to allow the device specifically and I also tried commenting out all of the deny statements.

Any advice would be appreciated.

Output of: lsusb -v -d 10c4:8a2a

Bus 001 Device 002: ID 10c4:8a2a Cygnal Integrated Products, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x10c4 Cygnal Integrated Products, Inc.
  idProduct          0x8a2a 
  bcdDevice            1.00
  iManufacturer           1 Silicon Labs
  iProduct                2 HubZ Smart Home Controller
  iSerial                 5 61200BB1
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           55
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              3 HubZ Z-Wave Com Port
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              4 HubZ ZigBee Com Port
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

Contents of usb-policy.conf

# When you change this file, run 'xe pusb-scan' to confirm
# the file can be parsed correctly.
#
# Syntax is an ordered list of case insensitive rules where # is line comment
#  and each rule is (ALLOW | DENY) : ( match )*
#  and each match is (class|subclass|prot|vid|pid|rel) = hex-number
# Maximum hex value for class/subclass/prot is FF, and for vid/pid/rel is FFFF
#
# USB Hubs (class 09) are always denied, independently of the rules in this file
ALLOW:vid=10c4 pid=8a2a class=00
#DENY: vid=17e9 # All DisplayLink USB displays
#DENY: class=02 # Communications and CDC-Control
ALLOW:vid=056a pid=0315 class=03 # Wacom Intuos tablet
ALLOW:vid=056a pid=0314 class=03 # Wacom Intuos tablet
ALLOW:vid=056a pid=00fb class=03 # Wacom DTU tablet
#DENY: class=03 subclass=01 prot=01 # HID Boot keyboards
#DENY: class=03 subclass=01 prot=02 # HID Boot mice
#DENY: class=0a # CDC-Data
#DENY: class=0b # Smartcard
#DENY: class=e0 # Wireless controller
#DENY: class=ef subclass=04 # Miscellaneous network devices
ALLOW: # Otherwise allow everything else

First image of the usb device showing available and attached to the VM.

capture1

Second image showing no sign of the usb device in the VM.

capture2

dylonsease commented 5 years ago

I wanted to follow up with this. I worked around this issue by purchasing a pci USB card for the host and passing the entire card through to the VM. I could never get it to work by just passing the USB stick through and sharing the stick over the network from an rpi seemed a little unreliable. Hope this helps others!

olivierlambert commented 5 years ago

thanks for the feedback!

crxtasy12 commented 5 years ago

Seems I am having the same issue as mrgoose2. I followed all the same steps. The two lines have been uncommented in the policy located at /etc/xensource/usb-policy.conf.

DENY: class=02 # Communications and CDC-Control.

DENY: class=0a # CDC-Data

The device shows when running this command 'xe pusb-list' as readonly? (RO)

[root@hpe-xenserver ~]# xe pusb-list uuid ( RO) : e4a31443-22f6-97c8-82b3-d47696e350b9 path ( RO): 1-7 vendor-id ( RO): 0658 vendor-desc ( RO): Sigma Designs, Inc. product-id ( RO): 0200 product-desc ( RO): serial ( RO): version ( RO): 2.00 description ( RO): Sigma Designs, Inc.

Using the XCP-ng center, I have allowed passthrough on the host and attached it to a Hassio ubuntu vm. It shows in the graphical windows as allowed however no /dev/ttyACM devices show up in the vm when using ls /dev/tty at the command line.

DaAwesomeP commented 5 years ago

I am having the same issue with the Nortek HUSBZB-1. I disabled denying those two devices classes, and I added the USB device to a group and that group to the VM, but the VM doesn't see it at all. I also have a Teensy 3.0 plugged in, and I was able to set it up the same way and the guest VM can itneract with it just fine. In the host, the Nortek shows up as /dev/ttyUSB0 and /dev/ttyUSB1. The Teensy shows up as /dev/ttyACM0. There is no trace of the Nortek USB device in the guest dmesg.

DaAwesomeP commented 5 years ago

I wonder if it has something to do with the cp210x driver.

dylonsease commented 5 years ago

I think the issue is probably more related to how the device is presenting itself to the host. From the installation manual: "When plugged into computer or similar host device, it appears as two (2) serial ports." This isn't a typical USB device which is why I opted to just by a USB PCI card and pass the card through. You'll beat your head against the wall more than it's worth trying to get the regular pass-through methods to work. Or you can get a Raspberry Pie and do USB over the network.

DaAwesomeP commented 5 years ago

@mrgoose2 :/ I have a tiny Dell Optiplex without PCI card slots. Is it safe to passthrough a system USB hub?

dylonsease commented 5 years ago

I'm not an expert, but I think people have had trouble passing through the system USB like that. Looks like you either need a different hypervisor, or you can try USB-over-IP from a raspberry pi. Or another option you could try would be an external PCIe enclosure like this https://www.amazon.com/StarTech-Express-Slot-Expansion-System/dp/B000UZL1GC. Though I would imagine you could end up in a similar situation. Lastly, you could consider a different method of getting Zwave and Zigbee in your smarthome. Maybe a Wink or Smartthings hub.

DaAwesomeP commented 5 years ago

Yeah, system USB PCI passthrough did not work. While it is not ideal at all, I suppose I could make a host-guest-only network and install USB IP software on the host. I would like to know how to debug this issue most specifically if possible. I do have mini PCIe, but adapters like this seem a bit sketchy.

dylonsease commented 5 years ago

Sketchy or not I think you'll be much happier with the setup by passing a card through than trying to go with any of my other suggestions.

DaAwesomeP commented 5 years ago

I connected to the USB dongle through ser2net.

I installed ser2net on my XCP host and then changed my host's /etc/ser2net.conf to be:

3020:raw:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT max-connections=1
3021:raw:0:/dev/ttyUSB1:57600 8DATABITS NONE 1STOPBIT max-connections=1

Added the following at the bottom of /lib/udev/rules.d/99-systemd.rules on both my host and guest so that I can make systemctl services wait for the devices (add before LABEL="systemd_end"):

KERNEL=="ttyUSB0", SYMLINK="ttyUSB0", TAG+="systemd"
KERNEL=="ttyUSB1", SYMLINK="ttyUSB1", TAG+="systemd"

Created a systemcl unit service for ser2net at /etc/systemd/system/ser2net.service:

[Unit]
Description=ser2net
After=syslog.target
After=network-online.target
Wants=dev-ttyUSB0.device
After=dev-ttyUSB0.device
Wants=dev-ttyUSB1.device
After=dev-ttyUSB1.device

[Service]
ExecStart=/usr/sbin/ser2net -n
Restart=on-failure

[Install]
WantedBy=multi-user.target

Opened firewall ports and enabled the service and restarted my host:

iptables -I INPUT -p tcp --dport 3020 --syn -j ACCEPT
iptables -I INPUT -p tcp --dport 3021 --syn -j ACCEPT
service iptables save
systemctl daemon-reload
systemctl enable ser2net.service
reboot

Created two unit files on my guest (for systemd systems, but the socat commands work anywhere): /etc/systemctl/systemd/socat-z0.service:

[Unit]
Description=socat z 0
After=network-online.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/socat pty,link=/dev/ttyUSB0,raw,user=root,group=dialout,mode=660 tcp:HOST_IP:3020
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

/etc/systemctl/systemd/socat-z1.service:

[Unit]
Description=socat z 1
After=network-online.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/socat pty,link=/dev/ttyUSB1,raw,user=root,group=dialout,mode=660 tcp:HOST_IP:3021
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

If you are using Home Assistant, add the following under the [Unit] part of the service unit:

Wants=dev-ttyUSB0.device
After=dev-ttyUSB0.device
Wants=dev-ttyUSB1.device
After=dev-ttyUSB1.device

Enable the services and restart the guest:

systemctl daemon-reload
systemctl enable socat-z0.service
systemctl enable socat-z1.service
shutdown -r now

This requires the host and guest to share the same management network, and that isn't ideal, but this doesn't require any more hardware.

crxtasy12 commented 5 years ago

Just updated to xcp-ng 8.0 using a clean install and same issue persists. I am able to pass it through but the guest can't see it or interact with it. Just a fyi.

hayer commented 4 years ago

@mrgoose2 can you tell which chip the USB PCI expander card is using? I bought some offbrand thinking I would passthrough the card, but apparently the VL805 USB chip used doesn't like xen..

dylonsease commented 4 years ago

@mrgoose2 can you tell which chip the USB PCI expander card is using? I bought some offbrand thinking I would passthrough the card, but apparently the VL805 USB chip used doesn't like xen..

I have since moved away from xcp for my needs but this one worked on my cell r610 when I was running it. StarTech.com Dual Port USB 3.1 Card – 2X USB-A – 10Gbps per Port – Expansion Card – PCI Express USB Card – PCI-e to USB (PEXUSB312A2) https://www.amazon.com/dp/B072PVCDM9/ref=cm_sw_r_sms_apa_i_AsNeEb1VW20FV

cpaplaczyk commented 4 years ago

Do we have a resolution for this issue? Having the same issue with zigbee2mqtt device, device shows up on XCP-ng host but is not actually showing up in the Linux VM. Could this be a driver issue on the VM or hypervisor level as its not truly passed through as a serial device?

stormi commented 4 years ago

We don't have a resolution nor a proper diagnostic at the moment.

hayer commented 4 years ago

@stormi what would you need for a "proper diagnostic"? I can run some commands if thats all.

cpaplaczyk commented 4 years ago

@stormi just as @hayer has stated please let me know if you need anyone to run a few commands or test anything out as I would be more than happy to assist in any ways possible.

stormi commented 4 years ago

What we'd need is mostly time and an appropriate device to test :)

At the moment, this is not an issue that has affected users that take support, and my guess is that it mosty affects homelabs. This does not mean that we don't care about it, but at the moment the priority is lower than various other work. However, since it's one of the most popular issues on the bugtracker, I've added in my board to keep an eye on it and see if we can find a way to move forward.

I caress the secret hope that, due to the issue's popularity among the users from the community, someone will step up and do the analysis, which would bring us closer to a resolution.

hayer commented 4 years ago

Still no luck using PEXUSB312A2. Currently the card is visible in both dom0 and domU. lsusb in either of them show nothing. lspci -k in dom0 shows these lines;

03:00.0 USB controller: ASMedia Technology Inc. Device 2142
        Subsystem: ASMedia Technology Inc. Device 2142
        Kernel driver in use: pciback

so pciback is ok?

In the guest it just shows

00:05.0 USB controller: ASMedia Technology Inc. Device 2142
        Subsystem: ASMedia Technology Inc. Device 2142
        Kernel driver in use: xhci_hcd

But still nothing when I plug it in. Nothing when running dmesg -w either.

Edit: Then I found this

journalctl -b | grep -E "(xhci|\: usb)"
Jan 25 16:52:14 overwatch kernel: usbcore: registered new interface driver usbfs
Jan 25 16:52:14 overwatch kernel: usbcore: registered new interface driver hub
Jan 25 16:52:14 overwatch kernel: usbcore: registered new device driver usb
Jan 25 16:52:14 overwatch kernel: usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
Jan 25 16:52:14 overwatch kernel: usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jan 25 16:52:14 overwatch kernel: usb usb1: Product: UHCI Host Controller
Jan 25 16:52:14 overwatch kernel: usb usb1: Manufacturer: Linux 4.15.0-74-generic uhci_hcd
Jan 25 16:52:14 overwatch kernel: usb usb1: SerialNumber: 0000:00:01.2
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: xHCI Host Controller
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: new USB bus registered, assigned bus number 2
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: hcc params 0x0200ef81 hci version 0x110 quirks 0x0000000000000010
Jan 25 16:52:14 overwatch kernel: usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
Jan 25 16:52:14 overwatch kernel: usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jan 25 16:52:14 overwatch kernel: usb usb2: Product: xHCI Host Controller
Jan 25 16:52:14 overwatch kernel: usb usb2: Manufacturer: Linux 4.15.0-74-generic xhci-hcd
Jan 25 16:52:14 overwatch kernel: usb usb2: SerialNumber: 0000:00:05.0
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: xHCI Host Controller
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: new USB bus registered, assigned bus number 3
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: Host supports USB 3.1 Enhanced SuperSpeed
Jan 25 16:52:14 overwatch kernel: usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
Jan 25 16:52:14 overwatch kernel: usb usb3: New USB device found, idVendor=1d6b, idProduct=0003
Jan 25 16:52:14 overwatch kernel: usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jan 25 16:52:14 overwatch kernel: usb usb3: Product: xHCI Host Controller
Jan 25 16:52:14 overwatch kernel: usb usb3: Manufacturer: Linux 4.15.0-74-generic xhci-hcd
Jan 25 16:52:14 overwatch kernel: usb usb3: SerialNumber: 0000:00:05.0
Jan 25 16:52:14 overwatch kernel: usb 1-2: new full-speed USB device number 2 using uhci_hcd
Jan 25 16:52:14 overwatch kernel: usb 1-2: New USB device found, idVendor=0627, idProduct=0001
Jan 25 16:52:14 overwatch kernel: usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jan 25 16:52:14 overwatch kernel: usb 1-2: Product: QEMU USB Tablet
Jan 25 16:52:14 overwatch kernel: usb 1-2: Manufacturer: QEMU 0.10.2
Jan 25 16:52:14 overwatch kernel: usb 1-2: SerialNumber: 1
Jan 25 16:52:14 overwatch kernel: usbcore: registered new interface driver usbhid
Jan 25 16:52:14 overwatch kernel: usbhid: USB HID core driver
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: Error while assigning device slot ID
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: Max number of devices this xHCI host supports is 127.
Jan 25 16:52:14 overwatch kernel: usb usb2-port1: couldn't allocate usb_device
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: Error while assigning device slot ID
Jan 25 16:52:14 overwatch kernel: xhci_hcd 0000:00:05.0: Max number of devices this xHCI host supports is 127.
Jan 25 16:52:14 overwatch kernel: usb usb2-port2: couldn't allocate usb_device

0000:00:05.0: Max number of devices this xHCI host

Which seems interesting.. Don't know much about this stuff soo currently following that lead.

benze commented 4 years ago

@DaAwesomeP I'm running into a similar issue, trying to get a Sigma zwave USB device mounted in a VM. I'm intrigued by your solution of running ser2net on the DOM0 and in the VM Host. But I don't see the /dev/ttyUSB0 detected in the DOM0.

Did your DOM0 already detect the USB device and list them in the /dev/ttyUSB0 /dev/ttyUSB1 before you added the 2 rules you added to 99-systemd.rules? If not, how did you force it to detect/mount it to the tty devices?

I see it in my lsusb output, but nothing appears in /dev/tty:

[root@xenserver ~]# lsusb
Bus 005 Device 002: ID 0658:0200 Sigma Designs, Inc.

[root@xenserver ~]# dmesg  | grep tty
[    0.000000] Command line: root=LABEL=root-olxolw ro nolvm hpet=disable xencons=hvc console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles
[    0.000000] Kernel command line: root=LABEL=root-olxolw ro nolvm hpet=disable xencons=hvc console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles
[    0.000000] console [tty0] enabled
[   24.227831] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[   35.556488] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   35.556565] systemd[1]: Starting system-serial\x2dgetty.slice.

Did you have to do anything special to have it mounted as a device?

DaAwesomeP commented 4 years ago

@benze Yes, the host already detected the devices as /dev/ttyUSB0 and /dev/ttyUSB1. It is possible yours may show up as /dev/ttyACM0 or something else, or they may not show up at all if the host lacks the required driver. Check dmesg to see what it does when you plug it in.

benze commented 4 years ago

@DaAwesomeP Unfortunately, XenServer does not seem to have the driver for it, and is missing the cdc_acm module as I can't seem to find it in the /lib/modules/<>/kernel folder.

On a ubuntu system, it loads and maps to the /dev/ttyACM0, but on the XenServer, it doesn't show up at all. dmesg gives me no tremendous details either. Only the following:

[485789.854609] usb 5-2: new full-speed USB device number 3 using uhci_hcd
stormi commented 4 years ago

Do you know what kernel configuration option enables it?

benze commented 4 years ago

@stormi Not sure. I looked quickly but I cannot see a specific kernel config option for it. According to a quick search, it seems there is a kernel module option called USB Modem (CDC ACM) support, but I haven't been able to confirm it.

After digging around for a bit, I found the kernel configuration for it: CONFIG_USB_ACM=m

Is there a way to recompile the missing kernel module and just copy it over to the xenserver installation without needing the change the kernel itself? I've tried to follow instructions from the https://github.com/xcp-ng/xcp-ng-build-env repo, but trying to build the kernel module fails.

[root@543abc754417 4.4.0+10-x86_64]# make modules_prepare
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:13:22: fatal error: classmap.h: No such file or directory
 #include "classmap.h"
                      ^
compilation terminated.
make[3]: *** [scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/selinux] Error 2
make: *** [scripts] Error 2
[root@543abc754417 4.4.0+10-x86_64]#

@stormi I've opened a question on the xcp-ng dev forum as I wasn't sure which forum was better suited for the question.

rb2k commented 4 years ago

Same issue here (also a Nortek HUSBZB-1)

I just wanted to link to https://xcp-ng.org/forum/topic/266/usb-passthrough-test-reports-in-7-5rc1/57?lang=en-GB&page=3 which might be interesting

Seems like some success via "xe vm-param-set uuid=**** platform:device-model=qemu-upstream-compat"

dylonsease commented 4 years ago

It's not the answer you guys are looking for, but passing through the usb controller using something like the pci to usb card I linked above was very reliable. I have since moved to a different hypervisor though so I am unable to provide further details. If you have the extra slots and ability to purchase a similar card you'd be much happier and have many hours of your day back.

rb2k commented 4 years ago

I am thinking about it, but my problem is mainly that I have 2 USB devices (ZWave/Zigbee stick + an RF stick) as well as a UPS.

The ZWave/Zigbee stuff goes to the Homeassistant VM The UPS to the Storage VM

So ultimately I'd have to buy two cards. I am personally thinking about just switching to a different Hypervisor since in my homelab environment the whole passthrough thing is kind of a big deal :)

dylonsease commented 4 years ago

Do all of those devices have issues with pass through or just the zigbee/zwave device? Hate to call out names but if your VMs can live within the limits of the free version of ESXi its been solid for me with the same Nortek HUSBZB-1 device you have without the need to pass through an entire pci card.

hayer commented 4 years ago

@mrgoose2 I couldn't for the life of me get the PEXUSB312A2 to pass through in Xen.

ESXi is currently a no-go for me :/

Edit: The current solution is an Intel NUC running bare-bone Ubuntu doing the job. Not great, but good enough,.

rb2k commented 4 years ago

I just came from ESXI. It's a small server, so I don't want to deal with an HBA card just to get my VM storage on SSDs. Plus since 7 their hardware support is very much lacking.

Maybe I'll try Proxmox or go down the serial over USB route and use a Raspberry Pi that I have sitting around.

signed2 commented 3 years ago

Anyone have any updates upon this..? I have migrated all windows servers from ESXI and is happy about the move - but now when I did migrate Homeseer this came up as an surprise. And doesnt have empty slots for a PCI card... pls

hayer commented 3 years ago

Gave up on this. Using an Intel NUC with bare-metal Ubuntu installation running my ZWave and ZigBee dongles. HomeAssistant and MQTT running virtualized on another host.

My understanding from the last try was that you at least need a separate USB host controller. Some motherboards only have one, some have more. If you have more than one on your motherboard you can try passing through the one that the OS doesn't consider its "main one". Keep in mind I am an n00b on this topic.

f-bor commented 3 years ago

Fwiw, It's working well on my setup (host xcp-ng 8.2 unpatched, guest debian 10), with the same hardware as R0flcopt3r (Aeotec Z-Stick Gen5).

hayer commented 3 years ago

@f-bor just opened xcp-ng center and passed it through using the UI or did you use xe pusb-* commands?

mikesjogren commented 3 years ago

I ended up using xng center. But I needed to update the Allow in the config file before it showed up. The error I made in the config was reversing the two grops of numbers on the device.

21 jan. 2021 kl. 22:34 skrev Peder Husom notifications@github.com:

 @f-bor just opened xcp-ng center and passed it through using the UI or did you use xe pusb-* commands?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

f-bor commented 3 years ago

@hayer I used the commands.

benze commented 3 years ago

@signed2 Sorry for the delay on responding to this, but I didn't see the notification.

Running XCP 7.5.0. I ended up getting a hackish solution to work.

1) I had to patch the xcp kernel to include the module for ACM (which wasn't included by default). Once I recompiled the kernel module and installed it, at least DOM0 would then recognize the stick in the USB port. I did have trouble getting the kernel module built and unfortunately don't remember / didn't document exactly what I had done. But I do remember I had to rebuild the entire kernel, and then just keep the module I wanted. 2) installed ser2net on DOM0 and enabled it as a systemd service. Changed added the following to the /etc/ser2net.conf file:

3024:raw:0:/dev/ttyACM0:115200

3) start ser2net 4) was then able to connect to the zwave dongle via TCP port 3024. My POC was using HomeSeer which has built-in capabilities to connect to TCP port, but also tried with OpenHab using socat and got it working as well.

The following were some handy references that I used:

markhaines commented 3 years ago

In case it's of interest I followed the instructions above to flip some of the categories from DENY to ALLOW and my Dresden ConBee II Zigbee stick is passing through fine to my HomeAssistant install on XCP-NG 8.2

psychogun commented 2 years ago

For my Sigma Designs, Inc._Aeotec Z-Stick Gen5 (ZW090) - UZB dongle I did the following to make it show in xe pusb-list:

I then added ALLOW:vid=0658 pid=0200 # Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB on the top of /etc/xenserver/usb-policy.conf file.

Then it showed up:

xe pusb-list 
uuid ( RO)            : c17c9a47-abae-3982-ce27-090c3f7dcbc0
            path ( RO): 1-9
       vendor-id ( RO): 0658
     vendor-desc ( RO): Sigma Designs, Inc.
      product-id ( RO): 0200
    product-desc ( RO): Aeotec Z-Stick Gen5 (ZW090) - UZB
          serial ( RO): 
         version ( RO): 2.00
     description ( RO): Sigma Designs, Inc._Aeotec Z-Stick Gen5 (ZW090) - UZB
           speed ( RO): 12.000

(Run xe pusb-scan to confirm the file can be parsed correctly:

I then enabled the device for passthrough:

xe pusb-param-set uuid=c17c9a47-abae-3982-ce27-090c3f7dcbc0 passthrough-enabled=true

Found the group uuid:

xe usb-group-list PUSB-uuids=c17c9a47-abae-3982-ce27-090c3f7dcbc0

Listed the current VMs to find the VM-UUID (stop Home Assistant if it is running - xe vm-shutdown uuid=<VM-UUID>:

xe vm-list

I then attached the USB to the VM:

xe vusb-create usb-groupd-uuid=<USB-GROUP-UUID> vm-uuid=<VM-UUID>

And everything just works..?

Alphaprot commented 2 years ago

And everything just works..?

Confirming that passthrough into a HassOS-template based VM (based on the official .ova template) works like @psychogun described (thank you very much btw 👍) on XCP-NG 8.2

hayer commented 2 years ago

Completely forgot about this issue. Had this working with the Aeotec stick since 8.2, just like @psychogun described. Directly attached to the motherboard's USB controller.

Having some problems with the stick dropping out sometimes. Need to shutdown VM, unplug USB, plug in USB, setup passthrough again, start VM, to get it working again. Haven't looked into that - also most likely switching over to ZigBee as it seems way more responsive.

psychogun commented 2 years ago

Hopefully this will soon be able to do through the GUI of xoa, it is a pain in the butt.

This is why I have not switched over from proxmox to xcp-ng on all my hosts yet..

Alphaprot commented 2 years ago

Having some problems with the stick dropping out sometimes. Need to shutdown VM, unplug USB, plug in USB, setup passthrough again, start VM, to get it working again.

Interesting… I will keep an eye out for this behaviour, maybe it’s only hardware-platform related.

Running on one of my R320’s back USB ports. What underlying hardware are/were you using @hayer ?

hayer commented 2 years ago

@Alphaprot SuperMicro X10DRL-i, BIOS version 3.4 w/ 2x Xeon E5-2620 v3

Still running it. The problem seems to occur when restarting some services in the VM that uses the USB stick.

eresonance commented 2 years ago

I think this issue can be closed with xcp-ng 8.2 and following the instructions @psychogun made above.

tompapajr commented 1 week ago

I wanted to add my recent experience trying to add passthrough for both my Zigbee ConBee II USB and Aeotec Z-Stick Gen 5 USB dongles to my xcp-ng 8.2 Home Assistant OS VM. After following @psychogun intstructions, the Aeotec seemed to remain consistantly connected, but I struggled with the Zigbee ConBee II, it would dissaspear after booting up the VM. In working with my friend Claude the following is what we did to get it to remain consistant in the VM:

xe vm-param-set uuid= other-config:usb_enabled=true xe vm-param-set uuid= platform:usb=true xe vm-param-set uuid= platform:usb-auto=true xe vm-param-set uuid= platform:usb-version=2