townsbg
Enthusiast
Enthusiast

Convert hard drive into VMWare virtual machine

Jump to solution

I want to take the hard drive of a dead server and convert it to a virtual machine so that I can run it on a replacement server. How do I do that? I installed vCenter converter but I can only find the options of using the local machine or a remote machine. Keep in mind the server is dead so I can't run it to access the files that way. I can slave the hard drive as an external drive in an enclosure to access the files. What's the best way to turn it into a vmdk? I know that I can slave the hard drive to the virtual machine but I'd rather convert it.

I found this thread but I'm confused about the exact command to convert the hard drive. How to convert laptop drive (with a dead laptop) for use as VMware image?

Lets say that the data is on drive h:\ and is a single partition. I am planning on putting it on a separate external drive that is unused. I've actually already created a virtual machine called broken server. Lets say it's i:\broken server. What's the command to convert it? I am running Worstation 12 on Windows 7

0 Kudos
1 Solution

Accepted Solutions
continuum
Immortal
Immortal

I assume you have this start-conditions:

Lets say that the data is on drive h:\ and is a single partition.

I am planning on putting it on a separate external drive that is unused.
I've actually already created a virtual machine called broken server.
Lets say it's i:\broken server. What's the command to convert it? I am running Worstation 12 on Windows 7
Next step:
Edit settings of "broken server"

Add hardware > select "harddisk" > select SCSI > click NEXT > select "Use a physical disk"

Now you should see a screen popup which allows you to select a PhysicalDrive by its drivenumber.

Make sure you select the external drive with the harddisk of the server.

When you sure you got the right number click NEXT.

Call the vmdk in next screen "import.vmdk" and safe it.

Now you should have a very small new vmdk named "import.vmdk" in the directory of "broken server"

Next you can use the vmware-vdiskmanager command to convert this small import.vmdk (which is just a pointer to the external disk at this time )

into a regular vmdk that no longer needs the external disk.

D:\Program Files (x86)\VMware\VMware Workstation/vmware-vdisksmanager.exe   -r import.vmdk -t 0 "brokenserver.vmdk"

Let me know when you have done this ...

next task is to reconfigure the driver of your new VM ...


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

View solution in original post

0 Kudos
11 Replies
continuum
Immortal
Immortal

I assume you have this start-conditions:

Lets say that the data is on drive h:\ and is a single partition.

I am planning on putting it on a separate external drive that is unused.
I've actually already created a virtual machine called broken server.
Lets say it's i:\broken server. What's the command to convert it? I am running Worstation 12 on Windows 7
Next step:
Edit settings of "broken server"

Add hardware > select "harddisk" > select SCSI > click NEXT > select "Use a physical disk"

Now you should see a screen popup which allows you to select a PhysicalDrive by its drivenumber.

Make sure you select the external drive with the harddisk of the server.

When you sure you got the right number click NEXT.

Call the vmdk in next screen "import.vmdk" and safe it.

Now you should have a very small new vmdk named "import.vmdk" in the directory of "broken server"

Next you can use the vmware-vdiskmanager command to convert this small import.vmdk (which is just a pointer to the external disk at this time )

into a regular vmdk that no longer needs the external disk.

D:\Program Files (x86)\VMware\VMware Workstation/vmware-vdisksmanager.exe   -r import.vmdk -t 0 "brokenserver.vmdk"

Let me know when you have done this ...

next task is to reconfigure the driver of your new VM ...


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
townsbg
Enthusiast
Enthusiast

Is this a sector by sector copy? If so I don't have enough room on the hard drive.

0 Kudos
townsbg
Enthusiast
Enthusiast

I have it running now importing it directly onto the new server. The hard drive is 360gb but only about 20 are used. Is it going to take up the full size of the drive?

0 Kudos
townsbg
Enthusiast
Enthusiast

continuum The convert is complete. The space is 19 gb more than the actual data. I hope it compacts.

0 Kudos
continuum
Immortal
Immortal

Sorry - last few days were very busy.

Do you have done the patching too ?


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
townsbg
Enthusiast
Enthusiast

When I try to boot the VM it crashes. I'm not sure what you mean by patches.

0 Kudos
a_p_
Leadership
Leadership

When I try to boot the VM it crashes

What exactly is the issue you have? An inaccessibly boot device, crash within the OS, ...?

It's not unusual that a converted machine cannot boot right away, because the virtual "hardware" is different from the physical hardware that's been used before.

What usually needs to be done is to inject the proper HDD controller driver, and disable/uninstall hardware related drivers, and tools.

In case the VM cannot boot, you can use VMware's Converter and run a "Configure Machine" job on the VM, which should fix the boot issue. Then - depending on the issues you have - you may need to do some cleanup with installed hardware related drivers, and tools, which may involve booting the guest OS in Safe Mode.

