Page 1 of 1

Create a VM on a virtualized OSFMount HDD

Posted: 31. May 2013, 14:52
by vladtsepesh
Hi all,
I have a bit-bit copy of a windows installation, i.e. the result of a dd command, splitted on a number of 00n files.
With OSFMount I create a virtual drive, mounted on a drive letter.

What I want is to create a virtual machine with the installation on the virtualized drive.

Googling around I didn't find a reply so the real question is:

is it possible? And how?

TIA,

Vlad.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 31. May 2013, 15:59
by mpack
Try Disk2VHD to clone the OSFMount drive. Build a VM around the clone VHD, or better yet convert the VHD to VDI format first.

You can also forget the OSFMount stuff: merge the split dd image to a single raw image, then convert raw to VDI using CloneVDI, with the "Compact" option enabled to discard unused space on the disk.

Even better would have been to do the job properly right from the outset: you could have imaged the original Windows installation directly using Disk2VHD, instead of using some Dinosaur tool like dd. Of course you would also probably need an NTFS formatted external drive to transport the VHD.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 31. May 2013, 16:11
by vladtsepesh
What I forgot to say.

Is a 2TB clone, the idea of copying it in a unique VDI or VHD file is impraticable.

Moreover the image is gathered via a forensic tool.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 31. May 2013, 16:32
by mpack
Actually, the compacted VHD or VDI would be substantially smaller than 2TB. It would be helpful to have mentioned the forensic requirement earlier.

You can try "VBoxManage internalcommands createrawvmdk" (see manual) to access the "physical" drive. This arrangement would be far from ideal, it's unknown if it would actually work, and won't be supported here (raw disk access never is).

You can create a VMDK text descriptor with multiple extents to map all the segments of the dd output. You might be able to google for a split2g VMDK descriptor to use as a template.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 31. May 2013, 17:33
by vladtsepesh
mpack wrote: You can try "VBoxManage internalcommands createrawvmdk" (see manual) to access the "physical" drive. This arrangement would be far from ideal, it's unknown if it would actually work, and won't be supported here (raw disk access never is).
Creating vmdk description file via the createrawvmdk command sounds good and works now I try to start the VM and I'll let you know.
Anyway I guess what is the problem with the raw disk access?
mpack wrote: You can create a VMDK text descriptor with multiple extents to map all the segments of the dd output. You might be able to google for a split2g VMDK descriptor to use as a template.
Thanks for let me know this possibilities, it should be a good solution.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 3. Jun 2013, 12:35
by vladtsepesh
Creating vmdk description file via the createrawvmdk command sounds good and works now I try to start the VM and I'll let you know.
I start the VM with the generated vmdk but I get a

FATAL: no bootable media found

Below you can find the last section of the log file.

Code: Select all

00:00:02.868477 HWACCM: No VT-x or AMD-V CPU extension found. Reason VERR_VMX_NO_VMX
00:00:02.868523 HWACCM: VMX MSR_IA32_FEATURE_CONTROL=0
00:00:02.872399 VM: Halt method global1 (5)
00:00:02.872440 HaltedGlobal1 config: cNsSpinBlockThresholdCfg=125000
00:00:02.872456 Changing the VM state from 'CREATING' to 'CREATED'.
00:00:02.872728 Changing the VM state from 'CREATED' to 'POWERING_ON'.
00:00:02.872817 Changing the VM state from 'POWERING_ON' to 'RUNNING'.
00:00:02.880637 Guest Log: BIOS: VirtualBox 4.2.12
00:00:02.881508 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:02.895876 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=00000000 w=720 h=400 bpp=0 cbLine=0x0, flags=0x1
00:00:02.923831 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:02.925105 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:02.928061 Guest Log: BIOS: ata0-0: PCHS=16383/16/63 LCHS=1024/255/63
00:00:02.931075 PIIX3 ATA: Ctl#0: RESET, DevSel=1 AIOIf=0 CmdIf0=0xec (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:02.931439 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:02.931766 PIIX3 ATA: Ctl#1: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:02.931854 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:02.937908 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
00:00:02.959926 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=073d0000 w=640 h=480 bpp=32 cbLine=0xA00, flags=0x1
00:00:03.316334 2D video acceleration is disabled.
00:00:05.435865 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=00000000 w=720 h=400 bpp=0 cbLine=0x0, flags=0x1
00:00:05.441325 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:05.442203 Guest Log: BIOS: Boot : bseqnr=1, bootseq=0312
00:00:05.444860 Guest Log: BIOS: Boot from Hard Disk 0 failed
00:00:05.445093 Guest Log: BIOS: Boot : bseqnr=2, bootseq=0031
00:00:05.445793 Guest Log: BIOS: Boot from Floppy 0 failed
00:00:05.445967 Guest Log: BIOS: Boot : bseqnr=3, bootseq=0003
00:00:05.447801 Guest Log: BIOS: CDROM boot failure code : 0003
00:00:05.447957 Guest Log: BIOS: Boot from CD-ROM failed
00:00:05.449022 Guest Log: Could not read from the boot medium! System halted.

It seems it look for the OS only on the CD-ROM media, am I wrong?

Re: Create a VM on a virtualized OSFMount HDD

Posted: 3. Jun 2013, 13:07
by noteirak
It looks everywhere :

Code: Select all

