Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 \
    --mask=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' \
    --addpkg=openssh-server,acpid \
    --user=username \
    --pass=password \
    --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?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.