- Установка и настройка 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–ключ в облако (Linux клиент — Linux сервер)
- Установка и настройка USB Redirector на сервере с подключенным ключом USB
- Установка клиента USB Redirector в облаке
- 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-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–ключ в облако (Linux клиент — Linux сервер)
Заказчику потребовалось подключить 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:
Где вместо *.*.*.* нужно написать адрес сервера, с которого разрешено подключение.
Установка клиента USB Redirector в облаке
Скачайте USB Redirector:
Перейдите в папку с ним:
Разрешите запуск инсталлятора:
Если все прошло корректно, вы увидите сообщение об этом.
Добавьте службу проброса в автозагрузку, если ранее этого не произошло:
Теперь добавим наш сервер:
Где вместо **.**.**.** нужно указать ip–адрес сервера.
Теперь можно посмотреть список доступных устройств:
Видим, что на сервере 1 доступно устройство 1.
Включаем автоматическое соединение с устройством:
USB–ключ был успешно проброшен в виртуальную машину в облаке.
Источник
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.
Источник