openSuse-13.2 XEN-4.4 USB not visible in guest

Greetings,

using XEN-4.4 on an openSuSE-13.2 I added a USB-device with the graphic
tool virt-manager.
In the info-screen of the guest it shows the correct
Physical USB Device.

In the GUEST.xml the USB device is defined as:

<hostdev mode=‘subsystem’ type=‘usb’ managed=‘yes’>
<source>
<vendor id=‘0x12d1’/>
<product id=‘0x1003’/>
</source>
</hostdev>

However, doing a lsusb in the guest throws the error
‘unable to initialize libusb: -99’

I checked the libraries, libusb is installed and accessable.

Any hints?

Whenever you post an error, unless you’re very certain it’s irrelevant you should always post a few lines preceding as well. Those steps describe what led up to your error and may identify what was tried before resulting in failure.

Also, pls state a description of the USB device saving myself (and others) the work of looking up the vendor and product IDs.

You may also need to describe exactly how you added the USB device because it matters whether the device is virtualized or passed through.

TSU

Whenever you post an error, unless you’re very certain it’s irrelevant you should always post a few lines preceding as well. Those steps describe what led up to your error and may identify what was tried before resulting in failure.

OK; ‘Virtual MachioneManager’ (virt-manager) is a graphic-tool, so all I did was to mark and open the PV-guest in info-mode.

Also, pls state a description of the USB device saving myself (and others) the work of looking up the vendor and product IDs.

lsusb on the host system shows:
Bus 001 Device 002: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem

You may also need to describe exactly how you added the USB device because it matters whether the device is virtualized or passed through.

In the PC-guest info-screen I ckicked ‘Add Hardware’, selected ‘USB Host Device’, marked the approriate line an then clicked ‘Finish’.

After rebooting the PV-guest the USB Device should be available.
I check this with ‘lsusb’ as root in the guest system, but all I get is ‘unable to initialize libusb: -99’

The relevant lines in the xml of the PV-guest (/etc/libvirt/libxl/MAGRO8.xml)


<hostdev mode='subsystem' type='usb' managed='yes'>
 <source>
  <vendor id='0x12d1'/>
  <product id='0x1003'/>
 </source>
</hostdev>

Thanks for your time
Wolf

Passing modems to Guests in almost all virtualization technologies is problematic and often on the bleeding edge (ie experimental, often requiring the latest version of the virt app and sometimes experimental kernels).

There doesn’t seem to be much discussion doing a Google search (usb modem Guest Xen). When there is no discussion, it might mean it’s something that “just works” all the time (unlikely in this case) or is hardly tried. The most important hit is the Xen wiki on passing through devices (current this year)
http://wiki.xenproject.org/wiki/Xen_USB_Passthrough

If your HostOS is openSUSE I’d recommend you read the Huawei sticky in the Networking forum, it isn’t a solution but might be an important prerequisite.
https://forums.opensuse.org/showthread.php/503256-Huawei-UMTS-USB-sticks-on-openSUSE-13-2-update-available

I’d also suggest exploring other ways to implement, for example if your phone supports setting up as a hotspot or if a proxy server app can be run on your phone. Both those solutions are based on the idea of enabling an IP networking connection to your Guest instead of trying set up a serial modem directly. You can then connect to any machine (including Guests) by WiFi, Bluetooth, or serial cable (IP over serial).

This is why I generally do not run my pentesting software in a Guest of any kind, particularly if they need real hardware access.

TSU

Xen USB Passthrough - Xen

I procedded according this and a few similar docs in the net. USB passthru apparently is avail for HVM guests only.
I’m using a PV guest/domU :frowning: .

If your HostOS is openSUSE I’d recommend you read the Huawei sticky in the Networking forum, it isn’t a solution but might be an important prerequisite.
Huawei UMTS USB sticks on openSUSE 13.2: update available - Network/Internet - openSUSE Forums

Thanks for that link, I’ve installed that update on both host/guest (dom0/domU).

I was successful to use PCI passthru, works fine with USB disks, but not with the Huawei USB modem.

Perhaps I’ll check the usbip solution http://usbip.sourceforge.net

Thanks for your time and hints,
Wolf