What's That Noise?! [Ian Kallen's Weblog]

« Going to Metallica's... | Main | Configuring Web... »

20090331 Tuesday March 31, 2009

Cloning VMware Machines

I bought a copy of VMware Fusion on special from Smith Micro (icing on the cake: they had a 40% off special that week) specifically so I could simulate a network of machines on my local MacBook Pro. While I've heard good things about Virtual Box, one of the other key capabilities I was looking for from MacIntosh virtualization software was the ability convert an existing Windows installation to a virtual machine. VMware reportedly has the best tools for that kind of thing. I have an aging Dell with an old XP that I'd like to preserve when I finally decide to get rid of the hardware; when it's time to Macify, I'll be good to go.

I started building my virtual network very simply, by creating a CentOS VM. Once I had my first VM running, I figured I could just grow the network from there; I was expecting to find a "clone" item in the Fusion menus but alas, no joy. So, it's time to hack. Looking around at the artifacts that Fusion created, a bunch of files in a directory named for the VM, I started off by copying the directory, the files it contained that had the virtual machine name as components of the file name and edited the metadata files ({vm name}.vmdk/.vmx/.vmxf). Telling Fusion to launch that machine, it prompted if this was a copy or a moved VM - I told it that it was copied and the launch continued. Both launched VM's could ping each other so voila: my virtual network came into existence.

I've since found another procedure to create "linked clones" in VMware Fusion. It looks like this will be really useful for my next scenario of having two different flavors of VM's running on my virtual network. The setup I want to get to is one where I can have "manager" host (to run provisioning, monitoring and other management applications) and cookie-cutter "worker" hosts (webservers, databases, etc). Ultimately, this setup will help me tool up for cloud platform operations; I have more Evil Plans there.

So all of this has me wondering: why doesn't VMware support this natively? Where's that menu option I was looking for? Is there an alternative to this hackery that I just overlooked?

         

( Mar 31 2009, 09:12:22 AM PDT ) Permalink
Comments [2]

Comments:

You can also use Virtualbox's command line tools to manage and clone images. This sets the new clone with a new UUID. I've done this with work images a few times. Virtualbox has a pretty nice repertoire of commandline options using the VBoxManage command line. Notably is the "clonevdi" command which clones an existing vdi file. You can also get the VMWare converter which appears to now run on Linux and Windows. If you want to create brand new default VMX files, check out http://www.easyvmx.com/. At some point, you may want to grow those images as well, Ian. VMware has ways of using their command line tools to grow virtual file systems. I grew a W2kPro virtual disk file and then booted the systemrescue CD thing and used ntfsresize to make it fill up the new larger partition. I've been dorking around with this on Virtualbox as well. Actually just finishing a project for work creating web-based vmware environments for our Sales Engineering group where I have a basic web page create, register, and start VM guests using VMware Server. That's been a lot of fun!

Posted by Michael Perry on April 01, 2009 at 08:30 AM PDT #

Good you got a discount! But you can do what you want without buying software licences. Download VMware Converter for free and create a virtual copy of an existing physical Windows machine. Then VirtualBox will read the VMware disk image(s). I have done this to run a clone of my work PC on my MacBook Pro at home.

Posted by Michael on April 01, 2009 at 08:30 AM PDT #

Post a Comment:

Comments are closed for this entry.