How to Use USB Redirector for Linux in USB Server Mode

USB Redirector for Linux can be used in USB server or USB client modes.

Installing USB Redirector for Linux in USB Server Mode

To install USB Redirector for Linux in USB server mode on your computer, you should download and extract the installation package, then execute the following command:

./installer.sh install-server

If you faced any problems during the installation, please read our installation troubleshooting guide.

When installation has completed, usbsrvd daemon should be running in your system. To share or unshare USB devices use usbsrv command-line utility. All further operations are executed with the help of this utility.

Command-line Syntax

The generic command-line syntax of usbsrv utility is:

usbsrv <command>

where <command> is one of the following:

  • -s, -share <device> | <deviceid>

    Share a USB device.

  • -t, -unshare <device> | <deviceid>

    Unshare a USB device.

  • -auto-share on|off

    Enable or disable auto-sharing mode.

  • -add-exclusion <device> | <deviceid>

    Add specified device to exclusion list to deny manual and automatic sharing.

  • -remove-exclusion <device> | <deviceid>

    Remove specified device from exclusion list.

  • -create-callback <address>:<port>

    Create callback connection to remote USB client.

  • -close-callback <address>:<port> | <client> | <clientid> | all

    Close callback connection to remote USB client.

  • -remote-auto-connect on|off <client> | <clientid>

    Enable or disable automatic connection of devices on the specified callback client.

  • -connect-to <client> <device> | <clientid>-<deviceid>

    Connect the specified device to the specified client. Client must be already connected to this server.

  • -disconnect-from <device> | <deviceid> | all

    Disconnect the specified device from a client.

  • -l, -list-devices

    Show a list of all USB devices currently present on server.

  • -list-clients

    Show a list of clients currently connected to the server.

  • -i, -info

    Show current USB server state.

  • -set-timeout <timeout> <device>

    Set inactivity timeout for a USB device. Timeout value is in seconds. Set to zero to disable inactivity timeout.

  • -set-tcp-port <port>

    Set TCP port number which is used by the server.


Parameters used in the commands are as follows:

<deviceid> is a device ID number as displayed by -list-devices command.

<clientid> is a client ID number as displayed by -list-clients command.

<device> is a combination of one or more of the following parameters that identify a USB device:

  • -deviceid <deviceid>

    Specific device ID number as displayed by -list-devices command.

  • -vid <vendorid>

    USB device vendor ID.

  • -pid <productid>

    USB device product ID.

  • -serial <serial>

    USB device serial number.

  • -usb-port <port>

    USB port number as displayed by -list-devices command.

  • -device-name "<name>"

    USB device name as displayed by -list-devices command. The name must be enclosed in double quotes.


<client> is one of the following parameters that identify a client connected to the server:

  • -clientid <clientid>

    Specific client ID number as displayed by -list-clients command.

  • -client <address>:<port>

    Remote client address and port number as displayed by -list-clients command.

Getting a List of USB Devices

To get a list of USB devices on your USB server, run the following command:

usbsrv -list-devices

If successful, this command will produce the output like this:

user@cyber:~$ usbsrv -list-devices =================== LIST OF LOCAL USB DEVICES =================== 1: Flash Disk - USB Mass Storage Device Vid: 0ea0 Pid: 2168 Port: 1-4 Status: plugged 16: USB-Serial Controller C Prolific Technology Inc. Vid: 067b Pid: 2303 Port: 3-1 Status: plugged, in exclusion list 18: USB Human Interface Device - Mouse Vid: 1241 Pid: 1166 Port: 2-1 Status: in use by 192.168.1.20 19: FM1083 FORTEMEDIA - Composite USB Device Vid: 138c Pid: 0001 Port: 2-2 Status: not plugged, shared ===================== ======================= =================== user@cyber:~$

All USB devices in USB Redirector are assigned with unique ID numbers, these IDs help to conveniently share or unshare devices, manage settings, etc. The IDs are displayed by -list-devices command as shown above, they are located to the left of device name.

Each USB device is displayed with the status which can take the following values:

  • plugged: USB device is plugged into the computer
  • not plugged: USB device is shared, but not currently plugged into the USB port
  • initializing: USB device is preparing for sharing, it will become shared in a moment
  • shared: USB device is shared and available for connection by clients
  • in use by <client>: USB device is shared and connected to a remote client
  • in exclusion list: USB device is in the exclusion list and can not be shared

Sharing a USB Device

Before a USB device can be redirected, it must be shared. The sharing makes a device available to remote clients.

For example, we will share the "Flash Disk - USB Mass Storage Device" that was listed by -list-devices command above. This can be done with the help of -share command:

usbsrv -share -vid 0ea0 -pid 2168 -usb-port 1-4

If successful, this command will display a message like this:

user@cyber:~$ usbsrv -share -vid 0ea0 -pid 2168 -usb-port 1-4 ====================== OPERATION SUCCESSFUL ===================== USB device has been shared ===================== ======================= =================== user@cyber:~$

Please note! If you plug this device into another USB port, the port number will change and USB Redirector will treat it as another device. This is not the case for devices with serial number, such devices will be properly identified in any USB port.

Alternatvely, it is possible to use a short form of the -share command and share the device by ID:

usbsrv -share 1

If successful, this command will display a message like this:

user@cyber:~$ usbsrv -share 1 ====================== OPERATION SUCCESSFUL ===================== USB device has been shared ===================== ======================= =================== user@cyber:~$

When USB device is shared, it will remain shared even after reboot. Shared devices are not accessible on the local system because they are acquired by USB Redirector to make them available for remote clients. To unshare a device use -unshare command.

Unsharing a USB Device

To unshare the "USB Human Interface Device - Mouse" listed on the screenshot above, you need to run:

usbsrv -unshare -vid 1241 -pid 1166 -usb-port 2-1

If successful, this command will display a message like this:

user@cyber:~$ usbsrv -unshare -vid 1241 -pid 1166 -usb-port 2-1 ====================== OPERATION SUCCESSFUL ===================== USB device has been unshared ===================== ======================= =================== user@cyber:~$

To unshare the same device by ID, run the following command:

usbsrv -unshare 18

If successful, this command will display a message like this:

user@cyber:~$ usbsrv -unshare 18 ====================== OPERATION SUCCESSFUL ===================== USB device has been unshared ===================== ======================= =================== user@cyber:~$

Changing TCP Port Number Used By USB Redirector

By default USB Redirector accepts incoming connections from clients on 32032 TCP port. To change the port number you can run:

usbsrv -set-tcp-port <port number>