SimonF Posted February 29 Author Share Posted February 29 2 minutes ago, BurntOC said: Ah, attempted to manually execute the install script you referenced and it returns: Version is for qemu.d 6.12.8 No other output given. that is fine the file should be in the hooks/qemu.d dir now. 1 Quote Link to comment
BurntOC Posted February 29 Share Posted February 29 2 hours ago, SimonF said: that is fine the file should be in the hooks/qemu.d dir now. Yep, you're right - thanks! Quote Link to comment
alturismo Posted March 11 Share Posted March 11 may a question as i seems to missunderstand some config i have 2 Logitech Unify Receivers here for 2 VM's (1 GPU connected to a Mon, 1 GPU connected to a TV) 1/ AlsPC (Desktop VM Monitor) 2/AlsPC_Media (Gaming VM TV) so i assigned the different ports to the different VM's, but it looks like, depending on the last VM state it "mixed" the assignements in the GUI at least (and also not auto connecting the 2nd one here) now, when i start VM 1, i see the following screen as i see in the bottom, the device on Port 3-1-1-4 changed to AlsPC while device on Port 1-12 is auto connected to VM 1 (as it should) now, when i also start VM 2, i see the following screen the device on Port 3-1-1-4 stays on VM 1 (AlsPC) and is not auto working in VM 2 when i now change it again (3114) it will also change the upper setting in the GUI from VM 1 device (1-12) ... while the usb vm_mapping config looks like this, possible that the 1st entry is "shuffling" around ? my next step would be to delete this entry and look what happens or is there somethinng "special" todo with 2 simultan uuid devices ? Quote Link to comment
SimonF Posted March 11 Author Share Posted March 11 31 minutes ago, alturismo said: may a question as i seems to missunderstand some config i have 2 Logitech Unify Receivers here for 2 VM's (1 GPU connected to a Mon, 1 GPU connected to a TV) 1/ AlsPC (Desktop VM Monitor) 2/AlsPC_Media (Gaming VM TV) so i assigned the different ports to the different VM's, but it looks like, depending on the last VM state it "mixed" the assignements in the GUI at least (and also not auto connecting the 2nd one here) now, when i start VM 1, i see the following screen as i see in the bottom, the device on Port 3-1-1-4 changed to AlsPC while device on Port 1-12 is auto connected to VM 1 (as it should) now, when i also start VM 2, i see the following screen the device on Port 3-1-1-4 stays on VM 1 (AlsPC) and is not auto working in VM 2 when i now change it again (3114) it will also change the upper setting in the GUI from VM 1 device (1-12) ... while the usb vm_mapping config looks like this, possible that the 1st entry is "shuffling" around ? my next step would be to delete this entry and look what happens or is there somethinng "special" todo with 2 simultan uuid devices ? As it looks like both devices have the same serial ID you cannot use the device mapping. Just setup a port mapping per device to the correct VM. Quote Link to comment
alturismo Posted March 11 Share Posted March 11 24 minutes ago, SimonF said: As it looks like both devices have the same serial ID you cannot use the device mapping. Just setup a port mapping per device to the correct VM. ok, i thought thats what i did, but may didnt klick on the right spot and didnt notice im on "device" instead "port", seems removing device fixed it sorry and thanks. 1 Quote Link to comment
unacm2 Posted March 13 Share Posted March 13 Posted just now · Hidden - This content must be approved before it can be edited. Thanks a lot for the plugin it works great and brings me step closer to having Windows VM as my main Windows workstation. I do have however a problem: after being woken up from sleep (another plugin) devices are not working any more, keyboard and mouse do not react. After I de/attach them, either via USB page or physically, they start working but it will not be option any longer when this becomes my main Windows WS. Is there some way to do it automatically after being woken up from sleep? Sleep plugin has hooks to be executed before sleep and after being woken up, is there some command that could be executed? Thanks again Quote Link to comment
SimonF Posted March 13 Author Share Posted March 13 4 hours ago, unacm2 said: Thanks a lot for the plugin it works great and brings me step closer to having Windows VM as my main Windows workstation. I do have however a problem: after being woken up from sleep (another plugin) devices are not working any more, keyboard and mouse do not react. After I de/attach them, either via USB page or physically, they start working but it will not be option any longer when this becomes my main Windows WS. Is there some way to do it automatically after being woken up from sleep? Sleep plugin has hooks to be executed before sleep and after being woken up, is there some command that could be executed? Thanks again Yes you can, issue is that the real usb changes due to power state so you need to disconnect them before sleep and readd if the vm isin a suspend state. custom command before sleep: sleep 30 rc.usb_manager vm_action "vmname" disconnect custom command after wakeup: if [[ $(virsh list | grep "vmname") != "" ]] then rc.usb_manager vm_action "vmname" prepare virsh dompmwakeup "vmname" else echo "Not Running!" > /dev/null 2>&1 fi These are example scripts. Quote Link to comment
unacm2 Posted March 15 Share Posted March 15 Thanks a lot SimonF, I am currently abroad so I cannot test, but that's what I need. I have currently in sleep hooks virsh suspend and resume which I need to replace by your commands? I presume disconnect does dompmsuspend as you did not call it explicitly? And this sleep 30 is probably some empirical value based on your experience? Again thanks on great plugin and great support, Quote Link to comment
SimonF Posted March 15 Author Share Posted March 15 5 minutes ago, unacm2 said: Thanks a lot SimonF, I am currently abroad so I cannot test, but that's what I need. I have currently in sleep hooks virsh suspend and resume which I need to replace by your commands? I presume disconnect does dompmsuspend as you did not call it explicitly? And this sleep 30 is probably some empirical value based on your experience? Again thanks on great plugin and great support, 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. Quote Link to comment
unacm2 Posted March 15 Share Posted March 15 Yes, I need to use pre and post sleep plugin hook scripts. I need to suspend VM as well in pre hook. Do I need to detach usb before or after suspending VM? Thanks a lot Quote Link to comment
dboris Posted March 16 Share Posted March 16 (edited) On 10/8/2023 at 1:46 PM, dboris said: It works. Reboot bug was because somehow virsh wasn't interpreting the VM name when using parenthesis. So the script part for sleep is : virsh suspend HomeAssistant rc.usb_manager vm_action HomeAssistant disconnect And wake up : rc.usb_manager vm_action HomeAssistant prepare virsh resume HomeAssistant The irony at me having the same issue months later and searching again until I find my message. Edited March 16 by dboris Quote Link to comment
galloglypg Posted March 21 Share Posted March 21 On 4/29/2021 at 5:36 AM, SimonF said: @garydapogiOk I can produce the error on my test machine. I thought QEMU removed the device when it was disconnected from the host, but doesn't seem to be the case. Will add function to disconnect the device if udev detects a change. Do you get this once the system wakes up from sleep? Can you provide an extract of your syslog after a wake up so I can see if there are any USB disconnects. I couldn't find if or where this was ever addressed. I currently use a kvm switch to move between vm and laptop. This disconnects the usb devices when switching to the laptop and I have to reconnect when switching back to vm. After doing this ~5-8 times, depending on how many devices I am using at the time, the available ports (15) fill up and I am forced to stop the vm. Quote Link to comment
SimonF Posted March 22 Author Share Posted March 22 On 3/21/2024 at 5:37 PM, galloglypg said: I couldn't find if or where this was ever addressed. I currently use a kvm switch to move between vm and laptop. This disconnects the usb devices when switching to the laptop and I have to reconnect when switching back to vm. After doing this ~5-8 times, depending on how many devices I am using at the time, the available ports (15) fill up and I am forced to stop the vm. I thought I had implemented but will look over the weekend. Normally when a usb device disconnects it is automatically removed from the guest. Quote Link to comment
IVData Posted April 2 Share Posted April 2 Love this plugin, it's made my setup a lot less complicated One thing I want to do is to disconnect USB devices from one VM, and connect them to another via a script / SSH (for a keyboard/mouse and bluetooth adapter). Is there a way I can do this? I've had a look at the rc.usb_manager script but I can't quite work out which parameters are which. Preferably attaching by port instead of device. Thanks! Quote Link to comment
SimonF Posted April 2 Author Share Posted April 2 16 hours ago, IVData said: Love this plugin, it's made my setup a lot less complicated One thing I want to do is to disconnect USB devices from one VM, and connect them to another via a script / SSH (for a keyboard/mouse and bluetooth adapter). Is there a way I can do this? I've had a look at the rc.usb_manager script but I can't quite work out which parameters are which. Preferably attaching by port instead of device. Thanks! Not currently an option with rc script. I can look to add options. Have created code, but not merged and pacakged as yet. two options one for port and one for device serial_id Quote root@computenode:~# rc.usb_manager cmdlineport "1-2" "Unraid-VM" "attach" Device attached successfully root@computenode:~# rc.usb_manager cmdlinedevice "MSI_MYSTIC_LIGHT_A02021081203" "Unraid-VM" "detach" Device detached successfully root@computenode:~# https://github.com/SimonFair/USB_Manager/commit/552567430e0d67d6f3bb08920578ca99ad4e00f6 Quote Link to comment
IVData Posted April 3 Share Posted April 3 It would be amazing if you could add that! I have a LibreELEC VM and a windows VM for gaming both attached to my TV and being able to connect peripherals to whichever one I'm using automatically would be 👌 Quote Link to comment
SimonF Posted April 3 Author Share Posted April 3 12 hours ago, IVData said: It would be amazing if you could add that! I have a LibreELEC VM and a windows VM for gaming both attached to my TV and being able to connect peripherals to whichever one I'm using automatically would be 👌 Release 2024.04.03 Quote Link to comment
HGWBLN Posted April 3 Share Posted April 3 Hi Simon, thank you for your work and your patience answering all the questions. I have a Gigabyte C246M-WU4-CF Mainboard. This Motherboard has in total 12 USB-Ports, but it seems that this Motherboard has only one USB-Controller (Link: server_manual_c246m-wu4_e_1101.pdf (gigabyte.com), Page 7). My goal is to passthrou 2 USB Ports to a Win 10 VM. I installed the USB-Manager and the additional USBIP plugin. After the installation, all buttuons i see are grey. Does that mean that i can not passthrough single USB-Ports to a VM? Thank you very much. Quote Link to comment
SimonF Posted April 3 Author Share Posted April 3 38 minutes ago, HGWBLN said: Hi Simon, thank you for your work and your patience answering all the questions. I have a Gigabyte C246M-WU4-CF Mainboard. This Motherboard has in total 12 USB-Ports, but it seems that this Motherboard has only one USB-Controller (Link: server_manual_c246m-wu4_e_1101.pdf (gigabyte.com), Page 7). My goal is to passthrou 2 USB Ports to a Win 10 VM. I installed the USB-Manager and the additional USBIP plugin. After the installation, all buttuons i see are grey. Does that mean that i can not passthrough single USB-Ports to a VM? Thank you very much. I guess you dont have any devices connected. If you connect a device you will see it appear and then you can create a port or device mapping. If you have enabled hotplug you can attach devices via the VM tab also. If you toggle empty ports it will show empty ports also. Example with empty ports. Click on these icons. Left is for ports, right for Device Mapping and you will see. The settings. This is for a device. This is where you can specify VM and actions. Auto connect at plugin will attach usb device when connected. Auto connect at Start will attach at VM start. Start/Resume will start/resume a VM when as device is connect and and connect at plugin is enabled. Serial only is if you need to attach as a serial port, Things like ConbeeII needs this. Default is port 4 but if you have multiple you may need to change this. Port mapping is the same as a device but will connect any device on that port to a VM. Device will only do that device but will work across any port. Hope this helps. ps usbip extra is only required if you want to use usb devices over networks from/to other ser ers pcs etc 1 Quote Link to comment
HGWBLN Posted April 3 Share Posted April 3 1 hour ago, SimonF said: Hope this helps. I love you man, this works great Quote Link to comment
Reid B Posted April 4 Share Posted April 4 Hello, I'm having issues passing through one specific USB device to my windows VM. The device will not show up in the windows device manager. When i start the VM it says its connected, but the log says "no mapping found". If I detach and re-attach it I get a Virsh error, which I'm not sure what that means or what might cause it. I have the device and the 1-11 port already set up to auto connect on plugin and VM startup. All other devices seem to be working fine except this one. Any ideas what might be the issue? Quote Link to comment
SimonF Posted April 4 Author Share Posted April 4 7 minutes ago, Reid B said: Hello, I'm having issues passing through one specific USB device to my windows VM. The device will not show up in the windows device manager. When i start the VM it says its connected, but the log says "no mapping found". If I detach and re-attach it I get a Virsh error, which I'm not sure what that means or what might cause it. I have the device and the 1-11 port already set up to auto connect on plugin and VM startup. All other devices seem to be working fine except this one. Any ideas what might be the issue? Have you enabled serial in the mapping? Also looks like you have the USB defined in the VM Template. can you provide the output from this command. cat /usr/local/emhttp/state/usb.ini | grep -n6 virsh Quote Link to comment
Reid B Posted April 4 Share Posted April 4 By enabled serial in the mapping do you mean the "Connect as serial only" option? If that is the case then no. I do have the pass through selected as part of the VM settings, I set it up like that initially but had the issues and installed the plugin to try and troubleshoot. Here is the output of the command Quote Link to comment
SimonF Posted April 4 Author Share Posted April 4 13 minutes ago, Reid B said: By enabled serial in the mapping do you mean the "Connect as serial only" option? If that is the case then no. I do have the pass through selected as part of the VM settings, I set it up like that initially but had the issues and installed the plugin to try and troubleshoot. Here is the output of the command Strange I would expect to see an error Quote Link to comment
Reid B Posted April 4 Share Posted April 4 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. 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.