“If you are using Windows and looking for a way to share a USB device over the network, to other machines, or to Hyper-V or WSL 2 virtual machines, you’ll need to utilize what is known as USB/IP sharing. This enables you to share devices like scanners or old printers among multiple computers on the same network.
This utility, well-known to Linux users, is called usbipd, and a Windows version of it can be downloaded here. Alternatively, you can install it via Winget using the following command:
winget install usbipd
Once installed, the tool is used via the command line and allows all devices available on the network to connect to the USB device of your choice. Don’t worry, as nothing is shared by default. You’ll need to list the devices using the command:
This will provide a list of your devices with IDs like 3-1, 3-5, etc. To put a device on the network, run the following command:
usbipd bind --busid=X-X
Replace ‘X-X’ with the appropriate ID (e.g., 3-5).
To connect to the shared device on the remote system, use the following command:
usbip list --remote=HOST
Replace ‘HOST’ with the IP of the machine. Voilà! You now have access to the USB device as if it were directly connected to your own machine. Keep in mind that, depending on your network, there might be some minor latency or bandwidth issues.
You can also use the ‘usbipd wsl‘ subcommand to share and connect a device with a single command under WSL2. Additionally, note that it’s possible to perform these actions via a graphical interface using this tool.