Skip to content
KyungWoon Cho edited this page Jan 24, 2021 · 5 revisions

Handling abortive disconnection

This feature is available from v0.3.3.

usbip.exe and usbipd.exe can clean up a usbip session when a peer goes away due to network failure or system error. Abortive disconnection is detected by utilizing TCP KEEPALIVE packet. If you want to set 3 seconds timeout, set a shell variable, KEEPALIVE_TIMEOUT as follows:

CMD> set KEEPALIVE_TIMEOUT=3
CMD> usbip.exe or usbipd.exe ...

USB Serial Overwriting

This feature is available from v0.3.3.

vhci(wdm or ude) can overwrite a USB serial in a device. A serial number to be overwritten should be passed via -s option of attach command as follows:

CMD> usbip.exe attach -r <server> -b <bus id> -s <USB serial string>

Maximum length of serial number is currently 127.

Scripting on Windows

If you want to run usbip-win in background instead of an open shell window, you can use SilentCMD by Stephan Brenner. It is a small utility (.exe) which calls a batch file and logs any output to a file.

You may write a Windows batch file which resolves your usbip-host and binds the USB device using usbip-win. Then you can configure your batch file in the silentcmd.exe.config file, along with some logging options. This enables you to attach your USB device with one doubleclick. You can further customize this solution by renaming the standard .exe file together with the .config file. Put the finishing touches to it by assigning a custom icon in Windows, e.g. Bluray icon for a Blueray player connected via usbip-win.

Energy management

In order to detach a drive before shutting down the computer or for putting it into standby mode, you can use the Windows Task Scheduler.

As triggers, you can use e.g.

  • "On disconnect from user session"
  • "On event". For Standby / Hibernate use: Protocol "Microsoft-Windows-Kernel-Power/Thermal-Operational", source "Microsoft-Windows-Kernel-Power", event ID "42"

As an action you can use e.g.

  • <path>\usbip.exe detach -p 1
  • a custom batch file checking on conditions etc.