December 14, 2025Dec 14 In order to have a shared network printer, I used an USB printer and I managed to configure a print server on an Ubuntu VM running on my unraid server.I configured the VM with the option 'USB Devices' set as follows:Everything works fine when the printer is powered on and the VM started.I could see the printer connected from the VM:But I noticed that after some time the connection to the usb on the VM is lost. Most likely because the printer went in standby mode.Even when I power on the printer the connection is not restored and I have to restart the VM.[Edit] Not exactly when the printer goes on standby or restarted , but on the first print request after this.I ran a script to check using lsusb. The printer was always displayed.When I sent a print request the printer disappeared from lsusb outputI could see this by running lsusb on the VM and on unraid server:On unraid:On the VM:As I am able to know if the printer is available or no on both the VM and the unraid server:is there a way to restore/refresh the USB connection using command lines or file modification that I can execute on-demand or trigger automatically on regular basis?In such case I can script something on the unraid server on the VM to avoid having to restart the VM if possible.Thank you for any help or hints. Edited December 15, 2025Dec 15 by scipion Typo
December 21, 2025Dec 21 I admit this isn't answering your question directly. But if the IOMMU groups permit for your motherboard, perhaps stubbing out the USB controller in Unraid used by the ports for the printer, and allocating the stubbed USB controller, instead of the usb device (printer) to your VM? That's my 2-cents. Sorry I wouldn't know where to begin for a keep-alive script.
December 21, 2025Dec 21 Author 3 hours ago, Jcloud said:I admit this isn't answering your question directly. But if the IOMMU groups permit for your motherboard, perhaps stubbing out the USB controller in Unraid used by the ports for the printer, and allocating the stubbed USB controller, instead of the usb device (printer) to your VM?That's my 2-cents. Sorry I wouldn't know where to begin for a keep-alive script.Thanks - Theorically this should work as the printer is in the same IOMMU group with other USBs that I don't need.Although I don't know how to do itย ๐ย I will have to search the documentation and articles how to do so.I still believe that a keep-alive or refresh script (if possible) is a lighter approach Edited December 21, 2025Dec 21 by scipion
December 21, 2025Dec 21 Community Expert 32 minutes ago, scipion said:Thanks - Theorically this should work as the printer is in the same IOMMU group with other USBs that I don't need.Although I don't know how to do itย ๐ย I will have to search the documentation and articles how to do so.I still believe that a keep-alive or refresh script (if possible) is a lighter approachHave a look at my USB manager plugin, you can remove from the VM template and it will add to the VM when it is active. You would create a device mapping for the printer and connect to VM at start and when connected.
December 21, 2025Dec 21 Author 5 minutes ago, SimonF said:Have a look at my USB manager plugin, you can remove from the VM template and it will add to the VM when it is active. You would create a device mapping for the printer and connect to VM at start and when connected.Thanks for your answer I have already the plugin set as below:And I have this in the settings of the VM:What changes should I do in the above to implement what you suggested?Thanks
December 21, 2025Dec 21 Community Expert Solution 9 minutes ago, scipion said:Thanks for your answer I have already the plugin set as below:And I have this in the settings of the VM:What changes should I do in the above to implement what you suggested?ThanksOn the menu line there is USB which will take you to Click on the second icon device mapping, first is port mapping. Then it will take you to the settings. Select the VM and enable auto connect at plugin and VM start. The printer will need to be active for it to show in the view.
December 21, 2025Dec 21 Author 31 minutes ago, SimonF said:On the menu line there is USB which will take you to Click on the second icon device mapping, first is port mapping. Then it will take you to the settings. Select the VM and enable auto connect at plugin and VM start. The printer will need to be active for it to show in the view.Great - it seems to be working now. I tried to power off/power on the printer and I could see from the VM the printer when it was back. Without restaring the VM!I will do more tests with the standby mode/power off etc to see if everything is ok.What was misleading for me when I initially saw this option was the decription: "Auto connect at plugin and VM start", since I could see the printer after restarting the VM, I didn't conclude that it works also without restarting the VM.Thanks a lot for your help!
December 23, 2025Dec 23 On 12/21/2025 at 3:15 PM, scipion said:Thanks - Theorically this should work as the printer is in the same IOMMU group with other USBs that I don't need.Although I don't know how to do itย ๐ย I will have to search the documentation and articles how to do so.I still believe that a keep-alive or refresh script (if possible) is a lighter approach
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.