10

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?

3

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.

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

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:

NAME  
       vmbuilder - builds virtual machines from the command line  

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

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

       <distro>      Distribution. Valid options: ubuntu  

DESCRIPTION  
       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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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