How to Convert a Physical Hard Drive to a Virtual Machine

October 9th, 2008 Kirb Leave a comment Go to comments

Recently, I was working on a customer’s computer which had a bad motherboard. The customer opted to go with a new computer instead of repairing the old one. Naturally, I copied all the documents, Outlook pst files, etc. to the new computer, but I thought, wouldn’t it be nice if I could create a virtual hard disk of the physical drive that I or the customer could actually boot into? However, I could not find a method to create a .vhd file from an existing hard drive, so I gave up the idea. The next day I attended a Microsoft Across America event in Gettysburg, and the Microsoft rep in his presentation mentioned that he had made a .vhd file of his wife’s old computer using a program called WinImage. I quickly jotted the name down, and today I had a chance to download the program and it does exactly what I’m after. With that lengthy introduction here are the steps you need to do to convert your physical hard drive into a Virtual Machine or .vhd file for use in Microsoft Virtual PC 2007 or a similar program.

Just for the record the physical drive I was imaging had Windows XP installed on it. The procedure is going to vary slightly for other versions of Windows.

  1. Download and install WinImage. WinImage is free for 30 days after which there is a nominal $30 onetime charge. Definitely worth it.
  2. Attach the physical hard drive to the computer on which you loaded WinImage. You can do this either by plugging it directly into the motherboard via an empty SATA or IDE port, or you can use a USB adapter such as this one from Amazon, which is by far the easier method.
  3. Open the WinImage program. If you are running Windows Vista, make sure you run the WinImage (Administrator)mode which can be found under the WinImage folder under All Programs.
  4. In WinImage, click the Disk menu item and then select “Creating Virtual Hard Disk Image from physical drive“.
  5. Make sure the “Include non removable hard disk(s)” box is checked, and then select the hard drive that you would like to make an image of. You can either make a fixed size or dynamically expanding hard disk. I would recommend the dynamically expanding option. Click OK.
  6. Select a location to store the .vhd file, and click Save. Be sure you have enough disk space.
  7. At this point, WinImage will begin converting the hard drive to a .vhd file. This process could take an hour or more depending on the size of your hard drive, and how it is connected. Just be patient. :) Once the process is complete, your new .vhd file is ready to be opened with Microsoft Virtual PC. If all goes well, it will boot fine into Windows and you won’t have any problem at all. If so, you are good to go, and you can ignore the rest of the steps. However, most likely Windows XP will lockup or freeze while booting. In this case, proceed to step 8.
  8. Ok. So you managed to create the .vhd file, but now regardless what you try Windows XP will not boot properly. Typically, the problem is the drivers that Windows is trying to load on startup. Here is what you need to do. Grab the closest Windows XP cd and pop it in. Start the Virtual PC, and in the CD menu, select Use Physical Drive. In the file menu select Reset.
  9. Press any key when you see the “Press any key to boot from CD…” message. Once setup had loaded, type “R” which will load the Recovery Console. Enter the number of the windows installation you want to log onto. Most often its 1. Enter the administrator password if you have one, otherwise hit “enter”.
  10. At the command prompt, type “CD System32″ , hit enter. Then type “expand D:\i386\HALACPI.DL_” , hit enter again. Finally, type “copy HALACPI.DLL HAL.DLL”, and hit enter. Type Y for yes on the overwrite file confirmation message. (*cd drive letter may vary)
  11. Reboot the Virtual Machine. If everything works the way its supposed to you should see it boot into Windows. Likely, you will have to reactivate Windows before it will allow you to actually log on. Congratulations, you now have a virtual image of your physical drive.
  12. Optional: Depending on how big your .vhd file is, you may want to compress the image. Check out this post for tips on that. Or this one.


If you still have difficulties you can check out the following websites which helped me tremendously.

Using Virtual PC for computer migration
Tips for migrating a physical computer to a virtual machine (part 2)
Tips for migrating a physical computer to a virtual machine (part 3)
Tips for migrating a physical computer to a virtual machine (part 4)

Disclaimer: Your mileage may vary. Make sure you have current backups before attempting any major changes to your computer. I’m not responsible for any problems that may occur from following or not following these steps. You also are responsible to make sure you have the appropriate Microsoft Software licenses for your virtual machines.

Update 10/13/2008 – If you get a blue stop screen with an error 0×0000007B try expanding hal.dl_ to the \system32 folder instead of halacpi.dl_.

