Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I realize that setting up pbuilder requires root privileges, but does each invocation really require root privileges?

Is there any way of running pbuilder as a standard user?

share|improve this question
up vote 7 down vote accepted

Yes, copied from: pbuilder.

It is possible to use user-mode-linux by invoking pbuilder-user-mode-linux instead of pbuilder. pbuilder-user-mode-linux doesn't require root privileges, and it uses the copy-on-write (COW) disk access method of User-mode-linux which typically makes it much faster than the traditional pbuilder.

User-mode-linux is a somewhat less proven platform than the standard Unix tools which pbuilder relies on (chroot, tar, and gzip) but mature enough to support pbuilder-user-mode-linux since its version 0.59. And since then, pbuilder-user-mode-linux has seen a rapid evolution.

The configuration of pbuilder-user-mode-linux goes in three steps:

  1. Configuration of user-mode-linux

    user-mode-linux isn't completely trivial to set up. It would probably be useful to acquaint yourself with it a bit before attempting to use rootstrap or pbuilder-user-mode-linux. For details, read /usr/share/doc/uml-utilities/README.Debian and the user-mode-linux documentation. (It's in a separate package, user-mode-linux-doc.)

    user-mode-linux requires the user to be in the uml-net group in order to configure the network unless you are using slirp.

    If you compile your own kernel, you may want to verify that you enable TUN/TAP support, and you might want to consider the SKAS patch.

  2. Configuration of rootstrap

    rootstrap is a wrapper around debootstrap. It creates a Debian disk image for use with UML. To configure rootstrap, there are several requirements.

    • Install the rootstrap package.
    • TUN/TAP only: add the user to the uml-net group to allow access to the network adduser dancer uml-net
    • TUN/TAP only: Check that the kernel supports the TUN/TAP interface, or recompile the kernel if necessary.
    • Set up /etc/rootstrap/rootstrap.conf. For example, if the current host is, changing following entries to something like this seems to work.


    Some experimentation with configuration and running rootstrap ~/test.uml to actually test it would be handy.

    Using slirp requires less configuration. The default configuration comes with a working example.

  3. Configuration of pbuilder-uml

    The following needs to happen:

    • Install the pbuilder-uml package.
    • Set up the configuration file /etc/pbuilder/pbuilder-uml.conf in the following manner. It will be different for slirp.

    • It needs to match the rootstrap configuration.

    • Make sure BUILDPLACE is writable by the user. Change BUILDPLACE in the configuration file to a place where the user has access.
    • Run pbuilder-user-mode-linux create --distribution sid to create the image.
    • Try running pbuilder-user-mode-linux build.

Extra comments in the link:

pbuilder-user-mode-linux emulates most of pbuilder, but there are some differences.

  • pbuilder-user-mode-linux does not support all options of pbuilder properly yet. This is a problem, and will be addressed as specific areas are discovered.
  • /tmp is handled differently inside pbuilder-user-mode-linux. In pbuilder-user-mode-linux, /tmp is mounted as tmpfs inside UML, so accessing files under /tmp from outside user-mode-linux does not work. It affects options like --configfile, and when trying to build packages placed under /tmp.

To run pbuilder-user-mode-linux in parallel on a system, there are a few things to bear in mind.

  • The create and update methods must not be run when a build is in progress, or the COW file will be invalidated.
  • If you are not using slirp, user-mode-linux processes which are running in parallel need to have different IP addresses. Just trying to run the pbuilder-user-mode-linux several times will result in failure to access the network. But something like the following will work:


share|improve this answer
+1 - Excellent answer! – Nathan Osman Jul 23 '11 at 18:09
If Slirp works out of the box and doesn’t require root (for writing to /etc and adding your user to a group) to set up, why would anyone not use Slirp for this? – Mechanical snail May 25 '13 at 3:38

Your Answer


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.