Page 1 of 1

USB device in zone VirtualBox install

PostPosted: 23. Jun 2012, 19:51
by sulphurlad
Host = OI_151a
VB = VirtualBox-4.1.16-SunOS-r78094.pkg

I Have a secure USB key that I want to be attached to a zone VB install.
I configured the zone with

# partial output of zonecfg -z 'zname'

device:
match: /dev/vboxdrv
device:
match: /dev/vboxusbmon
device:
match: /dev/usb/device0

# This is the secure usb key device
match=/dev/usb/device0

On global
# VBoxManage list usbhost
# VBoxManage usbfilter
# VBoxManage usbfilter add 0 --target 'VM' --action hold --vendorid #### --productid ####

The device is there and I can forward it to a VM in global and access it.

But when I do the same for the zone, with the global vm shutdown, and all usbfilters removed
# zlogin zname VBoxManage list usbhost

Nothing shows up.
I can't set a usb filter, because it's not there.

I think that global traps it.

I there a trick to keep global from catching the usb and letting the zone have it.

Re: USB device in zone VirtualBox install

PostPosted: 24. Jun 2012, 09:49
by Ramshankar

Re: USB device in zone VirtualBox install

PostPosted: 24. Jun 2012, 14:10
by sulphurlad
Thanks for the response.
I did see that post.

I tried it, before I posted my question. I was just hoping there was a easy answer that I was missing.

I guess the question is, is there a way to make global VB install forget the usb device, so the zones and access it.
If VB claims the device in user land, then if I prevent access to the device though permissions, then global VB will not pickup the USB, and zone VB could use it.

Playing with the idea.

Will post any info

Thanks

Re: USB device in zone VirtualBox install

PostPosted: 25. Jun 2012, 10:41
by Ramshankar
I'm not entirely sure what you're trying but here are some ground rules that might serve as a reference.

USB devices in VirtualBox on Solaris hosts are captured in kernel space (no concept of "zones" there in this context) and not in userland.

The USB filtering per VM works like this:
Once the VM with filters is started, VirtualBox informs the Solaris kernel, "hey! ask me whenever any USB device is plugged-in before handling it yourself". From that point on, when a USB device is connected to the host, VirtualBox gets asked if it wants the USB device or if VirtualBox has no interest in the device.

So if you have a VM configured with a filter for USB device X, power off the VM. Plug in the USB device now and it will be captured normally by the host. Starting the VM with the filter will _NOT_ force a recapture into the VM, it will still be assigned to the host. You would need to either re-plug the USB device physically or choose the USB device from the VM window Device menu (which tries to disconnect/reconnect the device).

I can't set a usb filter, because it's not there.

You can just set the Vendor ID, Product ID manually for the VM in the zone and re-try it. You need not have a USB device plugged in in order to make a USB filter. It is just convenient way for creating the most specific filter for the device possible.