How can I mount an external hard drive in a VirtualBox machine

I have installed Virtual Box on Machine and setup a Ubuntu 9.10. And I have an external hard drive formatted for Linux. But when I hook up the external hard drive, my Ubuntu 9.10 can't see the external hard drive.

How can I setup the external hard drive for my Ubuntu 9.10 environment?


Solution 1:

In the settings for your virtual machine, ensure USB is enabled and add a USB device filter so it can only be picked up by the virtual machine when it's running:

alt text

Solution 2:

If USB does not work for you like it doesn't for me, or if your drive is not USB, but eSata... you may need to access the device raw.

it is possible, but not available on the usual interface.

http://www.virtualbox.org/manual/ch09.html#rawdisk

READ THE ABOVE INFO! you may lose data if not!

here is the reference for people who already read the above and just want the reference (i know it will probably be me a few months...)

VBoxManage internalcommands createrawvmdk -filename sdd.vmdk -rawdisk /dev/sdd

then go to the interface, with the machine OFF (not suspended) and add a new disk, chose the vmdk you just created, boot it and done.