00:00:05.444860 Guest Log: BIOS: Boot from Hard Disk 0 failed
00:00:05.445793 Guest Log: BIOS: Boot from Floppy 0 failed
00:00:05.447957 Guest Log: BIOS: Boot from CD-ROM failed
00:00:05.449022 Guest Log: Could not read from the boot medium! System halted.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 3. Jun 2013, 14:43
by mpack
I suspect that you probably created a VMDK descriptor for the main partition / volume instead of the entire drive. I.e. the VMDK should refer to a \\.\physicaldriveN style UNC identifier, not a drive letter. The drive letter (despite the name) actually refers to a partition, hence no boot sector.

I mentioned earlier that raw disk access will not be supported. You need to know what you're doing to use it, failure can cause corruption of the drive. Address the wrong drive and your host is toast.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 3. Jun 2013, 18:18
by vladtsepesh
mpack wrote:I suspect that you probably created a VMDK descriptor for the main partition / volume instead of the entire drive. I.e. the VMDK should refer to a \\.\physicaldriveN style UNC identifier, not a drive letter. The drive letter (despite the name) actually refers to a partition, hence no boot sector.
Here comes the problem.
The devices on the PC is the one listed in the attached file media.txt but the splitted image files (from IMAGE.001 to IMAGE.126) is nested under a folder in the \\.\PhysicalDrive1.
Via OSFMount I emulate the drive under the G letter of my windows machine, but this drive is not listed in the media because is not a physical one.

This way is a noexit one, I move to the split2g VMDK descriptor.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 4. Jun 2013, 11:13
by mpack
Below is a sample split2g style VMDK descriptor that I happened to have on my PC at home. You would need to modify the extent list to suit your list of chunks. Also note while this is referred to as the "2GB max extent flat" variant of VMDK, the extents can be smaller than 2GB and I'd bet can be somewhat larger too, provide you stay clear of the FAT 4GB limit. Finally, you'll see that this descriptor includes a legacy 32bit disk id (the CID), in addition to UUID fields required by VirtualBox. It would be good practice to modify all of these when describing a new disk.

The descriptor needs to be saved as a small text file with the ".vmdk" extension, ideally it would use relative addressing to address all of the extents which would be in the same folder. Of course in this scheme you no longer use the OSDMount virtual drive on the host: the VMDK is mounted directly in virtualbox.

Code: Select all

# Disk DescriptorFile
version=1
CID=ad885fa2
parentCID=ffffffff
createType="twoGbMaxExtentFlat"

# Extent description
RW 4193792 FLAT "CentOSMinimalVirtualAppliance-1.3-f001.vmdk" 0
RW 4193792 FLAT "CentOSMinimalVirtualAppliance-1.3-f002.vmdk" 0
RW 4193792 FLAT "CentOSMinimalVirtualAppliance-1.3-f003.vmdk" 0
RW 4193792 FLAT "CentOSMinimalVirtualAppliance-1.3-f004.vmdk" 0
RW 4193792 FLAT "CentOSMinimalVirtualAppliance-1.3-f005.vmdk" 0
RW 2560 FLAT "CentOSMinimalVirtualAppliance-1.3-f006.vmdk" 0

# The Disk Data Base 
#DDB

ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "16383"
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
ddb.toolsVersion = "7240"
ddb.encoding = "windows-1252"
ddb.uuid.image="9f16e0cd-f783-4c2e-aa23-96569e24e4cb"
ddb.uuid.modification="c9a7ce84-72d0-4e01-a1bd-053d0d31518a"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="6ee8e2d2-30b3-4cb6-8145-eb259b6bedf6"
ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="255"
ddb.geometry.biosSectors="63"

Re: Create a VM on a virtualized OSFMount HDD

Posted: 5. Jun 2013, 11:06
by vladtsepesh
mpack wrote:

Code: Select all

...
# Extent description
RW 4193792 FLAT "CentOSMinimalVirtualAppliance-1.3-f001.vmdk" 0
...
this is the declaration of the parts in which the whole hdd is splitted, but what I need to describe is an image part, i.e. IMAGE.00n files.
The file should become something like

Code: Select all

RW 4193792 FLAT "IMAGE.001" 0
Is there a way to achieve this goal?

Re: Create a VM on a virtualized OSFMount HDD

Posted: 5. Jun 2013, 12:54
by mpack
Yes, you can do it exactly the way you have done it. The VMDK standard doesn't care what the extent filenames are, they are just filenames. I'm assuming each chunk is just a raw (no header or encoding or compression) piece of the overall image.

In case it isn't clear: the first number on the line is an extent size in sectors (i.e. bytes divided by 512). The second number on the line is an offset into the file, therefore will always be zero in your case.

Re: Create a VM on a virtualized OSFMount HDD

Posted: 13. Jun 2013, 20:15
by garg.satish
Go to Storage in the settings of the VM which i think that you have already set up.
Now click on the icon with a CD to mount your .iso file.
Select the .ISO file from your host machine and then click OK.
Now power on your your VM.
I once stuck the same way you had and couldn't recognize the problem.
Above steps solved my problem. Hope it solves yours too !

Re: Create a VM on a virtualized OSFMount HDD

Posted: 13. Jun 2013, 20:20
by mpack
Eh? What ISO file? The OP didn't mention any ISO file, nor would it be useful to have one. The OP has a segmented hard disk image, not a CD image.