Sign in with
Sign up | Sign in
Your question
Closed

Booting a Physical Disk as a Virtual Machine?

Tags:
  • Virtual Machine
  • Business Computing
Last response: in Business Computing
Share
May 4, 2013 9:36:58 PM

I have a physical HDD which is bootable (from a computer that died).

I want to boot this drive (which has Win7) as a virtual machine (in either VM Player or Virtual Box).

I thought this should be simple (I can, of course, boot this disk by plugging in the SATA cable and booting it as my main drive), but it has proven VERY difficult.

I'm assuming this should be very possible, and I'm just doing something wrong?

I've of course looked online, but the directions provided are all quite confusing to me, and seem to be for very specific scenarios. All I want is to be able to boot this drive in a virtualized environment, nothing more.

I have tried creating a VHD file, converting them to VMware readable files, and that hasn't worked.

Anyone?

More about : booting physical disk virtual machine

May 4, 2013 9:49:17 PM

You generally can't do that. Windows tends to get attached to a specific motherboard model, so switching motherboards tends to be problematic. Virtual machines don't always emulate real hardware, so it is even less likely to work than sticking the drive in another computer.

Why do you even want to do this? Just install a new copy of Windows in an new VM and copy over the files.

If it is an OEM copy of Windows, you are out of luck because those only work if there is a certificate embedded in the BIOS.
Score
0
May 4, 2013 10:07:40 PM

I'm astonished that this is so difficult/impossible - conceptually it seems so simple to me. I was also under the impression that people do this with some frequency? There are many posts about converting .vhd files to run in virtual machines.

My exact usage case is I don't have another available machine to boot the disk (it's from the exact same hardware; it's the old drive for my computer), and I want to learn how to boot physical disks as virtual machines. I know it's possible as VMware products have settings involving 'boot from physical disk.'

The reasons I'm interested in booting the driver proper, in addition to just wanting to learn how to do it, is that I'm trying to remember my Windows settings (I customized the OS) from this drive, amongst a few other things that I can only see easily if the OS is booted.

But I just don't know how to do it...
Score
0
Related resources
May 4, 2013 10:40:15 PM

"converting .vhd files to run in virtual machines" is not what you are trying to do. You are trying to convert an actual hard disk to a .vhd file, and then from that into a virtual machine. Not the same thing. I looked into this once, years ago, and was never successful in doing it. I'm not surprised, because if it was easy to do Microsoft would be in trouble, people could do what you want to do, take an HDD with a legitimate copy of Windows installed on it, and then make a gazillion virtual machines out of that one HDD. That would completely circumvent the DRM in Microsoft's operating systems. Not likely to happen, and the biggest reason is because the virtual hardware in the virtual machine's system is not remotely like the real hardware that the Windows install came from on the HDD. Different devices, wrong drivers, it's a mess. Windows would BSOD if you could get it to boot into a VM.
Score
0
May 5, 2013 12:24:17 AM

Everything you've said makes good sense. All that being true then though, what are all these people online talking about (and the vm products talking about) when they say you can boot a virtual machine from a physical disk?

It seems to me that this is exactly what I want to do? Whether I need to covert said physical disk to a .vhd image first I'm not sure.

I feel as if the DRM issue wouldn't make sense if I was only trying to boot the disk itself in the virtual machine - I can only boot the one drive itself, (I take your point about making vhd images though).

If I just want to boot the physical disk, unless I've been readig incorrectly, people seem to do this all the time? I could obviously just plug the disk in and boot it, but I'm almost certain the VM should be able to virtualized the hardware? What, if I'm wrong, are people referring to when they "boot a VM from a physical disk?"
Score
0
May 5, 2013 12:49:06 AM

commissarmo said:
If I just want to boot the physical disk, unless I've been readig incorrectly, people seem to do this all the time? I could obviously just plug the disk in and boot it, but I'm almost certain the VM should be able to virtualized the hardware? What, if I'm wrong, are people referring to when they "boot a VM from a physical disk?"


One thing they may be talking about is creating a VM and storing the new VM's HDD data on a physical disk instead of in a virtual hard drive file.

In VMware Workstation, you can connect a physical hard drive to your VM pretty easily. I guess you could try making a new VM, deleting the virtual hard drive it creates for it and replacing it with your physical hard drive and see what happens. Chances are that it won't boot, but I guess you could give it a shot.
Score
0
May 5, 2013 7:24:53 AM

Purrcatian is correct when they are talking about booting a physical drive for a virtual machine. I've done this before with Hyper-V. You can pass through a physical disk or set of disks to a virtual machine as if they were directly attached storage on the VM, and the system can have all the files on the drive directly. This can be handy for a few things. Mainly, if you are using a VHD file, all of your data is contained with a single .vhd file. Sometimes for backup purposes you don't want everything that way, you want all of your raw data easily accessed in its original form, and that is why we passed through the whole hard drive to the virtual machine.

However, every time I have seen that done, it has always been to create a NEW virtual machine with a new installation of the operating system. That is because installing the OS on a virtual machine will install specific drivers for that virtual environment, NOT your base hardware. Even if you do attach a hard drive through directly to a virtual machine, if it has a pre-existing installation of Windows it may not boot because it has incompatible drivers installed. I don't know how to pass through physical drives in VirtualBox, I haven't used it in a while to know how that is done now, as the last time I used it that feature wasn't possible. Again, I've just done this in Hyper-V and once with some varying degree of luck in the free ESXi HyperVisor.

