Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
You can't have both filesystem isolation and filesystem sharing. –  Ignacio Vazquez-Abrams Aug 5 '12 at 8:29
    
Would mounting the /home filesystem to a different schroot mount point do the trick ? –  Eric Aug 5 '12 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

with,

/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.
share|improve this answer
    
I would urge you to register your account so you don't lose your cookie again. Welcome to Super User! –  slhck Aug 8 '12 at 15:53

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.