When schroot is configured to mount /home, will packages installed inside the chroot overwrite the configuration files in $HOME?

For example, if a newer version of gconf2 is installed inside the chroot, will it overwrite $HOME/.gconf? Is there a way to prevent this, while maintaining access to /home?

  • You can't have both filesystem isolation and filesystem sharing. Commented Aug 5, 2012 at 8:29
  • Would mounting the /home filesystem to a different schroot mount point do the trick ?
    – Eric
    Commented Aug 5, 2012 at 12:46

1 Answer 1


When /home is mounted by schroot, all configuration files are placed in $HOME of the base install, irrespective of whether they belong to the schroot.

This can lead to configuration files being overwritten when two versions of a package are installed, one in the base install and the other in the schroot.

It's easy to alter the schroot setup so that its configuration files are placed in a different directory, as shown in the following example.

A schroot for wheezy-amd64 is located in /var/schroot/wheezy-amd64. This particular schroot is using the 'desktop' profile, hence its mount points are defined in /etc/schroot/desktop/fstab.

First, create a home directory for the user inside the schroot,

mkdir /var/schroot/wheezy-amd64/home/$USERNAME

Second, replace the following line in /etc/schroot/desktop/fstab,

/home          /home           none    rw,bind         0       0


/home          /HOME           none    rw,bind         0       0

That's all! It's also convenient to add an alias to ~/.bash_aliases in the base install,

alias wheezy64='schroot -c wheezy-amd64 `/bin/echo "-d $PWD" | /bin/grep "^-d[ ]*\/home" | sed "s/home/HOME/"`'

Inside the schroot, the user now sees two home directories:

  • /home/$USERNAME is the schroot home directory.
  • /HOME/$USERNAME is the home directory of the base install.
  • I would urge you to register your account so you don't lose your cookie again. Welcome to Super User!
    – slhck
    Commented Aug 8, 2012 at 15:53

You must log in to answer this question.

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