Page 1 of 1

Windows Host, Linux Client on physical disk

Posted: 8. Aug 2009, 21:11
by schattenkrieger
Hi,
My machine has a dualboot setup with 1. Windows XP, 2. Xubuntu.
Now i'd like to use my raw Linux partition in virtualbox under Windows.
How do i manage this?

Code: Select all

vboxmanage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
has following output:
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x12 0 /1 /1 783 /254/63 6149 63
2 0x07 784 /0 /1 1023/254/63 109615 12594960
3 0x83 1023/254/63 1023/254/63 34812 237087270
5 0x82 1023/254/63 1023/254/63 2047 308383803
where 1 is SystemBackup(hidden), 2 Windows HD, 3 LInux root, 5 Linux Swap.

Under Windows i can use the following command to create a raw harddisk vmdk:

Code: Select all

VBoxManage.exe internalcommands createrawvmdk -filename linuxraw.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 3,5
But if i register the newly created vmdk in virtualbox, it tells me the size of the vmdk would be 149.05GB, which is exactly the size of my entire harddisk!
In Linux vboxmanage you can use the "-relative" flag to exclusively use the linux partitions. What else does the -partitions flag do if not limit the partitions for the vm?

My question: is it safe to run the virtualmachine anyway or does this lead to harddisk raw writes over my other partitions?
Does anyone have a spare machine to try this out? :wink:

Thanks in advance for any help on this.
tim

Re: Windows Host, Linux Client on physical disk

Posted: 8. Aug 2009, 22:26
by baf
Open the vmdk file with notepad and look in it. It is a textfile.
You will see that it just uses the partition(s) you have directed it to and for the rest of the disk it will just return zeroes and won't be able to write anything.

Re: Windows Host, Linux Client on physical disk

Posted: 9. Aug 2009, 12:58
by schattenkrieger
thanks :)