Difference between revisions of "Systemd-nspawn"

From ArchWiki
Jump to: navigation, search
(Created page with "Quick guide on how to create a lightweight systemd container for Arch Linux, using systemd-nspawn and pacstrap, in under 1 minute! <pre> pacman -S arch-install-scripts mkdir ...")
 
Line 15: Line 15:
 
pacman -Rsn linux
 
pacman -Rsn linux
 
</pre>
 
</pre>
 +
 +
Once you're done with the container just shut it down with <tt>poweroff</tt>

Revision as of 10:32, 7 February 2013

Quick guide on how to create a lightweight systemd container for Arch Linux, using systemd-nspawn and pacstrap, in under 1 minute!

pacman -S arch-install-scripts
mkdir /srv/subarch
time pacstrap -c -d /srv/subarch base
systemd-nspawn -bD /srv/subarch

And that's it! Log in as "root" with no password.

You can remove the kernel to save space within the container. DO NOT RUN THIS ON THE HOST!

pacman -Rsn linux

Once you're done with the container just shut it down with poweroff