How can I use Virtualbox to access a raw hard disk?
First, make sure drive is connected and not mounted.
Also, make note of the drive location either by issuing dmesg or using the Ubuntu System > Administration > Disk Utility. In my case, it’s /dev/sde .
Then issue this single command:
sudo VBoxManage internalcommands createrawvmdk -filename ~/rawdisk.vdi -rawdisk /dev/sde -register
^Note: as of Virtualbox 4.x, there is no need to issue -register at the end.
This will output the following in the terminal:
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.
RAW host disk access VMDK file /home/user/rawdisk.vdi created successfully.
Due to the nature of having raw disk access, you must start virtualbox with sudo (Eek!). (Of course you should not normally do this.)
Next, start virtualbox with sudo:
I’m going to scan this drive with spinrite, for an example of what you could do with raw disk access!
spinrite doing its magic