How to use USB device inside VM under Rosa Virtualisation (oVirt 3.5)

Материал из Rosalab Wiki
Версия от 11:01, 16 ноября 2015; Consta (обсуждение | вклад) (Новая страница: «Категория:ROSA Enterprise Linux Server In our HOWTO we describe a task when you can use some USB device in VM under Rosa Virtualization (oVirt 3.5).…»)

(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Это снимок страницы. Он включает старые, но не удалённые версии шаблонов и изображений.
Перейти к: навигация, поиск


In our HOWTO we describe a task when you can use some USB device in VM under Rosa Virtualization (oVirt 3.5).

  • You may want to use some HASP inside your VM for some reason.
  • You may want to use other USB device, such as USB Flash drive for your VM, or use other USB storage device.
  • You may want to use USB printer or USB cell modem inside your VM.
  • You may need to use some other USB tokens, fingerprints devices, card readers, network cards, USB-to-RS232 devices, etc.

Or some more.... even iPod or iPhone :)

Before we start, I have to say about some important restrictions you need to know:

  • Virtual machine, which use USB device, will be running on the same host, where USB device has been attached.
  • Your USB device must be attached to appropriate host system BEFORE you run VM, when you're plannig to use your USB device.
  • If you use USB flash drive, or other USB storage device, and if storage device has been already mounted to host system in some mountpoint, a file system of the device will be unavailiable for host system, after you mount your device inside your VM.
  • We did not check an ability to use any USB 3.0 devices. We do not have an appropriate hardware on our DCs.

In this example we use simple 8GB FAT32 USB flash drive, which is mounted on host system in /mnt

Our host system is named "hammer2" (см. Picture 2).

Picture 2


VM, which we use USB device for, is named rels67_min (ip — 192.168.231.108, FQDN — "rels76minimal").

At least, our HOWTO (you must be root or use sudo to grant access):

1. Attach your USB device to your host system in DC (in our case we use "hammer2")

2. Install on your host system (in our case on "hammer2"), and install on your host running oVirt-engine (in our case we use host "head") vdsm-hook-hostusb package:

yum install vdsm-hook-hostusb

3. On your oVirt-engine host run:

engine-config -s UserDefinedVMProperties='hostusb=[\w:&]+'

After your oVirt-engine will ask you to point appropriate oVirt version.

In our case we choose 3.5 (press 6 on keyboard).

4. Run on oVirt-engine host (on host "head"):

/etc/init.d/ovirt-engine restart


5. Run on host system (run on host "hammer2", where USB device has been attached):

/etc/init.d/vdsmd restart


6. Check USB device on host system:

lsusb

(if you can not run lsusb install usbutils package: yum install usbutils)

In our example we see our USB device as:

Bus 001 Device 004: ID 8564:1000 Transcend Information, Inc. JetFlash

Look Picture 1.


7. Open VM properties (right mouse click and choose Edit in menu). Virtual machine must be powered off, when you edit its properties.

Attach your VM to specific host (see Picture 3, we choose host "hammer2"), where your USB device is.

Picture 3


8. In Custom Properties menu a new option Please select a key appears. Choose hostusb and write USB device ID, but do not forget to write prefix 0x. So in our case we write 0x8564:0x1000

См. Picture 4

Picture 4


9. Run your VM as usual, use SSH, VNC, SPICE, etc, to check USB device status:


lsusb

Look at Picture 1.

Снимок-1


Now you can mount your USB device inside your VM.