воскресенье, 25 июня 2017 г.

Пробрасываем USB–ключ в контейнер lxc

Installing USB Redirector for Linux
How to Use USB Redirector for Linux in USB Server Mode

Пробрасываем USB–ключ в облако (Linux клиент — Linux сервер)
Давно хотел пробросить hasp  в контейнер lxc, это будет 64 битный серверный зеленый ключ,
установленный на ubuntu 17.04 unity под virtualbox  на win 10. Пробрасывать будем на физический сервер
 на ubuntu 17.04 unity под virtualbox пробрасываем hasp
# lsusb
Bus 001 Device 003: ID 0529:0001 Aladdin Knowledge Systems HASP copy protection dongle
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

# apt update
# apt upgrade
# cd /root/
# wget http://www.incentivespro.com/usb-redirector-linux-x86_64.tar.gz
# tar -xvzf usb-redirector-linux-x86_64.tar.gz
# cd /root/usb-redirector-linux-x86_64
# chmod +x installer.sh
# ./installer.sh install-server
*** Installing USB Redirector for Linux v3.6
***  Destination dir: /usr/local/usb-redirector
***  Checking installation...
***  Detecting system...
***     distribution: ubuntu
***     kernel: 4.10.0-22-generic
Your kernel version is not officially suppported! Would like to try installing anyway [y/n] ? y
You're doing it at your own risk! %)
***  Compiling kernel module...
***  Kernel module successfully compiled
***  Creating directories...
***  Preparing scripts...
***  Copying files...
***  Setting up init script...
***  Starting daemon...
***  Please allow incoming connections on 32032 port for USB Sever to be able to accept connections from remote clients.
***  INSTALLATION SUCCESSFUL! To uninstall, run /usr/local/usb-redirector/uninstall.sh
# systemctl status rc.usbsrvd
# systemctl enable rc.usbsrvd
# systemctl status rc.usbsrvd
# usbsrv -list

================= USB SERVER OPERATION SUCCESSFUL ===============
List of local USB devices:

   1: USB Tablet VirtualBox USB Human Interface Device
      Vid: 80ee   Pid: 0021   Port: 1-1
      Status: plugged

   2: HASP 2.17 AKS
      Vid: 0529   Pid: 0001   Port: 1-2
      Status: plugged

===================== ======================= ===================
# usbsrv -share 2

====================== OPERATION SUCCESSFUL =====================
USB device has been shared
===================== ======================= ===================
# usbsrv -list

================= USB SERVER OPERATION SUCCESSFUL ===============
List of local USB devices:

   1: USB Tablet VirtualBox USB Human Interface Device
      Vid: 80ee   Pid: 0021   Port: 1-1
      Status: plugged

   2: HASP 2.17 AKS
      Vid: 0529   Pid: 0001   Port: 1-2
      Status: plugged, shared
===================== ======================= ===================

!!!# ufw allow from *.*.*.* to any port 32032
!!!# ufw enable

Установка клиента в контейнер ubuntu 16.04.2 в контейнер lxc xp962_1 с установленным 1с и postgres.
# lxc-start -n xp962_1 -d
Зайдем на сервер:
$ sudo -i
# apt update -y
# apt upgrade -y
# cd /root/
# wget http://www.incentivespro.com/usb-redirector-linux-x86_64.tar.gz
# tar -xvzf usb-redirector-linux-x86_64.tar.gz
# cd /root/usb-redirector-linux-x86_64
# chmod +x installer.sh
# ./installer.sh install-client
*** Installing USB Redirector for Linux v3.6
***  Destination dir: /usr/local/usb-redirector
***  Checking installation...
***  Detecting system...
***     distribution: ubuntu
***     kernel: 4.4.0-79-generic
***  Cleaning up installation...
***
***  INSTALLATION FAILED!
??? Kernel sources or kernel headers directory not found. Please install the corresponding package first.

Установим поддерживающие пакеты:
Исходные тексты ядра
# apt install linux-source
Отключим обновления ядра:
# apt-mark hold linux-image-generic linux-headers-generic
linux-image-generic помечен как зафиксированный.
linux-headers-generic помечен как зафиксированный.
# ./installer.sh install-client

*** Installing USB Redirector for Linux v3.6
***  Destination dir: /usr/local/usb-redirector
***  Checking installation...
***  Detecting system...
***     distribution: ubuntu
***     kernel: 4.4.0-79-generic
***  Cleaning up installation...
***
***  INSTALLATION FAILED!
??? Kernel sources or kernel headers directory not found. Please install the corresponding package first.
Резюме: в контейнер lxc hasp таким образом не пробрасывается?










Комментариев нет:

Отправить комментарий