Freerdp usb redirection настройка

Обновлено: 10.08.2022

I am trying to set up a home virtual environment and my current setup is as follows.

Server - Ubuntu 14.04 running virtualbox
VM - Ubuntu 14.04
"Thin client" - Ubuntu 14.04 running xfreerdp (latest nightly build)

I am now trying to get my development environment up and running which requires me to be able to attach my development board (ESP8266) to the thin client via USB and being able to see it in the VM. I have tried all of the following but I can not see the USB device in /dev on the VM.

sudo ./xfreerdp /dvc:urbdrc,idev:1a86:7523 /sec:rdp /v:ibmserver:9001

sudo ./xfreerdp /usb:dbg,dev:1a86:7523 /sec:rdp /v:ibmserver:9001

sudo ./xfreerdp /usb:auto,dev:1a86:7523 /sec:rdp /v:ibmserver:9001

sudo ./xfreerdp /usb:rules:allow /sec:rdp /v:ibmserver:9001

The output I get from the console is the same except for the debug version gives some more information. The debug one is


Does anyone have an ideal about what I am doing wrong?

Let's clear up some language between us so we have the same understanding . So we can describe and talk the same language.

* You say you have Ubuntu Server Edition 14.04.0x LTS, that is running Oracle VirtualBox as an Application.
Since VirtualBox is a GUI based application, and Server Edition is Text Console Based.
- How are you running VirtualBox on Server?
- Do you have a GUI installed on your Server Edition?

* You say you are running Ubuntu Desktop Edition 14.04.0x LTS as a VM from within VirtualBox.
Okay.
- This is where you say you have a problem, so I well address this at the end.

* You say you are running a thin-client. What you are describing is not a thin-client foundation, nor architecture. Because in the same line, you say that you are using freerdp. RDP stands for Remote Desktop Protocol. Mentioning that assumes that you are doing a remote desktop session from your VM to at least a fat client machine running the RDP client software to complete the connection. Confusion might be how they describe their releases. Releases. which stopped at a beta release over 2 years ago? I see some recent activity in their code. I know, as an OpenSource Project Leader and Dev Tester, that "dailies" are not releases. and are open for testing, (all bugs included at no additional cost). A daily is not even as stable as a beta release. They have their place, and are a necessary evil. But are fairly universally accepted as dev test code.

/* --- The actual problem you seem to be describing --- */
*** In VirtualBox, depending on what version you are running, you need to install VirtualBox'es Extension Pack . that is closed source, free dl from Oracle, to extend it enough for a VM guest to be able to see the Host's USB ports. Next, from a terminal session from the Ubuntu VM

Will display all the usb ports that the VM Guest sees. (and what it thinks it sees connected to those usb ports.)

Is that enough info to start? I'm away from home and will check on this later for your additional info.

Firstly thank you got getting back to me and apologies for the lack of clarity. To clarify the setup.

Server
As you described ( Ubuntu Server Edition 14.04.0x LTS, that is running Oracle VirtualBox as an Application). I have installed VirtualBox as a headless install by following these steps

There is no GUI installed on the server.

VM
As you describe (Ubuntu Desktop Edition 14.04.0x LTS as a VM from within VirtualBox). I have installed the extension pack within the guest OS but I don't believe I have installed it on the host OS (will check when I get home). Will also need to check exact versions of VirtualBox I am running. From memory the specific version mentioned in the guide above was not available to I selected the latest cut of 4.3 (I think this is 4.3-36) together with the corresponding extension pack. Will confirm when I get home.

"Thin client"
Sorry this was my sloppy use of the term. It is actually a 14.04 LTS desktop install on my laptop and I am running a xfreerdp session to connect to the Ubuntu VM. The idea being that anyone can RDP from any device to their VM running on the server.

In terms of the xfreerdp version, the reason I went to the latest nightly is because the stable version I had installed had the old format command line options and all the posts on the various forums about the USB redirection seemed to have the new format so hard for me to test out their suggestions. I couldn't find a newer stable version.

As it happens, I am not really wedded to xfreerdp so if there is something better, very happy to switch. I just need a Ubuntu RDP client that enables me to do the following
- specify the resolution size and open in full screen mode
- USB redirection
- Audio redirection
- Camera/ Microphone redirection

I will check the output of

when I get home. To check if I could see the USB device on the Ubuntu VM guest I was looking in /dev/ttyU* and nothing was mapped.

I also did one further test late last night. I tried connecting the USB device to the server to see if that showed up in the VM (i.e. /dev/ttyU* showed it) and that didn't work either. I assume this means there is an issue with my VM setup? I switched on USB 2 support and EHCI and added a blank rule (which I believe means that all will be passed through to the guest)?

Thanks once again for your help and I will post an update later when I get home

