How to move Windows to VirtualBox

So you finally got fed up with M$ and decided to try Linux.
You set up a dual boot so you could run Windows and Linux and are finding that you like Linux better, and now after discovering VirtualBox you find that Windows runs great under Linux and want to convert you existing Windoze partition to a VDI.

Note: If you want to create a VDI from a drive that only has windows on it you can pop the drive into a linux machine as a second hard drive.
You can also simply boot a Live Linux CD, but I haven't tried creating a disk image of a drive to the same drive. For obvious reasons this might not work, so you will want to have an external usb drive or multiple partitions/drives so you can save the image to a different drive than the drive you are copying.

In linux type:

sudo fdisk -l

This will give you a list of installed hard drives and partitions:

/dev/sda1   *           1         486     3903763+  82  Linux swap / Solaris
/dev/sda4             487       14593   113314477+   f  W95 Ext'd (LBA)
/dev/sda5            7414       14593    57667648+  83  Linux
/dev/sda6             487        7413    55641064+  83  Linux

Now we need to make a disk image of the windows drive to your home dir in linux
Note: If you are running of a live cd, mount the drive you want to copy to and substitute the mount point for ~/

sudo dd if=/dev/sdb4 of=~/xp.dd

Now convert that to a VDI image.
Note: You will need to have virtualbox installed for this to work

VBoxManage convertdd ~/xp.dd ~/xp.vdi

Now create your new system in VirtualBox using the vdi you just created.
Note, you probably want to move the .vdi to your VirtualBox VDI directory first.

Enjoy!


Comments
(Thanks to everyone who comments)

Checking now

I am still in the process of trying this. Nothing else I have seen online has worked so I am hoping this will. I had roughly a 200Gb drive and created the .dd to a USB device. Took roughly 38 hours to create. Took about 90 minutes to copy over FireWire to my new system and I am creating the .vdi now. Keeping my fingers crossed....will update once I know...


Thanks. Nice article

Thanks. Nice article


Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may link to Gallery2 items on this site using a special syntax.

More information about formatting options

728x90 banner