Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help - On a VM, how to restore USB connection when USB printer is turned on after standby

Featured Replies

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:


image.png

Everything works fine when the printer is powered on and the VM started.


I could see the printer connected from the VM:
image.png


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 output


I could see this by running lsusb on the VM and on unraid server:
On unraid:
image.png

On the VM:
image.png


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 by scipion
Typo

Solved by SimonF

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.

  • 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 by scipion

  • 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 approach

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.

  • 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:


image.png

And I have this in the settings of the VM:
image.png

What changes should I do in the above to implement what you suggested?
Thanks

  • Community Expert
  • Solution
9 minutes ago, scipion said:


Thanks for your answer
I have already the plugin set as below:


image.png

And I have this in the settings of the VM:
image.png

What changes should I do in the above to implement what you suggested?
Thanks

On the menu line there is USB which will take you to image.png

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

image.png

  • Author
31 minutes ago, SimonF said:

On the menu line there is USB which will take you to image.png

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

image.png


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!

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

image.png

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.