Accessing raw partitions with VMDK

I’m trying to access my XP partition with VirtualBox 1.4. The XP partition is on /dev/sda2 and I’d like to access /dev/sda6 as well (documents). I’ve looked in the manual and it seems that the command I need to issue to create the appropriate VMDK file is:

If I add “sudo” in front of the command then it works and the VMDK file is created in /home/user/.VirtualBox/ However when I launch VirtualBox I get a message that tells me this virtual disk is not currently accessible. If I look in virtual disk manager I can see WinXP.vmdk but it has a yellow tag on it.

/dev/sda2 is the partition where XP is installed

/dev/sda6 contains /home (it is also where the vmdk file is stored and this is the partition that I’d like to make accessible to both host and guest)

but I still get the same results…
Is this because I created the VMDK as root (sudo)??
Any idea?

solution:

Postby achimha » 7. Jun 2007, 08:40
You have to change the permissions on /dev/sda2 and /dev/sda6 so that the VirtualBox user can read and write to it.

When creating the VMDK as root, make sure to change owner/permissions so that VirtualBox can access it. Note that creating the VMDK also needs read access to /dev/sda (for the boot sector) so doing this as root is the best solution.

Postby achimha » 7. Jun 2007, 13:23
You should not mount those partitions on your host. There must not by any concurrent access.

Use chmod on /dev/sda2 and /dev/sda6 to adjust the permissions.

Postby kilou » 7. Jun 2007, 13:35
chmod seems to be for files and folders only, not for entire partition. And since /dev/sda2 (where windows is installed) is a Ntfs partition, I guess linux can’t change the permission since Ntfs is read-only on linux (except if a specific driver is installed).

All I could find to change the permission is to modify fstab entry for /dev/sda2 and add “uid=1000”……but this means that the xp partition would need to be mounted in linux (this would be required to run chmod as well) :?

I’m a bit confused on how to do that.

Postby moonlight » 7. Jun 2007, 14:44
There is difference between permissions for file system of partition and permissions for partitions itself. Chmod may also work with whole sda

Postby kilou » 7. Jun 2007, 15:14
Can you post an example of the chmod command to issue to set full access permission to /dev/sda2? Does this work also if /dev/sda2 is NTFS?

Links

Hi!

The blog "Alvistec" aims to positioning itself as a recurring site for consultation, in alternative technologies. The Alvistec blog aims so that becomes one most visited sites of tech enthusiasts that contributes to facilitates and to spreads the use of free software, electronics reuse; among other topics.

Caution!: This site is not liable for any damage caused to people or equipment with the information it is exposed. All content is purely informational purposes and is not intended to be a guide. The presented material has been used solely for training purposes and/or entertainment. Viewer discretion is advised.