Share with:


Dual boot is perfect solution in most cases.

On the other hand, if you need to peep into the other system’s files, you need to re-boot. Or use sometimes not so stable filesystem utilities.
Running fully virtualized OS, using eg Xen as supervisor, creates additional load an hardware, maybe not too big when running multiple OS’es on the pretty new server, but significant, if it is a laptop. And yes, you NEED to keep data in-sync between virtual and real OS.
VMware users, please don’t read any more. Yes, you can do it from pre-historic times.

You’ve been warned!

As for VirtualBox, it is possible to add physical drive or disk partition to your VM setup, although no GUI tools exists to accomplish this.
Every step is documented in VirtualBox User’s Guide, but really, who read these guides?
So , excerpts from The Guide, chapter 9:

Step 1: you need to know the partition layout of the drive.

VBoxManage internalcommands listpartitions -rawdisk [physical_drive]

Substitute [physical_drive] for /dev/sd[a-z] if you live in Linux, \\.\PhysicalDrive[0..n] living in windows or /dev/drive[1..n] living in OS X.
Note the numbers. Linux usually has partition type 0x83, windows – 0x07. Not sure about Mac. You need to remember the physical partition you want to use in guest OS.

Step 2: export it to a file. It’s as easy as 1-2-3. And no, not the whole partition, but only some information about the layout of partitions will be saved:

VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions [partition_number] -register

/path/to/file.vmdk must be absolute path. Substitute [partition_number] with the the partition from step 1. Using “-register” automagically registers the image in list of registered images of the VirtualBox.

 

Step 3: attach the newly created file to a guest and run it.

Some notes: it’s possible to use entire physical disk for VirtualBox:
VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk [physical_drive]
Although it is possible, you should ever never launch the currently running system in VirtualBox. You’ve been warned.