[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: X11 clients in chroot


Cyril Brulebois <kibi@debian.org> writes:
> No need to mess around with xhost…

Indeed. My recipe is

$ curl http://lindi.iki.fi/lindi/schroot.txt
1) sudo apt-get install debootstrap schroot
2) sudo mkdir /sid
3) sudo debootstrap sid /sid http://ftp.fi.debian.org/debian
4) Add the following to /etc/schroot/schroot.conf

description=Debian sid (unstable)

where user1 and user2 are users that are allowed to use the chroot
(change them!).

5) Add the following to /etc/fstab

/home                 /sid/home                none bind 0 0
/dev                  /sid/dev                 none bind 0 0
/dev/pts              /sid/dev/pts             none bind 0 0
/dev/shm              /sid/dev/shm             none bind 0 0
/proc                 /sid/proc                none bind 0 0
/sys                  /sid/sys                 none bind 0 0
/tmp                  /sid/tmp                 none bind 0 0
/var/run/dbus         /sid/var/run/dbus        none bind 0 0
/var/lib/dbus         /sid/var/lib/dbus        none bind 0 0

5.1) sudo mkdir /sid/var/run/dbus
5.2) sudo mkdir /sid/var/lib/dbus

6) sudo mount -a

7) sudo cp /etc/sudoers /etc/hosts /etc/hostname /etc/passwd /etc/shadow
/etc/group /sid/etc

8) Create /usr/local/bin/sid with the following lines

schroot -c sid -p -q -- "$@"

8.1) sudo chmod a+x /usr/local/bin/sid

9) Create /sid/usr/sbin/policy-rc.d to prevent daemons from starting
accidentally inside the chroot with the following lines

logger "sid $0 invoked with $@"
exit 101

9.1) sudo chmod a+x /sid/usr/sbin/policy-rc.d

10) (just an example) sudo sid apt-get install openoffice.org

11) (just an example) sid openoffice.org

> Running gdm3 maybe? In which case, that brain-damaged thing stores
> ~/.Xauthority under the (/var)/run directory…

Yep you need 

/var/run/gdm3         /sid/var/run/gdm3        none bind 0 0


Reply to: