How to Use USB Redirector for Linux in USB Client Mode

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

Installing USB Redirector for Linux in USB client mode

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

./installer.sh install-client

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

If installation completed successfully, the daemon named usbsrvd will be running in your system, it does the actual redirection. You need to use usbclnt command-line utility for connecting/disconnecting USB devices, it is also installed in your system. All further operations are executed with the help of this utility

Command-line Syntax

The generic command-line syntax of usbclnt utility is:

usbclnt <command>

where <command> is one of the following:

  • -a, -add-server <address:port>

    Add USB server to configuration.

  • -r, -remove-server <address>:<port> | <serverid>

    Remove remote usb server from configuration and disconnect all USB devices from that server.

  • -c, -connect <server> <device> | <serverid>-<deviceid>

    Connect a specified device from a specified server. Server should be added to your configuration first.

  • -u, -disconnect <server> <device> | <serverid>-<deviceid>

    Disconnect a specified device from a specified server.

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

    Add specified device to exclusion list.

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

    Remove specified device from exclusion list.

  • -auto-connect on|off <server> <device> | <serverid>-<deviceid>

    Enable or disable automatic connection of a single device.

  • -auto-connect on|off <server> | <serverid>

    Enable or disable automatic connection of all devices on the specified server.

  • -l, -list-devices

    List all USB servers and their USB devices currently presented in configuration.

  • -i, -info

    Show information about this USB client.

  • -version

    Show program version.

Parameters used in the commands are as follows:

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

<serverid> is a server ID as displayed by -list-devices 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.

<server> is one of the following parameters that identify a remote USB server:

  • -serverid <serverid>

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

  • -server <address>:<port>

    Remote USB server address and port number as displayed by -list-devices command.

Connecting to a USB Server

To connect to a remote USB server, you need to add it into configuration. USB Redirector will automatically maintain a connection with all USB servers in your configuration. It means that if connection is broken for some reason, USB Redirector will re-connect automatically until connected.

To add a USB server into configuration you have to execute the following command:

usbclnt -add-server 192.168.1.2:32032

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

user@linux-vm:~$ usbclnt -add-server 192.168.1.2:32032 ====================== OPERATION SUCCESSFUL ===================== USB server has been added ===================== ======================= =================== user@linux-vm:~$

Getting a List of USB Servers and USB Devices

To get the list of USB servers and their USB devices you need to execute:

usbclnt -list-devices

You will see the following output:

user@linux-vm:~$ usbclnt -list-devices ================== LIST OF REMOTE USB DEVICES =================== 1: USB server at 192.168.1.2:32032 Mode: manual-connect Status: connected | |- 1: Flash Disk USB - USB Mass Storage Device | Vid: 0ea0 Pid: 2168 Serial: 611041F0886000B9 | Mode: manual-connect Status: available for connection | `- 19: FM1083 FORTEMEDIA - Composite USB Device Vid: 138c Pid: 0001 Port: 2-2 Mode: manual-connect Status: available for connection ===================== ======================= =================== user@linux-vm:~$

All devices and servers in USB Redirector are assigned with unique ID numbers, these IDs help to conveniently connect or disconnect devices, or manage servers in your configuration. The IDs are displayed by -list-devices command as shown above.

Each USB server is displayed with a status that can take the following values:

  • connected - USB client is connected to remote USB Server
  • disconnected - USB client can not connect to remote USB Server
  • version conflict - incompatible version of USB server on the remote computer

Each USB device is displayed with its own status:

  • available for connection - remote USB device is available for connection
  • not available - remote USB device is not available for connection
  • connected - remote USB device is connected to this computer
  • in exclusion list - remote USB device is in exclusion list and can not be connected

Connecting a USB Device by ID

For example, to connect the device named "19: FM1083 FORTEMEDIA - Composite USB Device" from the server named "1: USB Server at 192.168.1.2" you need to execute the following command:

usbclnt -connect 1-19

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

user@linux-vm:~$ usbclnt -connect 1-19 ====================== OPERATION SUCCESSFUL ===================== USB device connected ===================== ======================= =================== user@linux-vm:~$

Connecting a USB Device by VID and PID

It is possible to connect USB devices by their VID and PID. To connect the device named "19: FM1083 FORTEMEDIA - Composite USB Device" from the server named "1: USB Server at 192.168.1.2" you have to execute:

usbclnt -connect -server 192.168.1.2:32032 -vid 138c -pid 0001 -usb-port 2-2

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

user@linux-vm:~$ usbclnt -connect -server 192.168.1.2:32032 -vid 138c -pid 0001 -usb-port 2-2 ====================== OPERATION SUCCESSFUL ===================== USB device connected ===================== ======================= =================== user@linux-vm:~$

Disconnecting a USB Device

To disconnect the device named "19: FM1083 FORTEMEDIA - Composite USB Device" from the server named "1: USB Server at 192.168.1.2" you need to execute:

usbclnt -disconnect 1-19

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

user@linux-vm:~$ usbclnt -disconnect 1-19 ====================== OPERATION SUCCESSFUL ===================== USB device disconnected ===================== ======================= =================== user@linux-vm:~$