From the USB/IP site:
- USB/IP Project aims to develop a general USB device sharing system over IP network. To share USB devices between computers with their full functionality, USB/IP encapsulates "USB I/O messages" into TCP/IP payloads and transmits them between computers.
List the connected devices:
$ usbip list -l
Bind the required device. For example, to share the device having busid 1-1.5:
$ usbip bind -b 1-1.5
To unbind the device:
$ usbip unbind -b 1-1.5
After binding, the device can be accessed from the client.
Binding with systemd service
In order to make binding persistent following systemd template unit file can be used:
[Unit] Description=USB-IP Binding on bus id %I After=network-online.target usbipd.service Wants=network-online.target Requires=usbipd.service #DefaultInstance=1-1.5 [Service] Type=simple ExecStart=/usr/bin/usbip bind -b %i RemainAfterExit=yes ExecStop=/usr/bin/usbip unbind -b %i Restart=on-failure [Install] WantedBy=multi-user.target
Make sure the
vhci-hcd kernel module is loaded.
Then list devices available on the server:
$ usbip list -r server_IP_address
Attach the required device. For example, to attach the device having busid 1-1.5:
$ usbip attach -r server_IP_address -b 1-1.5
A device can be disconnected only after detaching it on the client.
List attached devices:
$ usbip port
Detach the device:
$ usbip detach -p port_number
Unbind the device on the server:
$ usbip unbind -b busid