I was required to auto map a USB DoK to a KVM VM (specific VM, mind you!), as a result of connecting this device to the host. I’ve looked it up on the Internet, and the closest I could get there was this link. It was almost a complete solution, but it had a few bugs, so I will re-describe the whole process, with the fixes I’ve added to the process and udev rules file. While this guide is rather old, it did solve my requirement, which was to map a specific set of devices (“known USB devices”) to the VM, and not any and every USB device (or even – USB DoK) connected to the system.
In my example, I’ve used SanDisk Corp. Ultra Fit, which its USB identifier is 0781:5583, as can be seen using ‘lsusb’ command:
[root@localhost ~]# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 020: ID 0781:5583 SanDisk Corp. Ultra Fit
My VM is called “centos7.0” in this example. I am using integrated KVM+QEMU+LIBVIRT on a generic CentOS 7.5 system.
Preparation
You will need to prepare two files:
USB definitions file (for easier config of libvirt)
UDEV rules file (which will be triggered by add/remove operation, and will call the USB definitions file)
USB Definitions file
I’ve placed it in /opt/autousb/hostdev-0781:5583.xml , and it holds the following (mind the USB device identifiers!)
I’ve created a file /etc/udev/rules.d/90-libvirt-usb.rules with the content below. Note that the device identifiers are there, but in the “remove” section they appear differently. Remove leading zero(s) and change the string. This is caused because on removal, the device does not report all its properties to the OS. Also – you cannot connect more than three (3) such devices to a VM, so when you fail to detach three devices (following a consecutive insert/remove operations, for example), you will not be able to attach a fourth time.
This is an interesting bug I have encountered: The output of an sssu command should look like this: EVA> DELETE STORAGE “Virtual DisksLinuxoracleSNAP_ORACLE” EVA> It still leaves the snapshot (SNAP_ORACLE in this case) visible, until the web interface is used to press on “Ok”. This happened to me on HP EVA with HP StorageWorks Command…
When you need to troubleshoot SMTP issues, it is a known fact that a simple telnet to port 25 of the SMTP server in question would get you far. It will get you to see the problems. When connecting to Office365 (outlook.com) to relay mail, and you want to check how things work, you can…
I am using autofs (or automout) to handle shares presented on an NFS server I am using. When I am not home, or when the server is inaccessible, I do not want to be delayed by autofs failure to mount. This failure could take a long while, causing Autofs delay mount. During that time –…
We are about to have a stand in a show in Israel. To pull some attention, I have searched for a method to automate a random rotation of the famous Beryl/Compiz cube. An extension of the method provided in here (using macros) is demonstrated below, using a script. This is a bit more complicated, as…
It means I cannot resize video. Using the x11 generic driver does not allow resize. I’ve searched for a solution just now, and got to this web page. After some tweeks with my own config file (to remind you, it was built using ATI’s tools), I’ve got it to work correctly. Here’s the updated config…
This post will describe the process of placing SSH keys using the internal ‘systemshell’ command of NetApp. As always – when doing something which the vendor did not intend you to do, do it very carefully. This data was obtained from NetApp forums, and while I do not have the original post to link (I…
This is an interesting bug I have encountered: The output of an sssu command should look like this: EVA> DELETE STORAGE “Virtual DisksLinuxoracleSNAP_ORACLE” EVA> It still leaves the snapshot (SNAP_ORACLE in this case) visible, until the web interface is used to press on “Ok”. This happened to me on HP EVA with HP StorageWorks Command…
When you need to troubleshoot SMTP issues, it is a known fact that a simple telnet to port 25 of the SMTP server in question would get you far. It will get you to see the problems. When connecting to Office365 (outlook.com) to relay mail, and you want to check how things work, you can…
I am using autofs (or automout) to handle shares presented on an NFS server I am using. When I am not home, or when the server is inaccessible, I do not want to be delayed by autofs failure to mount. This failure could take a long while, causing Autofs delay mount. During that time –…
We are about to have a stand in a show in Israel. To pull some attention, I have searched for a method to automate a random rotation of the famous Beryl/Compiz cube. An extension of the method provided in here (using macros) is demonstrated below, using a script. This is a bit more complicated, as…
It means I cannot resize video. Using the x11 generic driver does not allow resize. I’ve searched for a solution just now, and got to this web page. After some tweeks with my own config file (to remind you, it was built using ATI’s tools), I’ve got it to work correctly. Here’s the updated config…
This post will describe the process of placing SSH keys using the internal ‘systemshell’ command of NetApp. As always – when doing something which the vendor did not intend you to do, do it very carefully. This data was obtained from NetApp forums, and while I do not have the original post to link (I…
This is an interesting bug I have encountered: The output of an sssu command should look like this: EVA> DELETE STORAGE “Virtual DisksLinuxoracleSNAP_ORACLE” EVA> It still leaves the snapshot (SNAP_ORACLE in this case) visible, until the web interface is used to press on “Ok”. This happened to me on HP EVA with HP StorageWorks Command…
When you need to troubleshoot SMTP issues, it is a known fact that a simple telnet to port 25 of the SMTP server in question would get you far. It will get you to see the problems. When connecting to Office365 (outlook.com) to relay mail, and you want to check how things work, you can…
One Comment