How to use a physical drive with VirtualBox

In the example below, I have two physical NTFS partition on a harddrives, which I was mounting upon Ubuntu boots. The host OS is Ubuntu Intrepid 8.10

**1. Edit fstab to not automatically mount them **

sudo gedit /etc/fstab

** 2. Dismount the partitions which you will be using with the VIrtualBox **
This step is crucial as you won't want both the VirtualBox OS and the host OS to try to manage the partitions at the same time.

sudo umount /media/ntfs5
sudo umount /media/ntfs1

** 3. Create teh VMDK image which points to the actual drive **

sudo VBoxManage internalcommands createrawvmdk \
    -filename /home/seeminglee/.VirtualBox/WinXP.vmdk \
    -rawdisk /dev/sdb \
    -relative \

** 4. Change ownership of the vmdk file created from root to the user **

sudo chown seeminglee:seeminglee /home/seeminglee/.VirtualBox/WinXP.vmdk

** 5. Change access permission to the vmdk file **

chmod a+rw /home/seeminglee/.VirtualBox/WinXP.vmdk

** 6. Change access permission to the physical drives **

sudo chmod a+rw /dev/sdb
sudo chmod a+rw /dev/sdb1
sudo chmod a+rw /dev/sdb5
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License