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

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?

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!

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.

Technorati

Who?

I'm Ian Kallen. I'm an entrepreneur and technologist working on Blockboard. My technical interests are focused on mobile, location, cloud computing, big data, real time event systems, search, devops and agile web application code. I'm a long time open source enthusiast and enjoy right-sizing code architecture and infrastructure with the scope and stage a technology startup is operating at.

Previously, I was an independent technology consultant. Prior to that, I did a long stint with Technorati leading the Core Services engineering group in architecting a backend to support search and exploring the web as it changes in real time. I have an eclectic background in technology, publishing, social software and ... life. I like to think: well rounded. I have been online participating in virtual communities since 1988 and developing online resources, services and systems as well as enterprise software since 1991. Once in a while, I have time and inspiration to blog.

The views expressed here are not necessarily those of any present or past employers.
KTHXBAI