Debian based container on Fedora 24 with systemd-nspawn

Hello everybody,

I usually use docker or systemd-nspawn for do container stuff, both are so good, but this time we will use systemd-nspawn because it can generate a x86 environment on x86_64 architectures. This feature is important to run some programs packet on dot deb format and/or  are available only in  x86 architecture.

Now install and setup systemd- nspawn, we will create a Debian GNU/Linux based container:

$ sudo dnf -y install systemd-container debootstrap
$ mkdir debian
$ sudo debootstrap --arch=i386 testing ./debian

Some time later… configure debian container root password,

$ sudo systemd-nspawn --directory=./debian passwd

<username> will be replaced with the user name as you wish

$ sudo systemd-nspawn --directory=./debian useradd <username>
$ sudo systemd-nspawn -D ./debian apt-get update
$ sudo systemd-nspawn -D ./debian apt-get install default-jre ssh iceweasel

Booting container,logging as root and install iceweasel. Note: you need to replace ~/Downloads with the directory path where you downloaded your “program of interest”.

$ sudo systemd-nspawn -bD ./debian --bind ~/Downloads:/mnt:rbind 

Now we are inside the ontainer:

test@debian~$ export DISPLAY=:0 && iceweasel

Screenshot from 2016-07-10 10-30-03
To exit use shutdown the container as a normal debian system or kill holding Ctrl and rapidly press ] three times

As Cultural breviary, iceweasel is now firefox again, see the old notice here.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.