Quick VM installations

I like to use the vm-tools for quick VM cloning, but once in awhile i need to create a new VM from scratch. With vmbuilder being deprecated, I wanted something more convenient than manually installing from iso.

Based on some scripts by Scott Moser, I created this make_kvm_vm script.

It’s pretty specifically tailered to what I want. It uses (by default) my preseed which assumes that apt-cache-ng is installed on the host, so I can minimize my net traffic. It downloads the mini.iso for a specified release, extracts the kernel and initrd, then runs kvm with a boot append line specifying to use my preseed to install a minimal server. Example usage:

make_kvm_vm -d ~/new-o-vm1.iso

By default it installs oneiric (‘-r lucid’ to specify) and forms the iso and virtual disk name based on the specified release (i.e. $HOME/$release.img and http://archive.ubuntu.com/ubuntu/dists/$release/main/installer-amd64/current/images/netboot/mini.iso.

Note! Vmbuilder has the advantage over this script in that it never requires running kvm, so can be run anywhere. But this script serves me well.

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Quick VM installations

  1. Yann says:

    Hello! Any idea why vmbuilder is being deprecated, and in favour of what? I’ve been using it with success for years…

    • s3hh says:

      An excellent question. Check here: https://blueprints.launchpad.net/ubuntu/+spec/server-o-drop-vmbuilder and http://pad.ubuntu.com/uds-o-server-o-drop-vmbuilder

      I agree it’s awesome and to this day works quite well. It just comes down to maintenance: there is very little support from the community, yet people want support for all sorts of use cases. I’d love to have time to address all the open bugs, but I simply do not 😦

      At the same time, there are newer actively maintained projects like live-build. So the above blueprint for last UDS was to ask the community whether vmbuilder should continue to be maintained, or whether we should move to the new tools. The concensus there was to move on.

      Of course the great thing about open source is that if anyone wants to come by and start fixing bugs, then it’s maintained 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s