¿USB stick passthrough? ¿Is it possible?

Hi everyone,

I’m new here, my name’s Marc and I started to work with Open Nebula a few months ago.

Now, I have a problem with a persistent Windows Server machine. I need to attach an USB stick to Open Nebula’s Virtual machine but i can’t do it.

¿Is there any way to do that? ¿Is it possible?

OpenNebula does not directly support attaching USBs. It does, however, support spice protocol if you are using KVM. Check the SPICE documentation and use a compatible client:

http://www.spice-space.org/download.html

We still have this problem. Is it possible right now in 2017?

@jfontan, lo que queremos es dejar un dispositivo USB conectado permanente, no a través de una sesión SPICE. Sabes si esto es posible a día de hoy? Gracias de antemano.

You can use the RAW parameter to add libvirt xml into the deployment file. Here’s the libvirt documentation about that:

https://libvirt.org/formatdomain.html#elementsHostDev

This is the same example as in the documentation as a RAW parameter for the VM template:

RAW=[
  TYPE="KVM",
  DATA="<devices>
  <hostdev mode='subsystem' type='usb'>
    <source startupPolicy='optional'>
      <vendor id='0x1234'/>
      <product id='0xbeef'/>
    </source>
    <boot order='2'/>
  </hostdev>
</devices>"]

Probably you don’t need boot order parameter from the example.