Related posts:

  1. Microsoft TechNet Virtual Labs Vista Error
  2. Do What?
  3. Activate Windows XP after Upgrading Memory?
  4. Microsoft Windows Vista SP 1 Beta Released
  5. Critical Microsoft Security Bulletin – KB958644

  1. Branson Computer Repair
    November 21st, 2008 at 06:35 | #1

    I also like to use VMWare. It’s been a solid solution for creating virtual machines for a long time. You can even use it to play old Nintendo games if you want.
    I find it most suitable for running an instance of Server 2003 (or other server OS) but keeping my same Linux or XP installation alive and active.
    Thanks for the great post!

  2. Jonathan
    January 7th, 2009 at 09:10 | #2

    I have a question: Is it possible, to just copy only one partition of a drive to a virtual image? Because I have a big HDD and two OS. If I would have to take both of them into the Image that would get much to big.
    Thanks…

  3. January 7th, 2009 at 09:17 | #3

    Jonathan: Yes, I think that’s possible. You may have to change some things with the MBR if you want to make it a bootable Virtual PC.

  4. Jonathan C.
    February 1st, 2009 at 21:01 | #4

    Hi, I followed your instructions on converting a physical disk to a VHD using Winimage. Unfortunately, VPC ‘07 doesn’t think it’s a VHD. What did I do wrong? It took 6-7 hours to convert my disk, I would sure hate to do that again. But, I would if I knew what I did wrong. BTW, I can access the individual files & folders thru Winimage.

    And I ran Winimage on Vista x64 as well.

    What do you think?

    Thanks!!

  5. Jonathan Cohen
    February 2nd, 2009 at 12:26 | #5

    Thanks, for getting back to me!

    When I try to use the image as a vhd, I get the following error …

    The file “H:\sexypc.vhd” is not a valid virtual hard disk.

    Please make sure you only select virtual hard disks that were created with Virtual PC.

    BTW, my 13″ Sony Vaio … not very sxy anymore.

    Thanks again,
    Jonathan

  6. Mike
    March 3rd, 2009 at 01:28 | #6

    You need create a new “vpc” and then add the hard drive.

  7. Kyle
    March 19th, 2009 at 13:10 | #7

    Got a question. If you even come back to the site to check it. Is your “h” drive over a network or just an added hd? I did the exact same steps minus the recovery console part i just repaired the windows install.

  8. Jonathan C
    March 19th, 2009 at 23:04 | #8

    I think he is referring to my external HD, it was not a network drive Kyle.

    It may be a moot point. My experiment with VPC 07 on a laptop has been less than great. I finally got back my SEXYPC Laptop which is 2GB on Core Duo running at 2.1GHZ and it seems to be faster than my 64bit 2.8GHZ w/ 8GB of RAM running vpc 07. I have nothing running on the host and it’s not as fast as I would like, running Vista as a guest is dreadful sometimes. XP2 is measurably better, thinking about giving Hyper-V a shot. What do you guys think?

  9. computer repair
    March 25th, 2009 at 13:18 | #9

    I had been wanting to convert my hard drive into a virtual machine for a long time and finally came across your tutorial here. What a relief to find that it was possible in such simple steps. I converted my harddrive into a virtual pc and it works great. Thank you very much for these steps, and I look forward to reading more of your posts.

  10. Moses Ostreicher
    July 13th, 2009 at 02:50 | #10

    Thanks a million for this! I have been searching for something like this for a loong time… The way you explain it is fool proof…!

  11. XL
    October 7th, 2009 at 16:03 | #11

    Got any “reset” instructions for Win98SE, like you do for XP above? Imaging process went fine, boots fine, Virtual 98SE gets to recognizing and installing drivers and it poops out either with BSOD or just outright shutdown.

    • October 7th, 2009 at 20:12 | #12

      No. I’m sorry I do not. I’m actually surprised it didn’t start up just fine for you. I know some of those earlier versions were almost easier to move to other hardware than XP is.

  12. kevin
    October 8th, 2009 at 04:33 | #13

    ok but i use vmware player not virtual pc… can winimage create the config file?(vmware player can’t) please reply…

  13. October 21st, 2009 at 20:19 | #14

    I’ve also found that there’s a free solution. It’s free and called disk2vhd; it’s from Sysinternals, they’ve also made many other useful tools. The link is http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

  14. Jim
    November 28th, 2009 at 22:20 | #15

    Extracting the HAL worked perfectly. Thanks!

  15. JaCe
    April 3rd, 2010 at 11:45 | #16

    Just wanted to say thanks because you helped me get my Win XP up and running through Windows Virtual Machine. Basically my PC’s power supply and motherboard fried a few weeks ago and I desperately needed to extract data from the HDD- but unfortunately it was encrypted by WinXP. This way I can boot into WinXP from another machine through a virtual version of the physical and boom! It worked! Thanks!!

  16. Renny
    April 28th, 2010 at 08:00 | #17

    Thank you VERY much for this information.

  17. Daniel
    May 1st, 2010 at 04:59 | #18

    I would like to know if I can copy a raid configuration.

    XP Home, raid (whichever one spans all discs), two 80GB HDD’s. Shows in windows as one 160GB drive. I don’t have access to the pc right now, but will WinImage show two 80GB drives or one 160GB drive?

    After conversion, I’d like to keep the virtual, but also restore to a single 500GB.

    Any suggestions?

  18. miracle worker
  19. February 2nd, 2009 at 08:17 | #20

    Hi Jonathan,

    Does VPS ‘07 give any error messages? If so, what is the exact error message?

  20. February 2nd, 2009 at 14:19 | #21

    Jonathan,

    I’m not sure I have an answer for you on that one. It would almost sound like the .vhd file is corrupted in some way, except that you can view the files in Winimage. hmm… Was the original hard drive all one partition? Did it have just a single Operating System on it (that is, no dual booting)?

    The other thing you could try just to rule out the possibility of a Virtual PC ‘07 problem, is to install VirtualBox which is another free virtualization product and see if you can open the .vhd file in that program.

  21. March 19th, 2009 at 17:13 | #22

    Kyle: I’m not sure I understand your question. What for H: drive are you referring too?

  1. November 28th, 2009 at 21:22 | #1