KnF

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by KnF

  1. Sorry for necro-resurrection. Did you tried it out?
  2. Well.. that was quick. I added the sleep(1); and everything messed up. Then I changed the $filename to include the $usbdev so it wouldn't collide with the same file that was being generated by the other USB devices and it worked flawlessly. No more errors!! 🥳 $filename = '/tmp/libvirthotplugusbbybus'.$vmname.'-'. $usbdev .'.xml';
  3. It's me again. I'm having some issues, but I will not ask you to solve them. I'm going to try help you improve this plugin which is already awesome. I'm a 15 year experience dev so I think I can try to debug the issues that I'm having, but I might need your help from time to time. I've been trying to pinpoint an issue. Most of the times it works just fine, but sometimes it doesn't. I'm gonna explain my setup so you get more context. I have a Ugreen USB 3.0 Switch which has 4 "devices" ports and 2 "computer" ports. When you press the button on top of it, it disconnects the 4 "devices" from PC 1 and connects them into PC 2. You click again and the same thing happens but in reverse. So far so good. Never had any issues even though PC 1 is a PC (Unraid now) and PC 2 is a Macbook Pro (work laptop). I only have 3 devices connected to it. K70 Keyboard. Corsair Dongle for Headphones Logitech USB wireless receiver for mouse. Whenever I press the button to switch from PC 2 to PC 1 this is what I see in the syslog (time and host removed): Bear in mind that I deleted all the rules! kernel: usb 2-7: new SuperSpeed USB device number 40 using xhci_hcd kernel: hub 2-7:1.0: USB hub found kernel: hub 2-7:1.0: 4 ports detected kernel: usb 1-4.4: new high-speed USB device number 52 using xhci_hcd usb_manager: Info: rc.usb_manager usb_add GenesysLogic_USB3.1_Hub /dev/bus/usb/002/040 002 040 kernel: hub 1-4.4:1.0: USB hub found kernel: hub 1-4.4:1.0: 4 ports detected usb_manager: Info: rc.usb_manager Autoconnect No Mapping found GenesysLogic_USB3.1_Hub /dev/bus/usb/002/040 002 040 port 2-7 usb_manager: Info: rc.usb_manager usb_add GenesysLogic_USB2.0_Hub /dev/bus/usb/001/052 001 052 usb_manager: Info: rc.usb_manager Autoconnect No Mapping found GenesysLogic_USB2.0_Hub /dev/bus/usb/001/052 001 052 port 1-4.4 kernel: usb 1-4.4.2: new full-speed USB device number 53 using xhci_hcd kernel: input: Corsair Corsair K70R Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.2/1-4.4.2:1.0/0003:1B1C:1B09.0175/input/input485 kernel: hid-generic 0003:1B1C:1B09.0175: input,hidraw2: USB HID v1.11 Keyboard [Corsair Corsair K70R Gaming Keyboard] on usb-0000:00:14.0-4.4.2/input0 kernel: input: Corsair Corsair K70R Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.2/1-4.4.2:1.1/0003:1B1C:1B09.0176/input/input486 kernel: hid-generic 0003:1B1C:1B09.0176: input,hidraw3: USB HID v1.11 Device [Corsair Corsair K70R Gaming Keyboard] on usb-0000:00:14.0-4.4.2/input1 kernel: input: Corsair Corsair K70R Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.2/1-4.4.2:1.2/0003:1B1C:1B09.0177/input/input487 kernel: hid-generic 0003:1B1C:1B09.0177: input,hidraw4: USB HID v1.11 Keyboard [Corsair Corsair K70R Gaming Keyboard] on usb-0000:00:14.0-4.4.2/input2 kernel: usb 1-4.4.3: new full-speed USB device number 54 using xhci_hcd usb_manager: Info: rc.usb_manager usb_add Corsair_Corsair_K70R_Gaming_Keyboard /dev/bus/usb/001/053 001 053 kernel: input: Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.3/1-4.4.3:1.3/0003:1B1C:0A3E.0178/input/input488 kernel: input: Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.3/1-4.4.3:1.3/0003:1B1C:0A3E.0178/input/input489 kernel: input: Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.3/1-4.4.3:1.3/0003:1B1C:0A3E.0178/input/input490 kernel: hid-generic 0003:1B1C:0A3E.0178: input,hiddev98,hidraw5: USB HID v1.11 Device [Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset] on usb-0000:00:14.0-4.4.3/input3 kernel: hid-generic 0003:1B1C:0A3E.0179: hiddev99,hidraw6: USB HID v1.11 Device [Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset] on usb-0000:00:14.0-4.4.3/input4 kernel: usb 1-4.4.4: new full-speed USB device number 55 using xhci_hcd usb_manager: Info: rc.usb_manager usb_add Corsair_CORSAIR_VIRTUOSO_SE_Wireless_Gaming_Headset_16addd87000400da /dev/bus/usb/001/054 001 054 kernel: input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.0/0003:046D:C539.017A/input/input491 kernel: hid-generic 0003:046D:C539.017A: input,hidraw7: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:00:14.0-4.4.4/input0 kernel: input: Logitech USB Receiver Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.1/0003:046D:C539.017B/input/input492 kernel: input: Logitech USB Receiver Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.1/0003:046D:C539.017B/input/input493 kernel: input: Logitech USB Receiver System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.1/0003:046D:C539.017B/input/input494 kernel: hid-generic 0003:046D:C539.017B: input,hiddev100,hidraw8: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:14.0-4.4.4/input1 kernel: hid-generic 0003:046D:C539.017C: hiddev101,hidraw9: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-4.4.4/input2 usb_manager: Info: rc.usb_manager Autoconnect Parent 1-4.4 usb_manager: Info: rc.usb_manager Autoconnect No Mapping found Corsair_Corsair_K70R_Gaming_Keyboard /dev/bus/usb/001/053 001 053 port 1-4.4.2 usb_manager: Info: rc.usb_manager Autoconnect Parent 1-4.4 usb_manager: Info: rc.usb_manager Autoconnect No Mapping found Corsair_CORSAIR_VIRTUOSO_SE_Wireless_Gaming_Headset_16addd87000400da /dev/bus/usb/001/054 001 054 port 1-4.4.3 usb_manager: Info: rc.usb_manager usb_add Logitech_USB_Receiver /dev/bus/usb/001/055 001 055 usb_manager: Info: rc.usb_manager Autoconnect Parent 1-4.4 usb_manager: Info: rc.usb_manager Autoconnect No Mapping found Logitech_USB_Receiver /dev/bus/usb/001/055 001 055 port 1-4.4.4 Notice how usb_manager tries to map things as soon as they're detected. Now, I created a rule for the hub 1-4.4 so it attaches to the VM on plug and vm start. This is the log for the transition when I press the button (reconnection): kernel: usb 2-7: new SuperSpeed USB device number 44 using xhci_hcd kernel: hub 2-7:1.0: USB hub found kernel: hub 2-7:1.0: 4 ports detected kernel: usb 1-4.4: new high-speed USB device number 70 using xhci_hcd kernel: hub 1-4.4:1.0: USB hub found kernel: hub 1-4.4:1.0: 4 ports detected usb_manager: Info: rc.usb_manager usb_add GenesysLogic_USB3.1_Hub /dev/bus/usb/002/044 002 044 usb_manager: Info: rc.usb_manager Autoconnect No Mapping found GenesysLogic_USB3.1_Hub /dev/bus/usb/002/044 002 044 port 2-7 usb_manager: Info: rc.usb_manager usb_add GenesysLogic_USB2.0_Hub /dev/bus/usb/001/070 001 070 usb_manager: Info: rc.usb_manager Autoconnect No Mapping found GenesysLogic_USB2.0_Hub /dev/bus/usb/001/070 001 070 port 1-4.4 kernel: usb 1-4.4.2: new full-speed USB device number 71 using xhci_hcd kernel: input: Corsair Corsair K70R Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.2/1-4.4.2:1.0/0003:1B1C:1B09.01A3/input/input546 kernel: hid-generic 0003:1B1C:1B09.01A3: input,hidraw2: USB HID v1.11 Keyboard [Corsair Corsair K70R Gaming Keyboard] on usb-0000:00:14.0-4.4.2/input0 kernel: input: Corsair Corsair K70R Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.2/1-4.4.2:1.1/0003:1B1C:1B09.01A4/input/input547 kernel: hid-generic 0003:1B1C:1B09.01A4: input,hidraw3: USB HID v1.11 Device [Corsair Corsair K70R Gaming Keyboard] on usb-0000:00:14.0-4.4.2/input1 kernel: input: Corsair Corsair K70R Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.2/1-4.4.2:1.2/0003:1B1C:1B09.01A5/input/input548 kernel: hid-generic 0003:1B1C:1B09.01A5: input,hidraw4: USB HID v1.11 Keyboard [Corsair Corsair K70R Gaming Keyboard] on usb-0000:00:14.0-4.4.2/input2 kernel: usb 1-4.4.3: new full-speed USB device number 72 using xhci_hcd usb_manager: Info: rc.usb_manager usb_add Corsair_Corsair_K70R_Gaming_Keyboard /dev/bus/usb/001/071 001 071 kernel: input: Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.3/1-4.4.3:1.3/0003:1B1C:0A3E.01A6/input/input549 kernel: input: Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.3/1-4.4.3:1.3/0003:1B1C:0A3E.01A6/input/input550 kernel: input: Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.3/1-4.4.3:1.3/0003:1B1C:0A3E.01A6/input/input551 kernel: hid-generic 0003:1B1C:0A3E.01A6: input,hiddev98,hidraw5: USB HID v1.11 Device [Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset] on usb-0000:00:14.0-4.4.3/input3 kernel: hid-generic 0003:1B1C:0A3E.01A7: hiddev99,hidraw6: USB HID v1.11 Device [Corsair CORSAIR VIRTUOSO SE Wireless Gaming Headset] on usb-0000:00:14.0-4.4.3/input4 kernel: usb 1-4.4.4: new full-speed USB device number 73 using xhci_hcd usb_manager: Info: rc.usb_manager usb_add Corsair_CORSAIR_VIRTUOSO_SE_Wireless_Gaming_Headset_16addd87000400da /dev/bus/usb/001/072 001 072 kernel: input: Logitech USB Receiver as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.0/0003:046D:C539.01A8/input/input552 kernel: hid-generic 0003:046D:C539.01A8: input,hidraw7: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:00:14.0-4.4.4/input0 kernel: input: Logitech USB Receiver Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.1/0003:046D:C539.01A9/input/input553 kernel: input: Logitech USB Receiver Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.1/0003:046D:C539.01A9/input/input554 kernel: input: Logitech USB Receiver System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4:1.1/0003:046D:C539.01A9/input/input555 kernel: hid-generic 0003:046D:C539.01A9: input,hiddev100,hidraw8: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:14.0-4.4.4/input1 kernel: hid-generic 0003:046D:C539.01AA: hiddev101,hidraw9: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-4.4.4/input2 usb_manager: Info: rc.usb_manager Autoconnect Parent 1-4.4 usb_manager: Info: rc.usb_manager Autoconnect Parent vm state:running Corsair_Corsair_K70R_Gaming_Keyboard running 001 071 port 1-4.4.2 usb_manager: Info: rc.usb_manager Autoconnect Parent 1-4.4 usb_manager: Info: rc.usb_manager Autoconnect Parent vm state:running Corsair_CORSAIR_VIRTUOSO_SE_Wireless_Gaming_Headset_16addd87000400da running 001 072 port 1-4.4.3 acpid: input device has been disconnected, fd 13 acpid: input device has been disconnected, fd 14 usb_manager: Info: rc.usb_manager usb_add Logitech_USB_Receiver /dev/bus/usb/001/073 001 073 usb_manager: usb_manager virsh called KnF 1 71 Device attached successfully usb_manager: usb_manager virsh called KnF 1 72 error: Failed to attach device from /tmp/libvirthotplugusbbybusKnF.xml error: Requested operation is not valid: USB device 001:072 is in use by driver QEMU, domain KnF usb_manager: Info: rc.usb_manager Autoconnect Parent 1-4.4 usb_manager: Info: rc.usb_manager Autoconnect Parent vm state:running Logitech_USB_Receiver running 001 073 port 1-4.4.4 acpid: input device has been disconnected, fd 15 acpid: input device has been disconnected, fd 16 acpid: input device has been disconnected, fd 17 usb_manager: usb_manager virsh called KnF 1 73 Device attached successfully As you can see, there's 3 usb devices (71, 72 and 73) two of them attach successfully and there's one that fails to attach (the headset). Problem is that even though 71 (keyboard) attached successfully it doesn't work. When the keyboard works it shows in the device manager (inside the VM) as 3 "HID Keyboards" and when it doesn't it only shows up once. If I disconnect the keyboard from the switch and re-connect it, it works perfectly again.... What I think it's happening is that when the /tmp/libvirthotplugusbbybusKnF.xml file is being generated and passed to virsh it's too soon and there might be a race condition that's causing the issue. I'm gonna try to edit the files of the plugin and add a little delay to the execution of the virsh command. Maybe that's all it needs. I'll report back.
  4. Specs: Intel 12700K (UHD770) Asus Z690 Maximus Hero Hey! I just installed 6.10 on a brand new system. I have been able to create a VM, passthrough my 3070 and system is running super smooth. As a side quest I wanted to create an Ubuntu VM with the igpu passthrough but I haven't been able to get it working. Since I already done this with windows on 6.9 with an older gen cpu (8th) I thought the process would be the same, but I'm not managing to get it working. I created the VM and installed windows and all the virtio drivers and all of that, when I go and switch VNC for the iGPU I've been able to install the display drivers, but they failed and after a reboot I get error 43. All of this was done via RDP Cuz I can't get any signal on the monitor. I tried with and without the vbios_gvt_uefi.rom and also passing through the audio device. No luck. Error 43 in device manager and no signal on my monitor. Hope someone can enlighten me, cuz it´s driving me crazy haha Here's the VM XML <?xml version='1.0' encoding='UTF-8'?> <domain type='kvm'> <name>Windows 11</name> <uuid>2e2ad6f5-6e87-4c33-fb14-2fe31eb70576</uuid> <metadata> <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm"/> </metadata> <memory unit='KiB'>8388608</memory> <currentMemory unit='KiB'>8388608</currentMemory> <memoryBacking> <nosharepages/> </memoryBacking> <vcpu placement='static'>4</vcpu> <cputune> <vcpupin vcpu='0' cpuset='0'/> <vcpupin vcpu='1' cpuset='1'/> <vcpupin vcpu='2' cpuset='2'/> <vcpupin vcpu='3' cpuset='3'/> </cputune> <os> <type arch='x86_64' machine='pc-i440fx-6.2'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader> <nvram>/etc/libvirt/qemu/nvram/2e2ad6f5-6e87-4c33-fb14-2fe31eb70576_VARS-pure-efi-tpm.fd</nvram> </os> <features> <acpi/> <apic/> <hyperv mode='custom'> <relaxed state='on'/> <vapic state='on'/> <spinlocks state='on' retries='8191'/> <vendor_id state='on' value='none'/> </hyperv> </features> <cpu mode='host-passthrough' check='none' migratable='on'> <topology sockets='1' dies='1' cores='2' threads='2'/> <cache mode='passthrough'/> </cpu> <clock offset='localtime'> <timer name='hypervclock' present='yes'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/local/sbin/qemu</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback'/> <source file='/mnt/user/domains/Windows 11/vdisk1.img'/> <target dev='hdc' bus='virtio'/> <boot order='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/mnt/user/isos/Win11_English_x64v1.iso'/> <target dev='hda' bus='ide'/> <readonly/> <boot order='2'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/mnt/user/isos/virtio-win-0.1.217.iso'/> <target dev='hdb' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> <controller type='pci' index='0' model='pci-root'/> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='virtio-serial' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </controller> <controller type='usb' index='0' model='ich9-ehci1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/> </controller> <interface type='bridge'> <mac address='52:54:00:e4:fb:34'/> <source bridge='br0'/> <model type='virtio-net'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <channel type='unix'> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <input type='tablet' bus='usb'> <address type='usb' bus='0' port='1'/> </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <tpm model='tpm-tis'> <backend type='emulator' version='2.0' persistent_state='yes'/> </tpm> <audio id='1' type='none'/> <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </source> <rom file='/mnt/user/isos/vbios/vbios_gvt_uefi.rom'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </hostdev> <memballoon model='none'/> </devices> </domain> patos-pc-diagnostics-20220518-1946.zip
  5. It does try to map it, but it shows a random error which goes away with the flick of a switch, it´s Corsair Virtuoso. It has some weird way of working.. when you turn the headset off it acts like the usb device were unplugged, this way the OS stops detecting the Sound device and automagically switches to the next audio output...
  6. Man, I gotta say... I´ve been holding back on moving my main pc to unraid just because I can't get additional usb controllers. This plugin saved me a lot of money and I whish I would have found it a month ago. This is FUCKING GENIUS! I use a USB switch to go between my work laptop (which isn´t optional) to my PC for gaming.... So I don't have to be swithing cables all the time. Whith this plugin I just set the rule and now when I press the switch button everything works almost-flawlessly. Sometimes my wireless headphones don't show up but it's just a matter of switching them off and on again... I'm so happy right now.. you have no clue! THANKS!