Initial Commit

Listen, Learn.

Build chroot environment on Debian

Posted at — Sep 22, 2009


The architecture is amd64, so some 32-bit applications could not work well, even with ia32 libs. One solution is to build 32-bit chroot environment. Not only for 32-bit, of course.

Follow the official tutorial.

make a directory to place the new system.

sid is the version, and /chroot is the directory created just now, and the mirror URL follows. Change the i386 into any architecture you like, e.g., amd64.

run ‘mount -a’ to mount. And other directories like $HOME can be mounted as you like.

Now, we can use

sudo chroot /chroot

to change the environment into /chroot

schroot is a more powerful tool to chroot.

sudo apt-get install schroot
sudo vi /etc/schroot/schroot.conf

uncomment the first part. change the users, groups, root-groups to your own.

now sudo is not needed any more.

There is a parameter, ‘-p’, which introduces the environment vars of the external system, while I prefer to configure the env vars myself.


The system should know which display to show the window. It prompts

unable to open display ""


export DISPLAY=":0.0"

sometimes it doesn’t work, please try

export DISPLAY="0:0"

I don’t know the reason, but it actually works on mine.

Then run

sudo gdmsetup

uncheck ‘Deny TCP connections to Xserver’ on the ‘Security’ tab.


xhost +localhost

to $HOME/.profile to make sure localhost is permitted to use X.

all files’ name should be put in /etc/schroot/copyfiles-defaults, extra files, like .vimrc, .bashrc, can be added on demand. Add


to schroot.conf. So that schroot will deal with the file copying, mounting, proc killing when logout, and so on.

All the scripts are located in /etc/schroot.ap