How to create and export a vmware image using vmbuilder

I've been using vmbuilder to build kvm images as such:

vmbuilder kvm ubuntu \
-v \
--suite=precise \
--libvirt=qemu:///system \
--arch=amd64 \
--cpus=2 \
--mem=1024 \
--swapsize=1024 \
--rootsize=10240 \
--flavour=server \
--hostname=hostnamehere \
--ip=X.X.X.X \
--net=X.X.X.X \
--bcast=X.X.X.X \
--gw=X.X.X.X \
--dns='X.X.X.X X.X.X.X' \
--bridge=br0 \
--mirror=http://archive.ubuntu.com/ubuntu \
--components='main,universe' \
--dest=/vmname \
--tmpfs=-


However recently I had a request to build a VMWare image and although I have done such in the past using several VMWare tools I have recently read that this can also be achieved using vmbuilder, how would I go about creating a vmware image that I can give to my client and he can import to VMWare?

Also I'd need to add a second disk to the image, how can I add another vmdk?

-

Although there are scripts available that can supposedly convert them, I don't trust them so I will show you the manual route here

The easiest way to do this is using QEMU directly. Power down the guest, then run the qemu-img -O vmdk /path/to/guest/disk /path/to/new/disk.vmdk command to convert the disk format (see below).

Next, use virsh dumpxml vmname to dump out an XML description of the guest.

Now, when creating a new VM in vSphere Client, just try and make the hardware at least as close as possible to the XML, and instead of creating a new disk image, just add the vmdk generated by the qemu-img command above.

This should do what you want

qemu Version Problems

Running these commands on Ubuntu 12.04 will give you no end of confusing version problems. In my experience, 1.5.3 gives good results. Follow the instructions here (obviously changing the order and commands to match your situation), if you get stuck.

-