André

townsbg
Enthusiast
Enthusiast

a.p.​: The VM blue-screens on bootup. I can't even get into safe mode. How do I inject the driver and disable the unneeded ones?

0 Kudos
a_p_
Leadership
Leadership

As mentioned in my previous post, you  may use VMware Converter with the Configure Machine option, which is supposed to injected the controller driver.

Once the VM starts, disable/delete hardware related drivers, services, and tools manually.

André

0 Kudos
townsbg
Enthusiast
Enthusiast

I have the server running now. Thanks.

0 Kudos
AveryFreeman
Enthusiast
Enthusiast

I just wanted to chime in to say I have a great way to do this, too - it might be a little easier, but it does require the extra step of creating an intermediate disk image (which may or may not be beneficial, depending on your situation)

This idea is not my own, I got it from these people - looks like they even have a new tool for making the process even easier I didn't know about until I was looking around for their guide:  https://knowledgebase.macrium.com/display/KNOW/Re-deploying+Windows+to+new+hardware+using+Macrium+Re...

https://blog.macrium.com/techie-tuesday-converting-a-physical-machine-to-virtual-machine-81cfe5e0f9b...

If you don't want to go through all the manual steps I explain, you can try your luck with ImgtoVHD: http://kb.macrium.com/knowledgebasearticle50005.aspx

I am not sure if it works, but I just did the process I describe below and it worked great.

The stub just glosses over it, so I'll explain it in more detail here:

First, get macrium reflect (free) - either through: choco install reflect-free  at admin prompt if you have chocolatey, or download here: https://www.macrium.com/reflectfree

If you can mount your disk, navigate to it in admin shell (e.g. e:) and run dir /a

If pagefile.sys or hiberfil.sys are present, delete them before making the image file

Open Reflect after you install it, select the disk you want to run in a VM and make an image of it.  If you need instructions on how to use Reflect, these are pretty current (reflect's website shows a really old version): https://www.howtogeek.com/howto/7363/macrium-reflect-is-a-free-and-easy-to-use-backup-utility/

While still in Reflect, after your image is finished, create an ISO of the rescue media: https://knowledgebase.macrium.com/display/KNOW80/Creating+rescue+media

Big picture:  We're going to create one new VM in VMware Workstation just for restoring disk images created in Reflect.  This VM doesn't need a large hard drive (or, really, any hard drive file) because ...

... what you can do instead is create another new VM for the computer you have backed up in Reflect.  Ideally, you'd create a hard drive large enough to restore the entire disk from your backup onto, but if you know about how much space was taken up on the backed-up drive, you can make the .VMDK that size, as Reflect will compress / defragment drives it images.  Obviously, you'll want to try and give yourself a extra little room if you are guessing.

Then, load the 2nd VMs hard drive (.VMDK file - the one you're going to restore your backed-up physical computer's hard drive on to) into the Reflect restore VM (the first one you just made), and remove it after the Reflect image is restored on it, so you can use it with the 2nd new VM (the virtualized dying computer).

This way, you can back up and restore as many physical computers as you like, while retaining a disk image of their drive at the time of recovery / first restoration.  It's a great solution if you run into this issue fairly regularly (i.e. do file recovery or support services on failing computers).

Anyway, so back to the process:

When you make the Macrium Reflect image restoring VM, choose "bridge networking" - this will give the VM a separate IP on your same subnet (NAT might work, but this is likely to have fewer issues).

Create a network share for the folder where you stored the hard disk image from the failing computer:  https://www.howtogeek.com/school/windows-network-sharing/lesson7/

After the MacriumReflect.ISO CD boots in your Image Restoring VM (the Rescue Environment), go to "Browse for Image"

Choose the Map Network Disk icon at the top left of the window (it's the little disk with the cable looking thing below it)

Map the folder you just shared to a letter - e.g. Z:  will equal \\HostComputerName\SharedFolderName - and add your user credentials

If the sharing works OK, you should have access to the image.  If this is all done on the same computer, it will be very fast (not limited to network speed at all), but it can also give you a lot of flexibility - for instance, you could make the backup image on a separate computer you are using for the restoration, etc. (ideal when you have a file server with a ton of storage space and a 10Gb+ network).

Restore your image to the 2nd VMDK disk you added to the Macrium Reflect restoring VM, the one that's big enough for the backed-up image from the dying computer

Once it's done, shutdown the Macrium Reflect restoring VM (you can set it to shutdown automatically), disconnect (remove) the VMDK to the 2nd VM you made for the computer backup

Run your virtualized computer you made by powering it on.

Even more flexibility: From here, you can use workstation to upload your new VM you made from the dying computer to your ESXi host, or make an .OVA for distribution.

0 Kudos