SimonF Posted April 4 Author Share Posted April 4 23 minutes ago, Reid B said: Sorry I ran that after rebooting the VM where it says its connected, but detaching and re-attaching and then running the command here is the output. can you post diagnostic and I will look at it tomorrow. Quote Link to comment
Reid B Posted April 4 Share Posted April 4 See attached, thank you. goliath-diagnostics-20240404-1732.zip Quote Link to comment
SimonF Posted April 5 Author Share Posted April 5 15 hours ago, Reid B said: See attached, thank you. goliath-diagnostics-20240404-1732.zip 119.66 kB · 1 download Did you add this entry to the xml? <hub type="usb"> <address type="usb" bus="0" port="2"/> </hub> There a lots of errors keep apearing for the Simucube how is it connected, Is there enough power. Bandwidth is only showing as 12mb is that enough? can you send udevadm info query -a -p /sys/bus/usb/devices/1-11.2 Quote Link to comment
Reid B Posted April 5 Share Posted April 5 I have not added any entries to the xml manually, should I? I also cant find any information on how much bandwidth it needs, it is a servo motor. This is all I can find in their documentation about USB usage. The device has its own external power supply and I have tried several motherboard USB slots as well as a powered USB hub. I also tested the device on a machine running windows naively and it works fine. Quote Wheel axis: X axis, Unsigned 16 bit field, 0-65535 value Y axis: Unsigned 16 bit field. This axis will idle at center position. However, users can map external pedal or handbrake to this axis. Do not utilize product X and Y axises for in-game menu browsing! Pedal/handbrake axises: 6 additional axises, unsigned 16 bit values. These can be set by users to inteface with Simucube-compatible pedals or handbrakes, or with (upcoming) analog axises (clutch paddles) from Simucube Wireless Wheels Buttons: There are 128 buttons. I have no other peripherals plugged in through the wheel, so I feel like it should just be using the X axis. Here is the output from the query: Quote looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2': KERNEL=="1-11.2" SUBSYSTEM=="usb" DRIVER=="usb" ATTR{configuration}=="Simucube 2 Pro" ATTR{bMaxPacketSize0}=="64" ATTR{bDeviceClass}=="00" ATTR{bcdDevice}=="0200" ATTR{bNumInterfaces}==" 3" ATTR{bConfigurationValue}=="1" ATTR{manufacturer}=="Granite devices" ATTR{bNumConfigurations}=="1" ATTR{authorized}=="1" ATTR{speed}=="12" ATTR{idProduct}=="0d60" ATTR{urbnum}=="113" ATTR{devnum}=="55" ATTR{product}=="Simucube 2 Pro" ATTR{maxchild}=="0" ATTR{bmAttributes}=="c0" ATTR{bDeviceSubClass}=="00" ATTR{bMaxPower}=="100mA" ATTR{rx_lanes}=="1" ATTR{removable}=="unknown" ATTR{idVendor}=="16d0" ATTR{version}==" 2.00" ATTR{avoid_reset_quirk}=="0" ATTR{serial}=="206C354E5333" ATTR{bDeviceProtocol}=="00" ATTR{tx_lanes}=="1" ATTR{ltm_capable}=="no" ATTR{devpath}=="11.2" ATTR{busnum}=="1" ATTR{quirks}=="0x0" looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-11': KERNELS=="1-11" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bMaxPacketSize0}=="64" ATTRS{bDeviceClass}=="09" ATTRS{bcdDevice}=="8536" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="1" ATTRS{bNumConfigurations}=="1" ATTRS{authorized}=="1" ATTRS{speed}=="480" ATTRS{idProduct}=="0608" ATTRS{urbnum}=="986" ATTRS{devnum}=="13" ATTRS{product}=="USB2.0 Hub" ATTRS{maxchild}=="4" ATTRS{bmAttributes}=="e0" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPower}=="100mA" ATTRS{rx_lanes}=="1" ATTRS{removable}=="removable" ATTRS{idVendor}=="05e3" ATTRS{version}==" 2.00" ATTRS{avoid_reset_quirk}=="0" ATTRS{bDeviceProtocol}=="01" ATTRS{tx_lanes}=="1" ATTRS{ltm_capable}=="no" ATTRS{devpath}=="11" ATTRS{busnum}=="1" ATTRS{quirks}=="0x0" looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1': KERNELS=="usb1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bMaxPacketSize0}=="64" ATTRS{bDeviceClass}=="09" ATTRS{bcdDevice}=="0601" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="1" ATTRS{manufacturer}=="Linux 6.1.64-Unraid xhci-hcd" ATTRS{bNumConfigurations}=="1" ATTRS{authorized}=="1" ATTRS{speed}=="480" ATTRS{idProduct}=="0002" ATTRS{urbnum}=="1242" ATTRS{devnum}=="1" ATTRS{product}=="xHCI Host Controller" ATTRS{maxchild}=="16" ATTRS{bmAttributes}=="e0" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPower}=="0mA" ATTRS{rx_lanes}=="1" ATTRS{removable}=="unknown" ATTRS{idVendor}=="1d6b" ATTRS{interface_authorized_default}=="1" ATTRS{authorized_default}=="1" ATTRS{version}==" 2.00" ATTRS{avoid_reset_quirk}=="0" ATTRS{serial}=="0000:00:14.0" ATTRS{bDeviceProtocol}=="01" ATTRS{tx_lanes}=="1" ATTRS{ltm_capable}=="no" ATTRS{devpath}=="0" ATTRS{busnum}=="1" ATTRS{quirks}=="0x0" looking at parent device '/devices/pci0000:00/0000:00:14.0': KERNELS=="0000:00:14.0" SUBSYSTEMS=="pci" DRIVERS=="xhci_hcd" ATTRS{power_state}=="D0" ATTRS{broken_parity_status}=="0" ATTRS{subsystem_device}=="0x5007" ATTRS{dma_mask_bits}=="64" ATTRS{vendor}=="0x8086" ATTRS{local_cpus}=="ffff" ATTRS{class}=="0x0c0330" ATTRS{numa_node}=="-1" ATTRS{msi_bus}=="1" ATTRS{device}=="0x43ed" ATTRS{label}=="Onboard - Other" ATTRS{index}=="2" ATTRS{local_cpulist}=="0-15" ATTRS{driver_override}=="(null)" ATTRS{d3cold_allowed}=="1" ATTRS{irq}=="130" ATTRS{revision}=="0x11" ATTRS{consistent_dma_mask_bits}=="64" ATTRS{ari_enabled}=="0" ATTRS{enable}=="1" ATTRS{subsystem_vendor}=="0x1458" looking at parent device '/devices/pci0000:00': KERNELS=="pci0000:00" SUBSYSTEMS=="" DRIVERS=="" ATTRS{waiting_for_supplier}=="0" Quote Link to comment
SimonF Posted April 5 Author Share Posted April 5 2 hours ago, Reid B said: I have not added any entries to the xml manually, should I? Not sure as yet, not sure why the hub lines are there not seen that before in a standard xml. can you provide lsusb -vvvvs 001:055 Quote Link to comment
Reid B Posted April 5 Share Posted April 5 Bus 001 Device 055: ID 16d0:0d60 MCS Simucube 2 Pro Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x16d0 MCS idProduct 0x0d60 bcdDevice 2.00 iManufacturer 1 Granite devices iProduct 2 Simucube 2 Pro iSerial 3 206C354E5333 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x007c bNumInterfaces 0 bConfigurationValue 1 iConfiguration 2 Simucube 2 Pro bmAttributes 0xc0 Self Powered MaxPower 100mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 1 bFunctionClass 3 Human Interface Device bFunctionSubClass 0 bFunctionProtocol 0 iFunction 0 can't get device qualifier: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable Device Status: 0x0001 Self Powered Quote Link to comment
SimonF Posted April 5 Author Share Posted April 5 2 hours ago, Reid B said: Bus 001 Device 055: ID 16d0:0d60 MCS Simucube 2 Pro Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x16d0 MCS idProduct 0x0d60 bcdDevice 2.00 iManufacturer 1 Granite devices iProduct 2 Simucube 2 Pro iSerial 3 206C354E5333 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x007c bNumInterfaces 0 bConfigurationValue 1 iConfiguration 2 Simucube 2 Pro bmAttributes 0xc0 Self Powered MaxPower 100mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 1 bFunctionClass 3 Human Interface Device bFunctionSubClass 0 bFunctionProtocol 0 iFunction 0 can't get device qualifier: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable Device Status: 0x0001 Self Powered Looks like there is a serial component, try using connect as serial, but his may mean other parts are not mapped as there are 3 interfaces for the USB device. I will have to do some research to see if I can find other solutions if that does not work. Do you have an option for a USB PCI card you can pass thru to the vm and connect the device to that? Quote Link to comment
Reid B Posted April 5 Share Posted April 5 Adding in the serial connection option did not get it working. I do not have any USB PCI cards. I am basically passing every USB device through I can, so I am happy to pass all my devices through on the hubs. Quote Link to comment
SimonF Posted April 6 Author Share Posted April 6 18 hours ago, Reid B said: Adding in the serial connection option did not get it working. I do not have any USB PCI cards. I am basically passing every USB device through I can, so I am happy to pass all my devices through on the hubs. Last idea I have a presentis to see if turning off guest reset helps. create a temp file i.e. nano /tmp/vmaddxml and add the text below. Change device ID to match if not still 055 <hostdev mode='subsystem' type='usb'> <source guestReset='off'> <address bus='001' device='055' /> </source> </hostdev> Detach the usb device from VM. Then run from the command line virsh attach-device "Adam Driver" /tmp/vmaddxml Since 8.6.0, the source element can contain guestReset attribute with the following value: off all guest initiated device reset requests are ignored uninitialized device request is ignored if device is initialized, otherwise reset is performed on device is reset on every guest initiated request This attribute can be helpful when assigning an USB device with a firmware that crashes on reset. Quote Link to comment
Reid B Posted April 6 Share Posted April 6 I created and ran the file as instructed, and get this error. Quote root@Goliath:~# virsh attach-device "Adam Driver" /tmp/vmaddxml error: Failed to attach device from /tmp/vmaddxml error: internal error: Did not find USB device bus:1 device:45 The device is still listed as device 55 and that's what it is written as in the script, so I'm not sure where the 45 comes from. Although the UI no longer says Virsh error when I attach the device. Quote Link to comment
SimonF Posted April 6 Author Share Posted April 6 24 minutes ago, Reid B said: I created and ran the file as instructed, and get this error. The device is still listed as device 55 and that's what it is written as in the script, so I'm not sure where the 45 comes from. Although the UI no longer says Virsh error when I attach the device. The gui will not show anything except connect outside when connected as the plugin functions are not being used. What does cat /tmp/vmaddxml show Quote Link to comment
Reid B Posted April 6 Share Posted April 6 Here is what it says Quote <hostdev mode='subsystem' type='usb'> <source guestReset='off'> <address bus='001' device='055' /> </source> </hostdev> Quote Link to comment
Reid B Posted April 6 Share Posted April 6 I borrowed a PCI USB card from a friend to try that, Unraid see's it as an extension of the USB network. I cannot seem to pass through the entirety of the PCI card, just the Hub 3-1. Still doesn't seem to work with or without the auto-connect options. Quote Link to comment
SimonF Posted April 6 Author Share Posted April 6 1 hour ago, Reid B said: I borrowed a PCI USB card from a friend to try that, Unraid see's it as an extension of the USB network. I cannot seem to pass through the entirety of the PCI card, just the Hub 3-1. Still doesn't seem to work with or without the auto-connect options. If you have a PCI card you should passthru that to the VM. In system devices bind that new card to vfio. I dont have a dedicate PCI USB, but like my A770 click the check box next to the card. Then the bind button will allow you to save the setting. You will need to reboot the server for that to take effect. Then in the VM you should see the card. in this section on the VM Template. Other PCI devices. Select the USB card and update. Now when the VM starts the whole card is connected to the VM and any USB devices connected will be on the VM. For devices connected to the card they do not need to be in the VM template and should not even show as the card is not bound to the host but the VM. Quote Link to comment
Reid B Posted April 6 Share Posted April 6 That seems to have worked. It is showing up as a USB device in my Windows VM with the correct information under USB View. The control software for it wont see it still, but I don't think that is an Unraid issue. I will look for help from their community for this. Thank you for your help. Quote Link to comment
unacm2 Posted April 10 Share Posted April 10 On 3/15/2024 at 11:31 AM, SimonF said: No these scripts need to be set in the sleep plug post and pre scripts. It is to disconnect the devices from the VM as they get renumbered at host resume. The disconnect just removes the attached usb devices from the VM. Is there a option to suspend as part of the sleep. I don't use sleep but these are options I provided to another user with the same issues. Hi SimonF, I want to thank you again for great work and support. I was unable to reply before, and even if I am giving up on unraid as my main working setup, I want to give feedback to what has worked for me. I used this in before sleep hook: #!/bin/bash date >> /boot/logs/sleep.log echo "Sleeping ..." >> /boot/logs/sleep.log # Get a list of all VMs that are running domains=$(virsh list --all | grep running) # Check if the previous command returned any data - If no VMs are running, the variable 'domains' will be empty if [ -z "$domains" ] then # Nothing to do here - exit echo "No VMs are running" >> /boot/logs/sleep.log exit 0 fi # 1 or more VMs are running echo "Found the following VMs running:" >> /boot/logs/sleep.log echo "$domains" >> /boot/logs/sleep.log # Get a list of the VM IDs domains=($(virsh list --all | grep running | awk '{ print $1 }')) # Issue the suspend command to each VM that is running for domain in "${domains[@]}"; do echo "Issuing the dompmsuspend and USB disconnect command to VM $domain" >> /boot/logs/sleep.log virsh dompmsuspend $domain mem sleep 5 rc.usb_manager vm_action $domain disconnect sleep 5 done and the following in after wake-up: #!/bin/bash date >> /boot/logs/sleep.log echo "Waking up ..." >> /boot/logs/sleep.log # Get a list of all VMs that are pmsuspended domains=$(virsh list --all | grep pmsuspended) # Check if the previous command returned any data - If no VMs are pmsuspended, the variable 'domains' will be empty if [ -z "$domains" ] then # Nothing to do here - exit echo "No VMs are pmsuspended" >> /boot/logs/sleep.log exit 0 fi # 1 or more VMs are pmsuspended echo "Found the following VMs pmsuspended:" >> /boot/logs/sleep.log echo "$domains" >> /boot/logs/sleep.log # Get a list of the VM IDs domains=($(virsh list --all | grep pmsuspended | awk '{ print $1 }')) # Issue the resume command to each VM that is pmsuspended for domain in "${domains[@]}"; do echo "Issuing the USB prepare and dompmwakeup command to VM $domain" >> /boot/logs/sleep.log rc.usb_manager vm_action $domain prepare sleep 5 virsh dompmwakeup $domain done which resulted in following log file: Mon Mar 18 17:21:23 CET 2024 Sleeping ... Found the following VMs running: 4 TheMainWindows10 running Issuing the dompmsuspend and USB disconnect command to VM 4 Mon Mar 18 17:22:06 CET 2024 Waking up ... Found the following VMs pmsuspended: 4 TheMainWindows10 pmsuspended Issuing the USB prepare and dompmwakeup command to VM 4 The scripts can obviously be less verbose, but I needed it for troubleshooting and adjusting sleep fudge factor. As said I am moving from my idea of one in all system, as cons outweigh the pros, and I will be running one pure Windows machine I need for my work, and another, most likely, unraid (zfs) for backups. Thanks again, and keep up the good work Quote Link to comment
IVData Posted April 13 Share Posted April 13 On 4/4/2024 at 5:26 AM, SimonF said: Release 2024.04.03 This works perfectly, thank you so much! Quote Link to comment
The Transplant Posted April 21 Share Posted April 21 Opening up an old topic discussed here a couple of years ago - I am looking to expose 2 serial ports to a VM. I am moving from a dedicated windows machine into a VM. The dedicated machine is using an EdgePort 416. I did try plugging that in and trying to access it through the USB Manager but with 16 serial ports and 4 USB ports it was too much to figure out. It looks like the USB Manager kept cycling and finding the ports and then losing the ports. But since my needs are quite simple - I thought I would just go and purchase two USB serial converters and plug them in. Are there any recommendations that have worked for others? Thanks. Quote Link to comment
SimonF Posted April 21 Author Share Posted April 21 1 hour ago, The Transplant said: Opening up an old topic discussed here a couple of years ago - I am looking to expose 2 serial ports to a VM. I am moving from a dedicated windows machine into a VM. The dedicated machine is using an EdgePort 416. I did try plugging that in and trying to access it through the USB Manager but with 16 serial ports and 4 USB ports it was too much to figure out. It looks like the USB Manager kept cycling and finding the ports and then losing the ports. But since my needs are quite simple - I thought I would just go and purchase two USB serial converters and plug them in. Are there any recommendations that have worked for others? Thanks. I use https://www.amazon.co.uk/UGREEN-20210-Converter-Connecting-Controller-grey/dp/B00QUZY4UG/ref=pd_ci_mcx_mh_mcx_views_0?pd_rd_w=IiYwv&content-id=amzn1.sym.c428a25c-eebb-4a80-982c-a8845b70a765%3Aamzn1.symc.ca948091-a64d-450e-86d7-c161ca33337b&pf_rd_p=c428a25c-eebb-4a80-982c-a8845b70a765&pf_rd_r=MZR2QPNS1S86FVW7ATDB&pd_rd_wg=3SN38&pd_rd_r=e3caf79b-8436-48a2-b496-4d254d72e7c5&pd_rd_i=B00QUZY4UG but have not tried two of them. Quote Link to comment
The Transplant Posted April 22 Share Posted April 22 15 hours ago, SimonF said: I use https://www.amazon.co.uk/UGREEN-20210-Converter-Connecting-Controller-grey/dp/B00QUZY4UG/ref=pd_ci_mcx_mh_mcx_views_0?pd_rd_w=IiYwv&content-id=amzn1.sym.c428a25c-eebb-4a80-982c-a8845b70a765%3Aamzn1.symc.ca948091-a64d-450e-86d7-c161ca33337b&pf_rd_p=c428a25c-eebb-4a80-982c-a8845b70a765&pf_rd_r=MZR2QPNS1S86FVW7ATDB&pd_rd_wg=3SN38&pd_rd_r=e3caf79b-8436-48a2-b496-4d254d72e7c5&pd_rd_i=B00QUZY4UG but have not tried two of them. Thanks - I have ordered two of them and will report back. Quote Link to comment
stefan.tomko Posted April 30 Share Posted April 30 (edited) Is there a way to clear all mappings? I am having strange issue after I replaced one of array drives. When array is stopped and VM/Docker is not running, and I look at USB tab, all ports seem correct (eg. devices that are supposed to be passed to one VM are marked with that VM, and unraid flash drive is marked as unraid flash drive). But once I start VM service, unraid flash drive gets passed to the VM and I am done at that point, my only chance is to go and reboot and start over. I can't figure this out. I am getting typical "usb corrupted" message as soon as USB gets passed to the VM. edit: I tried renaming vm_mappings.cfg (or similar) under /boot/config/plugins and reinstalled USB manager plugin, then my historical mappings were gone, so I thought it would help, but as soon as I started VM service, 2 of my USB devices got mapped to VM automatically, unraid flash included. Edited April 30 by stefan.tomko 1 Quote Link to comment
Kilrah Posted April 30 Share Posted April 30 (edited) Do you have any non-usb passed through devices? If so that would likely be where the issue is. Edited April 30 by Kilrah Quote Link to comment
stefan.tomko Posted April 30 Share Posted April 30 i am not sure I understand what you mean. Could you elaborate? Quote Link to comment
SimonF Posted April 30 Author Share Posted April 30 13 minutes ago, stefan.tomko said: Is there a way to clear all mappings? I am having strange issue after I replaced one of array drives. When array is stopped and VM/Docker is not running, and I look at USB tab, all ports seem correct (eg. devices that are supposed to be passed to one VM are marked with that VM, and unraid flash drive is marked as unraid flash drive). But once I start VM service, unraid flash drive gets passed to the VM and I am done at that point, my only chance is to go and reboot and start over. I can't figure this out. I am getting typical "usb corrupted" message as soon as USB gets passed to the VM. edit: I tried renaming vm_mappings.cfg (or similar) under /boot/config/plugins and reinstalled USB manager plugin, then my historical mappings were gone, so I thought it would help, but as soon as I started VM service, 2 of my USB devices got mapped to VM automatically, unraid flash included. You need to remove from here also. Loads configs into memory so doesn't not read flash all the time. root@computenode:~# ls /tmp/usb_manager/config/ remote_usbip.cfg usb_manager.cfg usb_rmt_connect.cfg vm_mappings.cfg Quote Link to comment
stefan.tomko Posted April 30 Share Posted April 30 OK this is strange, i have cleared all mappings from both patg and config. root@Tower:/tmp/usb_manager/config# ls remote_usbip.cfg usb_manager.cfg vm_mappings.cfg root@Tower:/tmp/usb_manager/config# more vm_mappings.cfg ******** vm_mappings.cfg: Not a text file ******** root@Tower:/tmp/usb_manager/config# root@Tower:/boot/config/plugins/usb_manager# ls packages/ remote_usbip.cfg usb_manager.cfg v2 vm_mappings.cfg vm_mappings.cfg.backup root@Tower:/boot/config/plugins/usb_manager# more vm_mappings.cfg ******** vm_mappings.cfg: Not a text file ******** root@Tower:/boot/config/plugins/usb_manager# As soon as i start array and VM gets started, unraid flash is passed to VM I can't go to VM settings to check it, as it does not show up after array start. Any ideas how to get out of this loop? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.