Skip to content

Instantly share code, notes, and snippets.

@thanhminhmr
Created April 22, 2024 08:40
Show Gist options
  • Save thanhminhmr/41d6cf14ef86c383a59ad26314ed1f3d to your computer and use it in GitHub Desktop.
Save thanhminhmr/41d6cf14ef86c383a59ad26314ed1f3d to your computer and use it in GitHub Desktop.
Hyper-V USB Passthrough using USBIP (afaik the *only* way)
  1. (Optional) Run this to disable "Microsoft Wi-Fi Direct Virtual Adapter" if you planned to passthrough a USB Wifi adapter.
netsh wlan stop hostednetwork
netsh wlan set hostednetwork mode=disallow
  1. Get VendorID and ProductID of the USB device, both are 4 hexadecimal digits. There are many ways to do this, the easy enough way for a noob is to plug it in, open Device Manager, right-click the device and open Properties, choose Details tab, on the Property drop-down, select Hardware Ids. The value should be something like USB\VID_ABCD&PID_1234, that should make the VendorID be ABCD and ProductID be 1234.

  2. Install usbipd-win: https://github.com/dorssel/usbipd-win/

  3. Run this command to force the USB device to be shared (Remember to put the VendorID and ProductID in the command). The -f switch will force the USB device to disconnect itself from the host, even when the client is not connected yet.

usbipd bind -i $VID:$PID -f
  1. Follow this to setup the usbip client on Debian, should be the same for other Linux distro: https://www.unifix.org/2023/11/28/usbip-on-debian-12-usb-device-sharing-over-ip-network/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment