Access Entire Physical Disk
This step by steps method explains how you can access physical disk in desktop virtualization software Sun VirtualBox. Unfortunately this cannot be done easily as how to access physical disk in VMware workstation.
Some commands and hard drive mapping are included in this access physical in Sun VirtualBox process.
You can access host computer’s physical hard disk partition also in this method. This access method is called ‘Raw Disk’ access. Read more about what is Raw Disk

Before start the procedure, let me explain how it’s going to work.
As I said earlier, it’s not easy as giving access to physical disk in VMware workstation. Sun VirtualBox desktop virtualization software can access on storages added in ‘Virtual Media Manager’. To know more about Virtual Media Manager in Sun VirtualBox, click here how you can access VMDK file in VirtualBox.
You can’t add host local physical entire disk or any partitions easily like VMware workstation. We have to create a configuration VMDK file for the host entire physical disk or partition. Then add this VMDK in Virtual Media Manager. Then allocate the disk to any Virtual Machine in VirtualBox.
Ok, now let’s start the steps,
How to Access Entire Physical Disk from VirtualBox
1) Open Command prompt in Host computer then go to the Sun VirtualBox installation folder, in this case example is, ( This is on your Host computer where you installed Sun Virtualization software, NOT in the Virtual Machine)
G: \Program Files \Sun \VirtualBox
2) Type: ( This command for access entire physical disk as Raw Disk)
VBoxManage internalcommands createrawvmdk -filename c: \Users \sunuser \.Virtualbox \VDI \mydrive.vmdk -rawdisk \ \ . \PhysicalDrive0
c: \Users \sunuser \.Virtualbox \VDI \mydrive.vmdk : Location and ‘ mydrive.vmdk’ is the configuration VMDK file of your entire physical drive.
Do not think that new VMDK file will take huge size as your physical disk size. It’s just a 1KB size file. After you added this file to Virtual Media Manager, then you will get the full size of physical disk.
\ \. \PhysicalDrive0 : is the physical drive of host computer. 0,1, 2 numbers can be seen from Disk management in Windows OS under Computer Management. You insert the number as required physical disk number, normally starts with 0.
3) Command will a successful message if all OK, as shown above.
4) You can confirm that command worked correctly by visiting the location of VMDK file created.
5) Now, Open Sun VirtualBox, and go to Virtual Media Manager.
6) Add the newly created ‘mydrive.vmdk’ under hard disk. Click here to read more about how to add VMDK file in Sun VirtualBox
7) Add the newly added hard disk to your virtual machines in Sun VirtualBox and start accessing them from Virtual Machine Guest Operating system.
How to Access Partitions of Physical Disk from VirtualBox
To access specific partitions of host physical disk from VirtualBox, run the same command with additional switches,
VBoxManage internalcommands createrawvmdk -filename c: \Users \sunuser \.Virtualbox \VDI \ mydrive.vmdk -rawdisk \ \. \ PhysicalDrive0 -partitions 1,3
1,3 : are the partitions numbers of PhysicalDrive 0. It will allow you to access the first and third partitions of the physical drive.
This command also will create a VMDK file and you can access the drives as explained in first method.
Important Note about Raw Disk Access in VirtualBox
VirtualBox can also present either entire physical hard disks or selected partitions thereof as virtual disks to virtual machines.
With VirtualBox, this type of access is called “raw hard disk access”; it allows a guest operating system to access its virtual hard disk without going through the host OS file system. The actual performance difference for image files vs. raw disk varies greatly depending on the overhead of the host file system, whether dynamically growing images are used and on host OS caching strategies. The caching indirectly also affects other aspects such as failure behavior, i.e. whether the virtual disk contains all data written before a host OS crash. Consult your host OS documentation for details on this.
Warning
Raw hard disk access is for expert users only. Incorrect use or use of an outdated configuration can lead to total loss of data on the physical disk. Most importantly, do not attempt to boot the partition with the currently running host operating system in a guest. This will lead to severe data corruption.
Raw hard disk access — both for entire disks and individual partitions — is implemented as part of the VMDK image format support. As a result, you will need to create a special VMDK image file which defines where the data will be stored. After creating such a special VMDK image, you can use it like a regular virtual disk image
Access to entire physical hard disk
While this variant is the simplest to set up, you must be aware that this will give a guest operating system direct and full access to an entire physical disk. If your host operating system is also booted from this disk, please take special care to not access the partition from the guest at all. On the positive side, the physical disk can be repartitioned in arbitrary ways without having to recreate the image file that gives access to the raw disk.









help with this one. im using windows 7, running Ubuntu 9.10 inside virtualbox 3.1. when i type the command it shows invalid parameter -users.
please help. desperately want to use my Ubuntu OS and access all my files from the host.
Hi, it’s not – users (parameter). It’s the location of vmdk configuration file. I used Vista as my host, so I created in that location. Windows 7 also must be the same. Try and let me know.
[...] my earlier post, I explained about accessing physical disk and partition as raw disk in virtual machine. Its a raw disk access and not having real time read or write access on disk. [...]
This works great, but the only problem is Windows 7 rearranges the order of the physical disks in disk manager every time I reboot. Annoying.
Hi – Are you positive that you use Vista (or 7) as a host and XP as a guest, XP being on a physical partition ?
I can’t have this to run with my Win7 and XP (BSOD with UNMOUNTABLE_BOOT_VOLUME). The VB logs says that the physical XP partition cannot be written
The vdmk was created w/o problem, my VB runs “elevated”, the XP partition is not “mounted” etc … I’ve even tried installing a Kubuntu host instead of the Win7, and using the _exact_ same XP partition in the Kubuntu host, and this run fine. I’m used to use XP and Kubuntu on physical partition w/o problems for years …
Hi Philippe,
I have Windows 7 and XP as Host and having same Operating systems as guest too. The above steps I tested on Windows vista host but not Windows XP physical partition. To be honest, I’m scared to mount system physical partition inside VirtualBox. But I did later. I mounted Windows XP physical partition in Sun VirtualBox and started same physical computer in VirtualBox. Guess what? Once I restart Host Windows XP later, it says some boot sector or loader corrupted. I struggled to get my host OS back.
So from that point, I don’t boot or mount physical Host OS in VB. It’s little risky. (I’m not sure; I understand your point correctly).
Anyway, Thanks for your comment.
philippe,
This is a new “feature” of Windows, see:
http://www.osnews.com/comments/16243
One should install some kernel-mode hack to workaround this.
Hi
By using this method I have managed to mount my drive under Debian. I have a question though. Is it ok to modify this physical mounted drive under Linux say with Gparted? I mean this way of accessing of a drive is same as accessing it physically. For example can I resize one of the partitions of this drive inside Debian running on Vbox using Gparted?
thanks
@chromn,
I would suggest to NOT doing anything on physical disk ( if its bootable disk for host computer). I have bad experience about this and even VirtualBox says ‘ any changes may case issues on physical host’.
You can transfer data ( copy, cut and paste), but don’t try any partitioning except you leased worry about host OS.