Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you automount usb drives directly to VirtualBox in ubuntu 12.04

share|improve this question
up vote 0 down vote accepted

I managed to solve this myself. This is only for USB Storage (which I needed)

Remember to create a usb filter on your Vbox machine that takes all USB devices and makes it available.

Create an udev rule file in /etc/udev/rules.d

I called mine 80-automnt.rules


DRIVERS=="usb-storage", RUN+="/etc/udev/ %p"

Create the /etc/udev/ file.


vendorid=`/sbin/udevadm info --query=all --path=$1 | sed 's/E: -*//g' | grep "ID_VENDOR_ID" | awk -F"=" '{print $2}'`
modelid=`/sbin/udevadm info --query=all --path=$1 | sed 's/E: -*//g' | grep "ID_MODEL_ID" | awk -F"=" '{print $2}'`

set `/usr/bin/lsusb -d $vendorid:$modelid | sed 's/:.*//g'`
while [ ! -z "$1" ]; do
  case $1 in
    Bus) shift
    Device) shift
if [ ! -z "$busdevice" ]; then
  address=$(VBoxManage list usbhost | grep "Address:" | grep $busdevice | sed -e 's/Address://' -e 's/^[ \t]*//')
  if [ ! -z "$address" ]; then
    su - YOURVBOXUSER -c "VBoxManage controlvm YOURVBOXNAME usbattach $address"
share|improve this answer

As I understood, there are two versions of Virtualbox. One is open source and doesn't have the possibility to automount USB devices. There is another version with a freeware license (downloadable from the oracle website only), that would give the possibility to do so. I don't know if it really works or if it doesn't, but take a look at this.

Good luck!

share|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Oyibo Jan 15 '13 at 15:01
I am not using VirtualBox OSE. – Alex R Feb 1 '13 at 9:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.