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'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?

share|improve this question

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.

share|improve this answer
    
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

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.

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.