Not with the VM setup. You queried the VM, and it confirmed that the Virtual Machine does not see the USB port that has your "external device"as hardware. So there is no hardware passthrough of your USB in the hypervisor (in your case VirtualBox Headless) running on your host to your VM guest.

The Oracle Extension Pack installs to the Host. It is actually an VirtualBox associated filetype. So when running VirtualBox Standard (with GUI), you open the file with VirtualBox and it installs itself as an extension of VirtualBox. I guess the reason for that is VirtualBox itself is opensource code, but the Extension Pack is closed source, proprietary code. Even though the binary is provided free, the source code is a guarded technology.

Yes, old-school VirtualBox, prior to v4.x, you used the Guest Additions ISO, which you mounted to the guest to get additional capabilities. Since version 4.0, is now the extension pack, which since it installs to the hypervisor itself, you then only have to install once. (much simpler).

. SO, once you install that to your host, restart the host (because it involves restarting the linux kernel vboxdrv module) to pick up the update, then recheck what your VM sees as USB devices.

Thanks for this. I have some progress. I have installed the guest additions on the host server and now when I plug in the USB device into the server I can see it in the VM. :D:D

However when I plug it into the laptop and run the following xfreerdp command, I can not see the device using lsusb nor is there a /dev/ttyU* :(

Extra info as promised.

Virtualbox version on server - 4.3.36r105129Guest Additions installed on the server - Oracle_VM_VirtualBox_Extension_Pack-4.3.36-105129.vbox-extpack


xfreerdp client command - sudo ./xfreerdp /usb:dbg,dev:1a86:7523 /sec:rdp /v:ibmserver:9001 /sound:sys:alsa


Output in console

gives "This is FreeRDP version 1.0.2"

In virtualbox I have tried it with the blank filter (remote is set to "any") as well as without a filter and no change.

Собственно, кто нить поделитесь плиз живым конфигом. В мануалах расписано, как подключать по конкретному usb_id. А мне бы пробрасывать все флешки, которые втыкает пользователь.

Пока нашел такой вариант:

Пока придумал костыли:
В подключении прописываю ключ /drives, директория / от тонкого клиента монтируется в терминальную сессию. На рабочем столе пользователя создаю ярлык с путем \\tsclient\media\mnt\usbdevice\sda1
Грязно, но что делать?

P.S. Извиняюсь за количество постов, но я просто выкладываю решение для потомков.

Добавлено:
Ну и начались жуткие тормоза, невозможно ничего записать на флешку.

прошу помощи
Как победить проброс флешек через freerdp в thinstation?

--plugin rdpdr --data disk:flashka:/mnt/usbdevice/sda1

Ура! Работает!
Спасибо огромное.

Правда ошибка все равно возникает. Но теперь дело в доменных политиках, что-то там ограничено.

поспешил с ответом.
Работает через раз. Скопировал файл - скопировался. Тут же копирую файл в соседнюю папку - пишет ошибку, что невозможно скопировать.

Да пожалуйста, только вот я не понимаю, как за 5 дней не найти решения, если оно находится за 5 минут. :-woll:

[quote="admin" post=1802 если оно находится за 5 минут. :-woll:[/quote]
Ну, не 5 дней, а 2. И я очень много курил гугл. Такой конструкции, как вы предложили не видел. Однако, посмотрите мой первый пост - я там редиректил весь рут. Ошибка была постоянная. В вашей конструкции, у меня под админом все работает, а вот под пользователем не копирует файлы. Папки создает, переименовывает, удаляет. А скопировать файл с рабочего стола - хрен

Блин, какие-то файлы копирует, какие-то - нет!
Ересь какая-то. Фотки из сетевой папки скопировал. А из другой сетевой папки pdf - не копирует.

Разобрался. Не копируются файлы, в которых есть русские символы пичаль-бедаааа.

Тема начата Вами 5 дней назад, freerdp configuration в гугле первая же ссылка, там юзермануал, на 6 странице Examples.

Разобрался. Не копируются файлы, в которых есть русские символы пичаль-бедаааа.

Тема начата Вами 5 дней назад, freerdp configuration в гугле первая же ссылка, там юзермануал, на 6 странице Examples.


Именно из этого мануала приведен мой пример во втором посте. Стр. 26. Там ни слова не сказано, о возможности редиректить отдельные папки.
Кстати, пример, где указывается USB devid - не сработал. По крайней мере у меня.
В общем, не суть. С мануалами и примерами туговато, на мой взгляд. Странно, что тема thinstation так сильно не распространена.

Разобрался. Не копируются файлы, в которых есть русские символы пичаль-бедаааа.

Тоже самое. Причем заметил еще один косяк - когда на сервере терминалов включен русский интерфейс, то при действии "Создать новую папку" создается "Новая папка" на русском языке. Точнее не создается. Пишет ошибку. Когда включен английский язык ("New folder"), то новая папка прекрасно создается.
Остается ждать, когда разработчики freerdp пофиксят баг. Только вот с середины прошлого года апдейтов не было

И попробуй подключить флешку с уже имеющимися русскими именами файлов, посмотри как будут отображаться.
На всякий случай в build.conf поставь param fulllocales true, а локаль одну package locale-ru_RU

И так, на данном этапе, у меня на ТС флешка отображается, но вся кириллица знаками вопроса (Не понимаю, почему сразу этого не заметил и не протестировал в процессе).
Гугл дал ответ, что флешку нужно монтировать в линухе с параметрами -o codepage=xxx,iocharset=xxx. Экспериментирую именно ручками с командой mount в терминале в xfce. Так нагляднее.
При попытке смонтировать с параметрами codepage=866,iocharset=utf8, пишет, что codepage не найден такой. С другими кодировками такая же ботва.
В build.conf включены только две локали (en и ru) и fulllocales стоит в true.
Отсюда вопрос - с какими параметрами маунтить флешку и как добавить в thinstation недостающие локали?

Добавлено:
Путем эксперимента из десктопной убунты, нашел варинт: 866 и utf8. тоесть в сборку thinstation нужно добавить именно эти кодировки.

Заказчику потребовалось подключить USB–ключ для банковской системы к Linux–серверу в облаке, где он разворачивает свой разработанный продукт. Напрямую подключить USB–ключ к виртуальной машине нельзя — она работает в отказоустойчивом кластере и может быть смигрирована на любой из хост-серверов без даунтайма.


Давайте посмотрим, как реализовать проброс USB–ключа по сети в виртуальную машину с Linux в облаке Azure Pack Infrastructure от InfoboxCloud.

Раз подключить ключ к виртуальной машине нельзя — его нужно подключить к чему-то реальному. Есть аппаратные решения, например AnyWhere USB, но заказчик выбрал более универсальное решение: выделенный сервер в ЦОД Infobox (что для одного ключа получилось дешевле — аппаратные требования к выделенному серверу для такой задачи минимальны — можно использовать самый дешевый сервер с софтовым Raid).

Для проброса использовалось ПО USB Redirector (версия для Linux бесплатна). На выделенный сервер и в виртуальную машину в облаке была установлена Ubuntu 16.04 LTS и были применены все обновления.


Для установки USB Redirector потребуются исходные тексты ядра, установите их:


Теперь необходимо отключить обновления ядра ОС, так как они могут сломать работу USB Redirector (служба проброса после обновления ядра не будет запускаться до переустановки), если необходимо — их можно устанавливать вручную переустанавливая USB Redirector.

Установка и настройка USB Redirector на сервере с подключенным ключом USB

Скачайте USB Redirector:


Перейдите в папку с ним:


Разрешите запуск инсталлятора:

Добавьте службу проброса в автозагрузку, если ранее этого не произошло:


Подключив USB–ключ к выделенному серверу проверим какие USB–устройства доступны:


Есть 2 варианта расшарить устройство по сети.


В этом случае мы привязываемся к конкретному id устройства и порту, если включить usb-ключ в другой порт сервера — номер usb порта сменится и работать не будет.


В этом случае мы привязываемся только к id устройства. Теперь USB–устройство расшарено по сети.

Конечно делать его доступным для всех пользователей Интернет не правильно, поэтому добавим ограничения в firewall:


Где вместо *.*.*.* нужно написать адрес сервера, с которого разрешено подключение.

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:

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.

  • 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.

Установка клиента USB Redirector в облаке

Скачайте USB Redirector:


Перейдите в папку с ним:


Разрешите запуск инсталлятора:

Добавьте службу проброса в автозагрузку, если ранее этого не произошло:


Теперь добавим наш сервер:


Где вместо **.**.**.** нужно указать ip–адрес сервера.

Теперь можно посмотреть список доступных устройств:


Видим, что на сервере 1 доступно устройство 1.


Включаем автоматическое соединение с устройством:


USB–ключ был успешно проброшен в виртуальную машину в облаке.


5 Cups of Ubuntu

xfreerdp USB redirection help please

I am trying to set up a home virtual environment and my current setup is as follows.

Server - Ubuntu 14.04 running virtualbox
VM - Ubuntu 14.04
"Thin client" - Ubuntu 14.04 running xfreerdp (latest nightly build)

I am now trying to get my development environment up and running which requires me to be able to attach my development board (ESP8266) to the thin client via USB and being able to see it in the VM. I have tried all of the following but I can not see the USB device in /dev on the VM.

The output I get from the console is the same except for the debug version gives some more information. The debug one is

Does anyone have an ideal about what I am doing wrong?


Modules & Layers

Let's clear up some language between us so we have the same understanding . So we can describe and talk the same language.

* You say you have Ubuntu Server Edition 14.04.0x LTS, that is running Oracle VirtualBox as an Application.
Since VirtualBox is a GUI based application, and Server Edition is Text Console Based.
- How are you running VirtualBox on Server?
- Do you have a GUI installed on your Server Edition?

* You say you are running Ubuntu Desktop Edition 14.04.0x LTS as a VM from within VirtualBox.
Okay.
- This is where you say you have a problem, so I well address this at the end.

* You say you are running a thin-client. What you are describing is not a thin-client foundation, nor architecture. Because in the same line, you say that you are using freerdp. RDP stands for Remote Desktop Protocol. Mentioning that assumes that you are doing a remote desktop session from your VM to at least a fat client machine running the RDP client software to complete the connection. Confusion might be how they describe their releases. Releases. which stopped at a beta release over 2 years ago? I see some recent activity in their code. I know, as an OpenSource Project Leader and Dev Tester, that "dailies" are not releases. and are open for testing, (all bugs included at no additional cost). A daily is not even as stable as a beta release. They have their place, and are a necessary evil. But are fairly universally accepted as dev test code.

/* --- The actual problem you seem to be describing --- */
*** In VirtualBox, depending on what version you are running, you need to install VirtualBox'es Extension Pack . that is closed source, free dl from Oracle, to extend it enough for a VM guest to be able to see the Host's USB ports. Next, from a terminal session from the Ubuntu VM

Will display all the usb ports that the VM Guest sees. (and what it thinks it sees connected to those usb ports.)

Is that enough info to start? I'm away from home and will check on this later for your additional info.


5 Cups of Ubuntu

Firstly thank you got getting back to me and apologies for the lack of clarity. To clarify the setup.

Server
As you described ( Ubuntu Server Edition 14.04.0x LTS, that is running Oracle VirtualBox as an Application) . I have installed VirtualBox as a headless install by following these steps

There is no GUI installed on the server.

VM
As you describe ( Ubuntu Desktop Edition 14.04.0x LTS as a VM from within VirtualBox). I have installed the extension pack within the guest OS but I don't believe I have installed it on the host OS (will check when I get home). Will also need to check exact versions of VirtualBox I am running. From memory the specific version mentioned in the guide above was not available to I selected the latest cut of 4.3 (I think this is 4.3-36) together with the corresponding extension pack. Will confirm when I get home.

"Thin client"
Sorry this was my sloppy use of the term. It is actually a 14.04 LTS desktop install on my laptop and I am running a xfreerdp session to connect to the Ubuntu VM. The idea being that anyone can RDP from any device to their VM running on the server.

In terms of the xfreerdp version, the reason I went to the latest nightly is because the stable version I had installed had the old format command line options and all the posts on the various forums about the USB redirection seemed to have the new format so hard for me to test out their suggestions. I couldn't find a newer stable version.

As it happens, I am not really wedded to xfreerdp so if there is something better, very happy to switch. I just need a Ubuntu RDP client that enables me to do the following
- specify the resolution size and open in full screen mode
- USB redirection
- Audio redirection
- Camera/ Microphone redirection

I will check the output of

when I get home. To check if I could see the USB device on the Ubuntu VM guest I was looking in /dev/ttyU* and nothing was mapped.

I also did one further test late last night. I tried connecting the USB device to the server to see if that showed up in the VM (i.e. /dev/ttyU* showed it) and that didn't work either. I assume this means there is an issue with my VM setup? I switched on USB 2 support and EHCI and added a blank rule (which I believe means that all will be passed through to the guest)?

Thanks once again for your help and I will post an update later when I get home


RDP USB redirector [for 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.

Screenshot USB redirect RDP Linux

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.

Step-by-step guide

RDP USB Redirector just needs to be installed on the two machines involved in sharing the device.

  1. 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.
  2. 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.

Related Articles

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:

The 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.

Установка и настройка USB Redirector на сервере с подключенным ключом USB

Скачайте USB Redirector:


Перейдите в папку с ним:


Разрешите запуск инсталлятора:

Добавьте службу проброса в автозагрузку, если ранее этого не произошло:


Подключив USB–ключ к выделенному серверу проверим какие USB–устройства доступны:


Есть 2 варианта расшарить устройство по сети.


В этом случае мы привязываемся к конкретному id устройства и порту, если включить usb-ключ в другой порт сервера — номер usb порта сменится и работать не будет.


В этом случае мы привязываемся только к id устройства. Теперь USB–устройство расшарено по сети.

Конечно делать его доступным для всех пользователей Интернет не правильно, поэтому добавим ограничения в firewall:


Где вместо *.*.*.* нужно написать адрес сервера, с которого разрешено подключение.

Additional Features of USB Redirector
for Linux

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.

Читайте также: