Page 1 of 1

Using encrypted Linux LVM partition fails

Posted: 4. Jun 2012, 22:48
by virtualbrax
I tried to use existing excrypted LVM Linux partitions under a Windows 7 Host with VirtualBox 4.1.16.
The system has just one harddrive.

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x27  0   /32 /33  1023/254/63         13312         2048
2       0x07  1023/254/63  1023/254/63           100     27265024
3       0x07  1023/254/63  1023/254/63         47683     27469824
5       0x83  1023/254/63  1023/254/63           238    125126656
6       0x83  1023/254/63  1023/254/63        415604    125616128
Created VDMK file:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands createrawvmdk -filename C:\ubuntu6.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 5,6
RAW host disk access VMDK file C:\ubuntu6.vmdk created successfully.
But trying to attach the VDMK I get the error:

The medium 'C:\ubuntu6.vmdk' can't be used as the requested device type.

Fehlercode:E_FAIL (0x80004005)
Komponente:Medium
Interface:IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
Callee:IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}


Is it possible to run that configuration?
Maybe I took the wrong partitions when creating the VDMK file (but other partition combinations showed the same error)? Is VirtualBox able to use existing encrypted LVM partitions?

Re: Using encrypted Linux LVM partition fails

Posted: 5. Jun 2012, 10:55
by mpack
You can't mount the current host system drive as a virtual drive in a VM. First, Windows will not allow it because the drive is locked, since it's in use. Even if it was allowed you would severely corrupt the drive. You could check out how to mount partitions: or better yet don't, because anything less than expert use could still mean catastrophic damage.

Re: Using encrypted Linux LVM partition fails

Posted: 6. Jun 2012, 00:07
by virtualbrax
mpack wrote:You can't mount the current host system drive as a virtual drive in a VM.
Maybe I have to make this more clear: I don't tried or don't want to mount the hole current host Windows 7 system drive but the Linux partitions on that drive.

According to http://en.wikipedia.org/wiki/Partition_type and the output of "VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive0" (see my firt post) I have the following partition type on my harddrive:
  • 0x07 Microsoft Windows NT, NTFS
    0x83 GNU/Linux, Any native Linux file system (corresponds with 0x43)
Therefore partition number 5 and 6 should be the ones with Linux file system and I created the VDMK file using the "-partitions 5,6" parameter for "VBoxManage.exe" (see my first post).

I tried to follow these steps:
http://chaits.accosted.net/?p=54
which has this guide as a basis:
http://www.neowin.net/forum/topic/78413 ... e-windows/

There should be another reason why it does not work..

Re: Using encrypted Linux LVM partition fails

Posted: 6. Jun 2012, 10:38
by mpack
Hmm. Ok, I misread your first post.

Perhaps you should read this other thread:

Enabling raw access to Win7 / Win2k8 disks.
viewtopic.php?f=6&t=38914#p175089

Re: Using encrypted Linux LVM partition fails

Posted: 11. Jun 2012, 00:14
by virtualbrax
Thanks for the link.

RAW access seems to work for a whole physical disk using this tool:
http://reboot.pro/15069/

There seems to be a way to use partitions as well, but I did not fully understand how to do that and it seems to be not very save.

Re: Using encrypted Linux LVM partition fails

Posted: 11. Jun 2012, 00:19
by virtualbrax
More details on that topic can also be found in "How To: PhysicalDisks on Vista and Server 2008 (Windows7)":
http://communities.vmware.com/docs/DOC-10455