How to Convert a Physical Hard Drive to a Virtual Machine
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.
- Download and install WinImage. WinImage is free for 30 days after which there is a nominal $30 onetime charge. Definitely worth it.
- 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.
- 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.
- In WinImage, click the Disk menu item and then select “Creating Virtual Hard Disk Image from physical drive“.
- 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.
- Select a location to store the .vhd file, and click Save. Be sure you have enough disk space.
- 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. - 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.
- 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”.
- 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)
- 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.
- 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:


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!
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…
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.
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!!
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
You need create a new “vpc” and then add the hard drive.
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.
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?
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.
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…!
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.
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.
ok but i use vmware player not virtual pc… can winimage create the config file?(vmware player can’t) please reply…
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
Extracting the HAL worked perfectly. Thanks!
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!!
Thank you VERY much for this information.
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?
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
Hi Jonathan,
Does VPS ‘07 give any error messages? If so, what is the exact error message?
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.
Kyle: I’m not sure I understand your question. What for H: drive are you referring too?