Now, on to some good news. I HAVE converted a physical machine to a VHD file and run it within Hyper-V with success. This was a little while ago, but we had a Windows XP machine running some old specialized accounting software that would not work in Windows 7. All of the computers got replaced with new Windows 7 systems, and to save the functionality of the software we used a 3rd party software to convert the physical system into a VHD file. From there we were able to convert it to a VirtualBox virtual machine (that was actually the last time I have used VirtualBox come to think of it) and was able to run the VM right on the new computer.

Unfortunately, I don't recall the name of the program, but I know that there are some third party programs that can be run to convert a physical installation into a virtual machine file. The problem is it all comes down to drivers, or luck, whether or not the machine will boot up completely in the virtual environment.
Score
0
May 5, 2013 9:28:22 PM

All right that sounds reasonable. I will continue looking for a solution. In the mean time I just pulled the files I want off the drive. I'm very interested in seeing if I can make this work now though, it seems very ninja!
Score
0
May 5, 2013 9:55:58 PM

Please reply back to this thread if you find a solution. I tried a few years ago and gave up, but I would like to be able to do the same thing also.
Score
0
May 13, 2013 7:26:04 AM

You may want to consider this from another angle, as two separate pieces. The first piece is conversion of a physical hard disk to a VHD file. This part is relatively easy, there are a wide variety of P2V tools available to perform this task and the process is relatively straightforward. If this part of the process has been giving you issues, you can use the Sysinternals utilty Disk2vhd which you can download here.

The second part is the migration from one hardware environment to another. This is where most hang ups occur in this process and these hang ups occur similarly if you were to just take one hard drive from one computer and move it into another with different hardware. Many enterprise virtualization solutions, such as System Center Virtual Machine Manager (VMM) have P2V agents which perform a variety of tasks to homogenize the original and target environments to eliminate driver conflicts, etc. For an example, see the documentation on P2V with VMM which is available here on TechNet.

Without an enterprise solution, you will need to manage the driver conflicts manually. You can use Sysprep to generalize the image and prepare it for deployment to new hardware, or you can manually remove driver software from the system and reset any hardware specific driver configurations, such as AHCI vs. Legacy storage modes. Lastly, you may want to check the requirements for P2V listed on TechNet here. These will vary depending on the virtualization technology, but several of these may be the culprit of your P2V such as non ACPI BIOS or disks larger than 2TB.
Score
0
May 13, 2013 7:45:44 AM

While I suspect that you will be able to resolve the issue with the information I have provided above, I did forget to address the original issue. I cannot say about other virtualization technologies, but Hyper-V, both on server and client is fully capable of mounting physical disks. The disk must be offline in Disk Management in order to appear as a valid physical disk for attachment. The order of operations would be to create a virtual machine without a virtual disk with the proper network connections and memory allocation, then to open the machine settings and add a physical disk to IDE controller 0. The walkthrough for mounting a physical disk is available here. Remember, Hyper-V is included with Windows 8 Professional and Enterprise and can be enabled by adding the role as described in the overview of client Hyper-V.
Score
0
October 9, 2013 11:14:27 AM

The issue here, as everyone has said is the conflict between the hardware the installation expects to be there, and what is provided by the VM (or indeed by another MB if you tried to install that drive in another physical machine--either way it won't work) I HAVE created a VHD file from an old Win XP installation that I was able to boot on virtual box. The way I did it was to create the VHD with the data from the physical boot disk, THEN do a repair install of windows on the vhd in virtual box. When I did that, windows goes through and updates all the drivers and hardware configurations to work on the virtual machine. After doing that my system would boot. You can probably do the same with a physical drive if you want, but then that drive will ONLY work in that VM environment.

As was noted by others, I'm not sure you can do that if you only have an OEM version of Windows that expects a certain hardware configuration. I have normal windows installation discs so that wasn't an issue for me.
Score
0
November 10, 2013 3:46:34 PM

The OP asked to mount a physical hard disk in a VM inside Virtual Box. That's easy.

Create a Virtual Machine in VirtualBox.
Click into the VM's Settings, then into Storage.
Add a hard disk.
Select "Choose existing disk" and go from there.

My only concern would be making sure I don't accidentally boot the host system off of that hard disk. (I would disable booting from USB in the BIOS and connect the hard disk with a USB to SATA adapter after I finished booting.)

Another possible problem is licensing restrictions from Microsoft. IIRC, You can move any non-OEM copy of Windows 7 into a VM. If this is Windows 7 OEM, You are screwed. If it's not, You still have to re-activate it with the "new hardware." Remember not to bring it back up in the original hardware, as that would cause Microsoft to freak over licensing issues.

I have assumed You can configure a Windows 7 VM, and that Your system has the right virtualization features.

--Andy
Score
0
June 14, 2014 8:24:44 AM

I WAS actually able to successfully turn a bootable hard drive into a VHD for Hyper-V. My sister-in-law has Windows XP Pro on her workstation back in April and of course need to migrate, but she had a number of accounting programs on it that I did not want to have to re-install. She had seven years of tax software that she might possibly need if she had to go back and re-do a tax return for a previous year (up to seven years back). I was sure she didn't have all the install discs going back all seven years.

So I converted her hard drive to a VHD file using the SysInternals converter (now owned by Microsoft), and I attached it to a virtual machine on the new workstation I built her (Windows 8.1 Pro) in Hyper-V. It sucks that Microsoft only makes Hyper-V available in the Pro version, but oh well. And it worked! So now, if she ever does need to run a tax program from farther back than three years ago, she can fire up her Windows XP VM, taken from her old, obsolete workstation, and run it. It hasn't happened yet, but it IS available if she needs it.

I ran into minimal problems getting the VHD file to boot up in Hyper-V after converting her old HDD. I don't remember exactly, it's been a while now, but it wasn't hard.
Score
0
!