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
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.