Creating VMWare/VPC disk from real disk

Posted by: andy

Creating VMWare/VPC disk from real disk - 09/10/2007 03:56

I want to virtualize a couple of old servers whose hardware is on its last legs. So I am planning to move them onto VMWare or Virtual PC on another machine.

I am lazy, so I want to do the least work possible.

Ideally what I want to do is just convert the partitions on the existing hard drives on the two machines into VMWare/VPC disk files.

It doesn't look like VPC is capable of doing this itself (I don't know about VMWare as I have only ever used the VMWare player). I did some Googling to see if there were any other tools out there to do it, but couldn't find anything.

One server is a Linux box, with just a root partition and a swap partition on an IDE drive, the other is a Windows box with a single NTFS partition on hardware RAID array.

Can I do what I want to and how ?
Posted by: Roger

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 04:57

Quote:
It doesn't look like VPC is capable of doing this itself


Microsoft Virtual Server can do this for the Windows box, and it's free as well. Our IT department just migrated a couple of physical servers to virtual servers, and it took a couple of hours for each one.

Once you done that, you can mount the VHD (they're the same format) in VPC if you don't want to use Virtual Server.

It might even be able to do this for the Linux box, but I wouldn't be so sure. For that, you probably want VMWare.
Posted by: Phoenix42

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 10:53

For the Windows system you can used VMware's Converter to do the heavy lifting - it is free.
It does have some experimental support for converting Linux systems - but the source systems needs to be SCSI based.
Posted by: andy

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 11:31

Ok, so it looks like I have a good solution(s) for the Windows box.

I can very easily put the Linux partitions into files using cat or dd. Surely there must be a tool somewhere that can turn a raw partition file into a hard disk file matching either the VMWare or VPC format ? (the VMWare converter appears to be able to convert between VMWare/VPC and convert a couple of backup formats, but I can't see any way of converting raw partitions)
Posted by: andy

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 12:09

Ok, looks like I found the magic word. Searching for "p2v" (physical to virtual) turns up a lot more useful stuff than I had managed to find before.

Looks like I can achieve the Linux migration like this:

- create target VM, complete with empty virtual disks
- boot target VM using a Linux boot CD
- boot source machine using a Linux boot CD
- use dd+nc to stream raw partitions from source to target

The remaining challenge will be to get working Redhat 7.1 drivers for the VMWare/VPC "hardware".
Posted by: Phoenix42

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 12:18

Might it be quicker to build a new virtual machine and then copy across the application it hosts?
Posted by: andy

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 14:08

It won't, it is my main email/domain server with years of accumulated config and custom scripts. I have been putting off moving it across to a more recent version of Linux for years now.
Posted by: tman

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 16:39

Quote:
It won't, it is my main email/domain server with years of accumulated config and custom scripts. I have been putting off moving it across to a more recent version of Linux for years now.

Won't it freak out because all the hardware has changed?
Posted by: drakino

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 17:03

Quote:
Won't it freak out because all the hardware has changed?


Linux? Nah. I moved a single install across a few generations of Compaq hardware with no problems. Best way I found to do it was to swap the disks in, and ensure the hardware RAID controller saw them. I'd then boot the new server with the install CD of the OS, switch over to a console once it booted and run dmesg to look at the kernel log and see what storage module it loaded. After that, mount the disks if not already done, and go change the storage module name over to the new device. After that it was a reboot to bring up the old install, then possibly a module change for the network adaptor.

If I remember right, VMWare emulates a pretty old and standard SCSI controller, so even an old RedHat 7.1 install should have no problems supporting it. If it's on an IDE controller currently, just remember to change things from /dev/hda to /dev/sda if you aren't using labels to mount disks.
Posted by: andy

Re: Creating VMWare/VPC disk from real disk - 09/10/2007 18:18

As Tom says, I don't expect too many problems on that front. The only real hardware to worry about is the IDE or SCSI controller and the network card. I don't run X Windows on this server and the kernel it is running is just the totally bog standard one.
Posted by: tman

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 07:05

Quote:
Quote:
Won't it freak out because all the hardware has changed?


Linux? Nah. I moved a single install across a few generations of Compaq hardware with no problems.

Oops. The Windows box I mean. The last time I tried it, the Windows installation got hopelessly confused and refused to boot properly on the new and old system.
Posted by: andy

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 07:18

Quote:
Quote:
Quote:
Won't it freak out because all the hardware has changed?


Linux? Nah. I moved a single install across a few generations of Compaq hardware with no problems.

Oops. The Windows box I mean. The last time I tried it, the Windows installation got hopelessly confused and refused to boot properly on the new and old system.


Ah that makes more sense

I am hoping that the VMWare Converter tool helps out with that side of things, we will see. It was really the Linux box that I wanted to virtualize more than the Windows one, I could start the Windows one from scratch as it is only a file/web server.
Posted by: Phoenix42

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 10:32

The Converter & other P2V applications do handle the hardware change for you. Though it is a best practice to go into device manager and clean up the stale hardware.

This morning I am migrating a Dell GX270 running XP and later a Micron NetFRAME 6200 running 2003 into our virtual environment. I've found the VMware tool to work well for 2000 & 2003, not so good on NT, though this was with the older version of the tool, as for Linux, there is some experimental support but as I am not a Linux person I've not played with it.
The VMware forums are pretty good, some one there might be able to advise you on how to migrate it rather then rebuild it.
Posted by: tfabris

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 15:13

Quote:
The last time I tried it, the Windows installation got hopelessly confused and refused to boot properly on the new and old system.

When you say "the last time I tried it", do you mean "the last time you moved a real disk into a virtual machine", or do you mean "the last time I moved a windows installation to another computer"?

In my experience, the virtual machines have a hardware emulation layer that imitates pretty standard generic kinds of hardware, nothing fancy. They deliberately choose to emulate hardware that has out-of-box drivers in the recent Windows OS's. So theoretically, an XP or Windows Server install should boot right up inside a virtual machine. It might detect a couple new bits of hardware, but the drivers should just "be there" for them.

Of course you'll also want to install the "Virtual Machine Tools" or whatever they call it. That'll make it all work faster.
Posted by: wfaulk

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 15:21

Except that newer versions of Windows will probably see all those hardware changes and force you to reregister your serial number or some such shit.
Posted by: tfabris

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 15:47

Which shouldn't be a problem if it's a legit version of Windows.

OH MY GOD I'VE BECOME ONE OF THEM KILL ME KILL ME NOW
Posted by: Tim

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 15:59

Quote:
Which shouldn't be a problem if it's a legit version of Windows.

A few weeks ago I bought some new RAM and had all kinds of neat problems when I installed it. That RAM caused me to lose one video card (replacement not available, so I removed the other (SLI setup) and replaced it with a newer model), one mainboard, one of the old sticks of memory and the hard drive.

I used an old hard drive that I had repaired after it got corrupted previously, and it still had XP installed on it. After booting it up with all the new pieces/parts, Windows complained that the hardware significantly changed since it was registered (three sticks of RAM, a mainboard, new video card, etc) and I'd have to reactivate it.

The activation took place over the net with no hassle. I was expecting to have to phone it in after all that stuff changed (basically a hard drive, one stick of RAM, and the CPU were the only common parts), but I didn't. Activation isn't nearly as painful as people make it out to be (as long as you do have a legit copy).
Posted by: tman

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 16:05

Quote:
Quote:
The last time I tried it, the Windows installation got hopelessly confused and refused to boot properly on the new and old system.

When you say "the last time I tried it", do you mean "the last time you moved a real disk into a virtual machine", or do you mean "the last time I moved a windows installation to another computer"?

It was with a earlyish version of VMWare.
Posted by: wfaulk

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 16:06

I thought you could only change hardware like 3 times or something.
Posted by: tman

Re: Creating VMWare/VPC disk from real disk - 10/10/2007 16:06

Quote:
The activation took place over the net with no hassle. I was expecting to have to phone it in after all that stuff changed (basically a hard drive, one stick of RAM, and the CPU were the only common parts), but I didn't. Activation isn't nearly as painful as people make it out to be (as long as you do have a legit copy).

Apparently you can reactivate without needing to phone them up if there is a long enough period between originally activating and reactivating it.
Posted by: gbeer

Re: Creating VMWare/VPC disk from real disk - 12/10/2007 01:09

Quote:
Which shouldn't be a problem if it's a legit version of Windows.

OH MY GOD I'VE BECOME ONE OF THEM KILL ME KILL ME NOW


Tony, play the attached file.
Posted by: tfabris

Re: Creating VMWare/VPC disk from real disk - 12/10/2007 03:15

*is ded*