- Как прокинуть USB на сервере без IOMMU
- USB Redirector
- Установка и настройка usb-redirector-linux в CentOS
- Подготовка сервера
- Настройка сервера
- Проброс USB устройства
- Настройка клиента
- Installing USB Redirector for Linux
- Installing
- Uninstalling
- Installation Troubleshooting
- Ubuntu, Debian
- Raspbian (Raspberry Pi)
- RedHat, Fedora, CentOS, Scientific
- Arch Linux, Manjaro Linux
- Proxmox VE
- Other systems
- Note for Linux Kernel Versions From 2.6.25 to 2.6.28.8
- Automatic Startup of USB Redirector at Boot
- USB Redirector for Linux — Share USB over Network in Linux
- USB Redirector for Linux helps to:
- How to Start
- Redirect a USB Device in 5 Steps
- Cross-platform Features and Remote Desktop Support
- More Information on How to Use USB Redirector for Linux
- System Requirements
- How to Use USB Redirector for Linux in USB Client Mode
- Installing USB Redirector for Linux in USB client mode
- Command-line Syntax
- Connecting to a USB Server
- Getting a List of USB Servers and USB Devices
- Connecting a USB Device by ID
- Connecting a USB Device by VID and PID
- Disconnecting a USB Device
Как прокинуть USB на сервере без IOMMU
Published: September 17, 2017 by Nesterov Alexey
Если сервер не поддерживает IOMMU, то многочисленые иструкции по прокидыванию usb-портов (или pci-устройств) в Xen работать не будут. Тут обсуждение, а это пример мануала.
Конечно есть ебаное решение — USB over IP. Клиент-серверное приложение которое позволяет прокидывать USB на гостевые машины, установив серверную часть непосредственно на Xen или сторонний (например виндовозный) сервер. Все решения платные, а бесплатные со значительными ограничениями.
Первое рассмотренное решение USB Redirector — существует только платная версия. Второе VirtualHere — триальная версия позволяет прокидывать один USB-порт (но без ограничения по времени). Обсуждение на эту тему здесь.
Бесплатный проект The USB/IP Project не рассматривается так как последний релиз под Linux датирован 13.01.2009.
USB Redirector
Сделано по этой инструкции с поправкой на 64-х битную архитектуру xen сервера.
Распаковываем на той машине где установлен Xen Center (или монтируем образ на виртуальный дисковод)
Импортируем виртуальную машину с помощью Xen Center (XenServer -> Import…). В locate указать ova.xml (например J:\ddk\ova.xml). После импорта машина инсталируется (в процессе инсталяции будет запрос пароля для пользователя root)
После логина в консоли DDK делаем следующее:
после этого виртуальную машину DDK можно выключить
- В консоли Xen делаем следующее:
редактируем файл installer.sh
В функции usbsrv_install() (поиск в joe CTRL+KF) закоментируем:
В функции usbsrv_make_kernel_module() закоментируем:
Источник
Установка и настройка usb-redirector-linux в CentOS
В статье пойдет речь о настройке сервера для сетевой передачи устройства USB на другой компьютер. Подобная конструкция, как правило, необходима для проброса различных USB-ключей на виртуальные машины. Серверная часть будет настраиваться на базе Linux CentOS 7, клиентская — Windows. В качестве серверного ПО будем использовать usb-redirector-linux. Внимание — данный продукт нельзя использовать бесплатно, если раздача USB устройства идет с сервера Linux. В большей степени, инструкция предназначена для тех, кто планирует купить данных продукт.
Подготовка сервера
Для корректной установки программы, необходимо обновить систему:
После сервер необходимо перезагрузить:
Настройка сервера
usb-redirector-linux собирается из исходников. Для начала ставим пакеты, необходимые для сборки:
yum install wget gcc kernel-devel
Переходим на страницу загрузки программы и копируем ссылку на ее скачивание:
Используя ссылку, скачиваем исходник на сервер:
Распаковываем скачанный архив и переходим в каталог исходников модулей:
tar -zxvf usb-redirector-linux-x86_64.tar.gz
Собираем исходник с указанием исходника ядра:
* каталог 3.10.0-862.3.3.el7.x86_64, скорее всего, будет другим — это зависит от версии ядра.
Возвращаемся в корень каталога, который появился после распаковывания архива:
Устанавливаем usb-redirector следующей командой:
Проброс USB устройства
Переходим в каталог, куда была установлена программа:
Отображаем список подключенных USB устройств:
Получим что-то на подобие:
================= USB SERVER OPERATION SUCCESSFUL ===============
List of local USB devices:
1: USB Keyboard SIGMACHIP Composite USB Device
Vid: 1c4f Pid: 0026 Port: 2-1.4
Status: plugged
2: ET99 Token OEM USB Human Interface Device
Vid: 096e Pid: 0303 Port: 2-1.3
Status: plugged
Чтобы расшарить токен ET99, вводим:
Настройка клиента
Заходим на страницу загрузки USB Redirector и скачиваем клиентскую часть — в нашем случае для Windows:
Скачанный архив распаковываем и запускаем установщик. Отвечаем на все вопросы мастера нажатием Далее.
После окончания установки запускаем программу — нажимаем Add USB Server и прописываем IP-адрес нашего сервера:
Появится список расшаренных устройств — просто нажимаем правой кнопкой мыши на необходимый и кликаем Connect USB Device.
Источник
Installing USB Redirector for Linux
USB Redirector for Linux works on the following Linux distributions:
- Debian 5 and newer
- Fedora 5 and newer
- Gentoo 10.1 and newer
- openSUSE 10.3 and newer
- Mandriva 2007 and newer
- RedHat 5 and newer
- Ubuntu 6.06 and newer
- others, which meet the following requirements:
- kernel version from 2.6.27 to 5.5
- udev subsystem
- read-write file system (not read only)
- kernel source code or kernel headers are required for installation
Installing
Before installing USB Redirector for Linux, you need to download and extract the installation package which corresponds to your system and CPU. Download links for all supported systems are available in the Downloads section.
wget https://www.incentivespro.com/usb-redirector-linux- x86_64 .tar.gz
tar -zxf ./usb-redirector-linux- x86_64 .tar.gz
cd ./usb-redirector-linux- x86_64
To install USB Redirector for Linux in USB server mode, use the following command:
sudo ./installer.sh install-server
To install USB Redirector for Linux in USB client mode, use the following command:
sudo ./installer.sh install-client
To install USB Redirector for Linux in combined USB server and USB client mode, use the following command:
sudo ./installer.sh install
Uninstalling
To uninstall USB Redirector for Linux, please run uninstall.sh script. It is located in the directory where USB Redirector was installed. By default, it is located in /usr/local/usb-redirector directory.
sudo /usr/local/usb-redirector/uninstall.sh uninstall
Uninstaller script will remove all installed components of USB Redirector from your computer.
Installation Troubleshooting
If you’ve got an error saying Kernel sources or kernel headers directory not found during installation of USB Redirector for Linux, you may need to install kernel headers or kernel source code. It is a package that contains files required to compile USB Redirector kernel module.
The command to install this package will differ, depending on your Linux distro:
Ubuntu, Debian
sudo apt-get install make gcc linux-headers-`uname -r`
Raspbian (Raspberry Pi)
sudo apt-get install make gcc raspberrypi-kernel-headers-`dpkg-query -f=’$
Note that kernel-headers package is relased with delay, so it may not be available for the newest Raspbian kernels. In this case you have to roll-back to previous kernel to install USB Redirector. See Installing USB Redirector on Raspberry Pi topic on our Forum for more details.
RedHat, Fedora, CentOS, Scientific
yum install make gcc chkconfig kernel-devel-`uname -r`
sudo zypper in make gcc kernel-devel
Arch Linux, Manjaro Linux
sudo pacman -Syu make gcc linux-headers
Proxmox VE
apt-get install build-essential pve-headers-`uname -r`
Other systems
Please install kernel headers (the package may be named as «kernel-headers», «kernel-devel», «linux-headers», etc.) or kernel source code package for your system. You need to install the version that exactly corresponds to your kernel version. In addition, you will need to install make and gcc, required to build USB Redirector kernel module.
If your kernel is updated after USB Redirector installtaion, you may need to re-install the program to re-compile its kernel module!
This is because kernel modules in Linux are tied to a particular kernel version, thus they need to be re-compiled for each new kernel to work correctly.
Note for Linux Kernel Versions From 2.6.25 to 2.6.28.8
Kernels versions 2.6.25 through 2.6.28.8 have a bug in USB EHCI controller driver that leads to large memory leaks with isochronous devices like webcams or audio devices.
If you have patched your kernel against this bug — please manually recompile the driver executing ‘make USE_EHCI_FIX=n’ command. Otherwise USB Redirector will try to automatically workaround this bug (without guaranties).
Please do not worry about this warning if you are not going to use USB 2.0 isochronous devices on your system.
Automatic Startup of USB Redirector at Boot
The installer will normally set USB Redirector daemon for auto-start. If it was not able to do this, please use rc.usbsrvd script that is installed in /etc/rc.d (or /etc/init.d) directory to start USB Redirector automatically.
IncentivesPro is a division of SimplyCore LLC.
Copyright © 2007-2021 SimplyCore LLC. All rights reserved.
Источник
USB Redirector for Linux — Share USB over Network in Linux
This Free product allows to share and access USB devices remotely on Linux platform. This solution is compatible with all of our other USB redirection products. It allows redirecting USB devices between Linux based computers or between Linux and Windows. And with help of the special patch, it is possible to add USB redirection support to the well-known open source remote desktop clients, rdesktop and FreeRDP, so that you can redirect USB devices into remote session on Windows computer where USB Redirector RDP Edition or USB Redirector TS Edition are installed.
USB Redirector for Linux helps to:
- Redirect USB devices to virtual machine.
- Organize USB server for users in your local or corporate network.
- Use USB devices plugged into your Linux thin-client in a Windows Remote Desktop session.
- Use USB devices plugged into remote Windows-based computer.
- Limit physical access to USB devices, but make them available for users in your network.
Not sure if this version suits your needs?
Compare USB Redirector editions
How to Start
USB Redirector for Linux can be installed in three modes:
- USB server mode. When installed in this mode, USB Redirector allows to share your USB devices for access on remote computers with Linux or Windows operating systems.
- USB client mode. When installed in this mode, USB Redirecror allows you to connect remote USB devices that were shared on remote computers with Linux or Windows operating systems.
- Combined USB server and USB client mode. You can either share your USB devices for remote access or connect USB devices from remote computers with Linux or Windows operating systems.
USB Redirector installation instructions can be found here.
Redirect a USB Device in 5 Steps
- Step 1. Download and install USB Redirector for Linux in USB server mode on a computer where USB device is physically attached, this computer will be the USB server:
$ usbsrv -list-devices =================== LIST OF LOCAL USB DEVICES =================== 8: Portable Super Multi Drive HLDS Inc — USB Mass Storage Device Vid: 152e Pid: 2571 Port: 1-4 Status: plugged ===================== ======================= =================== user@cyber:
usbclnt -add-server 192.168.1.105:32032
$ usbclnt -list-devices ================== LIST OF REMOTE USB DEVICES =================== 1: USB server at 192.168.1.105:32032 Mode: manual-connect Status: connected | `- 8: Portable Super Multi Drive HLDS Inc Vid: 152e Pid: 2571 Port: 1-4 Mode: manual-connect Status: available for connection ===================== ======================= =================== root@localhost:
usbclnt -connect 1-8
Result. Now you can use the USB device on USB client computer just like it was plugged there directly:
Cross-platform Features and Remote Desktop Support
USB Redirector for Linux is compatible with USB Redirector, USB Redirector RDP Edition and USB Redirector TS Edition. It means you can freely share USB devices between Linux and Windows systems without any limitations.
It is possible to redirect USB devices over RDP connection from Linux thin-client to Windows Terminal Server (RD Sesssion Host). For this, you need to use one of the compatible RDP clients. We support the most popular open source Linux Remote Desktop clients, rdesktop and FreeRDP. We provide patches for these RDP clients which add USB over RDP redirection support.
After installing USB Redirector for Linux, you need to apply the special patch, that is shipped inside USB Redirector installation package in the rdp/rdesktop directory:
- Copy usbrdr.c and usbrdr.patch into rdesktop source code directory
- Run patch -p3 -i usbrdr.patch
- Re-compile and re-install patched rdesktop
- Start rdesktop with ‘-r usbrdr’ option:
./rdesktop -r usbrdr terminal.server.hostname
More Information on How to Use USB Redirector for Linux
System Requirements
USB Redirector for Linux works on the following Linux distributions:
- Debian 6 and newer
- Fedora 10 and newer
- Gentoo 10.1 and newer
- openSUSE 11.1 and newer
- RedHat 6 and newer
- Ubuntu 8.10 and newer
- Other systems, which meet the following requirements:
- kernel version 2.6.27 to 5.5
- glibc 2.9 or newer, uclibc or musl libs
- udev subsystem
- r/w file system (not read-only)
- kernel source code or kernel headers are required for installation
IncentivesPro is a division of SimplyCore LLC.
Copyright © 2007-2020 SimplyCore LLC. All rights reserved.
Источник
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:
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:
where is one of the following:
Remove remote usb server from configuration and disconnect all USB devices from that server.
Connect a specified device from a specified server. Server should be added to your configuration first.
Add specified device to exclusion list.
Remove specified device from exclusion list.
Enable or disable automatic connection of a single device.
Enable or disable automatic connection of all devices on the specified server.
Show information about this USB client.
Show program version.
Parameters used in the commands are as follows:
is a device ID number as displayed by -list-devices command.
is a server ID as displayed by -list-devices command.
is a combination of one or more of the following parameters that identify a USB device:
Specific device ID number as displayed by -list-devices command.
USB device vendor ID.
USB device product ID.
USB device serial number.
USB port number as displayed by -list-devices command.
USB device name as displayed by -list-devices command. The name must be enclosed in double quotes.
is one of the following parameters that identify a remote USB server:
Specific server ID number as displayed by -list-devices command.
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:
Getting a List of USB Servers and USB Devices
To get the list of USB servers and their USB devices you need to execute:
You will see the following output:
$ 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:
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:
$ 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:
IncentivesPro is a division of SimplyCore LLC.
Copyright © 2007-2020 SimplyCore LLC. All rights reserved.
Источник