Access USB in Remote Desktop Session on Linux
You may be familiar with the Remote Desktop Protocol which is often referred to by its acronym of RDP. It is a secure communication protocol that makes use of the Windows Remote Desktop Connection tool to allow remote access to network-attached Windows computers.
RDP provides users with more functionality than simply accessing a remote machine and using its resources. It also allows you to transfer data between your local machine and a remote session. Using your local machine as a server, you can redirect its disks, printers, and other peripherals to a remote client computer. These capabilities are somewhat limited by bandwidth and you will be disappointed with performance if you try to use RDP for streaming videos or music.
RDP USB Redirector for the Linux OS lets remote desktop users access locally attached USB devices. USB redirection is accomplished by sharing a USB port and any devices attached to it. Various peripherals can be swapped in and out of the USB port with no need to make configuration changes.
Through the use of Linux RemoteFX USB Redirection [MS-RDPEUSB], USB devices can be shared between a server running Linux acting as the Terminal Client with a Windows client as the Terminal Server. This can be done without installing RDP USB Redirector on the Windows machine.
RDP USB Redirector for Linux has been tested on these platforms:
- Centos 7
- Ubuntu 14.04-18.04
- USB redirector RDP for Linux Client requires a kernel version
from 2.6.32 to 4.4.
RDP USB Redirector just needs to be installed on the two machines involved in sharing the device.
- RDP USB Redirector Server needs to be installed on the local computer which should have the client for Microsoft RDP protocol already in place. The Remote Desktop Connection serves as the client for the Microsoft RDP protocol.
- The RDP USB Redirector Client is required to be installed on the remote machine to enable it to use RDP to access shared USB devices. The server component for the Microsoft RDP protocol, Terminal Server, needs to be active on the remote machine.
Here’s a step by step process for implementing USB redirection over RDP to enable connection to USB interfaces and devices in your remote desktop session.
Linux users need to execute this command in Terminal:
xfreerdp --plugin usb4rdp
The <remote address> parameter is the IP address, domain name or computer name of the remote server. The xfreerdp RDP client and Electronic Team’s plugin are launched with this command. It provides the remote desktop session with complete RDP USB redirector functionality.
RemoteFX USB Redirection is supported with this configuration:
The client needs to be either Windows 8 (real or virtual machine) or Hyper-V running Windows 7 SP 1, with the RemoteFX GPU added, launched on Windows Server 2008 R2 SP 1 or Server 2012.
Use the following command using the FreeRDP USB redirection protocol:
xfreerdp-usb [shared-ports] xfreerdp-args
The command parameters are:
shared-ports: This is a comma-separated list of the TCP ports for USB devices that will be shared via RDP USB Redirector (aka USB Network Gate). If no list is specified, traffic from all shared USB devices will be redirected.
xfreerdp-args: arguments to pass to xfreerdp.
Some examples are:
- Redirect all shared USB devices: xfreerdp-usb -u User -p Pass 192.168.0.123
- Redirect USB devices shared on 1919 and 1920 TCP ports: xfreerdp-usb 1919,1920 -u User -p Pass 192.168.0.234
You may be presented with an SSL_read: I/O error which can be resolved by adding the “-rfx” parameter with no quotes before the IP address in the command.
Additional Features of USB Redirector
1. Redirecting audio USB devices in an RDP session
The xfreerdp command needs some additional parameters to effectively share audio USB devices in an RDP session: xfreerdp plugin usb4rdp -0 -o server.
This command uses the RDP USB redirector developed by the Electronic Team instead of using the standard RDP client.
2. Additional plugins are available
For example: xfreerdp --plugin cliprdr --plugin usb4rdp xxx.xx.xx.xx
The clipdr plugin from Electronic Team extends the functionality of xfreerdp and synchronizes client and server clipboard data. Refer to freeRDP documentation to find out more information regarding plugins and user commands that are supported.
3. Electronic Team’s plugins are compatible with all xfreerdp versions beginning from 1.0. Rdesktop and Remmina USB redirection are not supported.
Electronic Team has combined the server and client portions of its USB redirector over RDP tool in a unified application. Only the server part of the program needs to be registered. Clients that are accessing remote USB devices shared from the server can continue to do so even after the program’s trial period ends.
After a connection with the shared device is established over RDP, the equipment can be used with the same degree of functionality as that of directly connected peripherals. Your system’s Device Manager and all of your applications will recognize it as a local device.
Note: Since version 7.x of USB Redirector RDP, support for the ICA protocol was added. This allows remote sessions over ICA to access USB devices attached to thin clients.