Virtual Box & physical media access

I like VirtualBox more than any other virtualization software out there. In its later versions it provides compatibility with VMware disk images and has many new features.

virtualbox logo Pictures, Images and Photos

And yes… you can access your physical disks and/or other physical media like usb sticks!

a. From Linux:

In a terminal window type the following (as user, you dont need to be root):

VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/Harddisks/myphysicaldisk.vmdk -rawdisk /dev/sdX

where /dev/sdX is the physical disk you like to access. If you dont know what device node your disk has, type the following command:

fdisk -l

Note: To use all the features as user flawlessly, dont forget to add your user to the vboxusers group.

b. From Windows:

Note: Command Line cmd.exe and VirtualBox GUI have to be run as administrator in order to successfully create and use the newly created virtual-to-physical disk!

cd C:\Program Files\Oracle\VirtualBox\

VBoxManage.exe internalcommands createrawvmdk -filename c: \Users\yourusername\.Virtualbox\VDI\mydrive.vmdk -rawdisk \\.\PhysicalDriveX

Where X is a number. 0 (zero) for the first hard disk, 1 is the second one mounted and so on.

Now all that’s left is to add the vmdk virtual image file to your virtual machine via the VirtualBox GUI.

Warning!: Do not attempt to boot your existing OS installed in the physical media through a virtual machine, as it may lead to data corruption and/or file loss! Try it only of you want to experiment, however be prepared for data loss. You have been warned!

Your opinion?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s