Virtualization: VirtualBox

Headless setup: USB devices

by ross at 10:31:22 on June 3, 2012

Prepare the system

USB 2.0 support is provided by closed-source Extension Pack which does not exist for FreeBSD.

OSE version of VirtualBox supports USB 1.1. In order to connect a USB device you must force USB 1.1 protocol.

Add to /boot/loader.conf:

# For VirtualBox: disable USB 2.0 (all the usb devices will appear as USB 1.1)
hw.usb.ehci.no_hs=1

Reboot.

Edit /etc/devfs.rules

[system=10]
add path 'usb/*' mode 0660

Add to /etc/rc.conf

devfs_system_ruleset="system"

Restart devfs:

# service devfs restart

Configure VirtualBox

# pw groupmod operator -m vbox
# su -l vbox
> VBoxManage list usbhost
Host USB Devices:

UUID:               f6a81448-7790-443c-b230-8c2b4cc7c4b2
VendorId:           0x046d (046D)
ProductId:          0xc317 (C317)
Revision:           0.0 (0000)
Manufacturer:       Logitech
Product:            USB Multimedia Keyboard
Address:            /dev/ugen4.3
Current State:      Busy

UUID:               acafa07e-4416-47bf-a88e-9abbb7b00c0a
VendorId:           0x046d (046D)
ProductId:          0xc521 (C521)
Revision:           0.0 (0000)
Manufacturer:       Logitech
Product:            USB Receiver
Address:            /dev/ugen4.2
Current State:      Busy

UUID:               3c68cbcd-9c90-4bf3-b687-a107dd34dbbb
VendorId:           0x0781 (0781)
ProductId:          0x5406 (5406)
Revision:           0.0 (0000)
Manufacturer:       SanDisk
Product:            U3 Cruzer Micro
SerialNumber:       1101401124031535
Address:            /dev/ugen0.2
Current State:      Captured

I want SanDisk Cruzer in "win7" virtual machine:

> VBoxManage usbfilter add 0 --target win7 \
             --vendorid 0781 --productid 5406 \
             --name "sandisk" --active yes
> VBoxManage modifyvm win7 --usb on

Now you can start the machine and use the device.

 

Comments