I created the vmdk-file as describe in Chapter 9. Advanced topics and added it to my guest vm. After it, I could mount the entire raw disk up in my linux guest vm. Now I can read the ext4 file system, but I can't write to it. How can I get write access without changing the file system to NTFS? In Win7, I cannot set permissions to that hard disk because it's a raw hard disk with an unknown file system.
The disk will appear in your guest as /dev/sda1 (consult virtual box' docs). You need to mount that drive read-write. The easiest way to configure this permanently is by adding a line to /etc/fstab such as this:
If you wish to remount the drive read-write on the fly, you may issue the comamnd:
Again, this is assuming that the device for the drive is sda1. If you have nothing like that, then I would look trough the output of dmesg scanning for lines with "ATA" or "SCSI" as that will lead you to the device node of the drive. Usually It's really easy to spot in the /dev/ folder. Just look for hd[abcd..] or sd[abcd..][1234...].
Okay, I found a solution by myself. Now, I want to give you detailed instructions about the steps I did to get it working.
VirtualBox 4.2.0 r80737
Disk configuration in Win7 (host)
VMDK file creation in Win7 (host)
Add VMDK file to your Linux VM (guest)
Set permissions and mount raw disk
If you use Ubuntu then you should already see the drive in the navigation pane of the file explorer. If you would click on it now, you would just mount the drive read-only to
(replace DRIVENAME and USERNAME with proper values)
Reopen the file explorer and mount the drive by clicking on its name in the navigation pane. Now you should be able to create files and folders on your raw hard disk.
Of course it is possible to permanently mount the disk via
After the VMDK file creation I noticed the following line in there:
This option is set by default. If you still run into issues and your raw disk is not an IDE disk but SATA, just change this line to:
Of course then you have to add the VMDK file as SATA Controller to your VM instead of IDE Controller.