I'd like to create a virtual instance of the latest LTS so I can test the software I'm writing in a way that more closely matches our production environment.

There seem to be many, many different ways of doing this: use debootstrap with schroot; use debootstrap with dchroot; use mk-sbuild... And pages like https://wiki.ubuntu.com/DebootstrapChroot have multiple options, and must surely have been replaced by small shell scripts by now.

How should I do this?

2 Answers 2


The package pbuilder is exactly what you need. It will allow you to construct a chroot environment, build and install your package. Even a pbuilder-cross variety exists. It is a set of command line tools, so no virtual machine point and click required. After a steep but short learning curve, you can probably automate building different architectures and distribution revisions.

  • Thanks. I ended up using sbuilder. I still don't really know why one would be preferred over the other, though.
    – jml
    Feb 10, 2012 at 17:17

On my command line, I typed man -k virtual, and found vmbuilder (dpkg -S vmbuilder shows it's in the python-vm-builder package. man vmbuilder says:

       vmbuilder - builds virtual machines from the command line  

       vmbuilder <hypervisor> <distro> [OPTIONS]...  

       <hypervisor>  Hypervisor image format. Valid options: xen kvm vmw6 vmserver  

       <distro>      Distribution. Valid options: ubuntu  

       This  manual page documents the vmbuilder command.  vmbuilder is a program that builds virtual machines from the command  
       line, but can have other interfaces implemented through its plugin mechanism. You can pass command line options  to  add  
       extra  packages,  remove  packages,  choose which version of Ubuntu, which mirror etc. On recent hardware with plenty of  
       RAM, tmpdir in /dev/shm or using a tmpfs, and a local mirror (see apt-proxy or apt-mirror), you can bootstrap  a  vm  in  
       less than a minute.  

Note: I don't use this package, so YMMV.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .