Page 1 of 1
How to turn entire hard disk into .vdi or .vmdk?
Posted: 18. Oct 2008, 21:39
by idigchess
I currently use linux ubuntu and want to take my windows installation and virtualize it, so that I only need one partition. It will be on the same computer, so the migration shouldn't be a problem. However, I am having a problem because the mbr is messed up when I move windows into virtualbox. So now I want to make my entire disk (including linux) into a vmdk or vdi and then uninstall linux from virtualbox and fix the mbr. The only problem is that I was using Norton Ghost to make the vmdk and that won't work with an ext2 or 3 filesystem, so now I don't know how I am going to turn the whole disk into a virtual image. Thanks!
Posted: 20. Oct 2008, 22:13
by Sasquatch
Please see this topic:
http://forums.virtualbox.org/viewtopic.php?t=9697
It is how to run it both native and in a VM, but you can skip the native part if you don't want that.
Posted: 21. Oct 2008, 02:26
by vkov_tinsky
So now I want to make my entire disk (including linux) into a vmdk or vdi and then uninstall linux from virtualbox and fix the mbr.
I don't think that should be necessary - using just the Windows partition should be enough. To create a working VDI of an existing installation (and assuming Windows is only on one partition) you could something like this:
- Under Windows change computer type to "Standard PC" (Device Manager -> Computer -> ... -> Update Driver). (Set this back at the end if you still want to use that installation natively.) Then run MergeIDE (see the Hard Disk Support section here). Finally using regedit delete all keys under HKLM\SYSTEM\MountedDevices and reboot into Linux.
- Create a raw vmdk for your Windows partition (see section 9.9. in the manual and this posting)
- Boot GParted Live in VirtualBox with your raw vmdk attached as well as a new VDI (at least the size of the Windows partition). Copy the Windows partition to the new disk and also set the boot flag for it.
- Boot your WinXP CD with the VDI attached (in IDE mode, OS type obviously now set to "Windows XP", I/O ACPI left off) and choose the repair option. Run fixboot c:. If your Windows partition originally wasn't the first one on the disk now do bootcfg /rebuild (enter /execture /fastdetect as boot parameters). If your boot timeout is zero also run bootcfg /default.
Now you also need to disable a couple of drivers so you can boot. Run disable agp440 and also disable intelppm. If when you try to boot Windows in the next step you still get a BSOD mentioning a specific driver you can also disable it using this method.
- To stop Windows asking for reactivation set the MAC address in VirtualBox to that of your real NIC. Seconly if you're using an OEM version of WinXP set the bios information correctly (see here).
- Boot from the VDI. If all goes fine and you can get to the Windows desktop uninstall any unused drivers: In a terminal run set devmgr_show_nonpresent_devices=1 && devmgmt.msc and then choose View->"Show Hidden Devices" to uninstall any non-present devices (the ones with a semi-transparent icon). Also change the computer type (see step 1) to "Advanced Configuration and Power Interface (ACPI) PC".
Regards,
VT