This article explains how to install and use debian based chroots.

In a first step you need to install a chroot in a prefix of your choice:

debootstrap stretch ./stretch-chroot
#for ubuntu releases use the line below
#debootstrap --arch=amd64 xenial ./xenial-chroot

This will install the debian stretch release into the stretch-chroot directory. Depending on the internet connection it might take a few minutes. When the installation is complete you can boot the container using the following command:

 systemd-nspawn -b -D ./stretch-chroot

You will be able to escape the container pressing ctrl+]

Using chroots can be used to tests different releases of a software without keeping a real installation of several operating systems around. Using systemd-nsapwn will allow you to fully boot the guest systems. This is not possible with some container systems like docker, even though the same underlying technology is used (at least on linux)

apt-get install systemd-container debootstrap


Leave a Reply

Your email address will not be published. Required fields are marked *