Installation of Debian (based) Linux distributions in a folder (chroot)

From Whonix

Ambox warning pn.svg.png Documentation for this is incomplete. Contributions are happily considered!

Chroot Use Cases[edit]

Chroot Security[edit]

chroot is not a security feature [archive].




Quote Changing Roots [archive]:

  • systemd-nspawn tool which acts as chroot(1) on steroids

  • it makes use of file system and PID namespaces to boot a simple lightweight container on a file system tree.

  • It can be used almost like chroot(1), except that the isolation from the host OS is much more complete, a lot more secure and even easier to use

  • systemd-nspawn is capable of booting a complete systemd or sysvinit OS in container with a single command.

  • Booting of the container can take less than 3 seconds.


Can systemd-nspawn be made a secure jail? The following quote might be outdated and/or not reflect a "hardened container". Quote systemd lead developer [archive]:

Note however that this protects the host OS only from accidental changes of its parameters. A process in the container can manually remount the file systems read-writeable and then change whatever it wants to change.

What are these issues? Related to running root vs non-root inside the container? Can these security holes nowadays be closed?

Since we are inside a VM already, can containers be used for better security?

Quote systemd-nspawn man page [archive]:


Specify one or more additional capabilities to drop for the container. This allows running the container with fewer capabilities than the default (see above).

Quote [archive]

systemd-nspawn supports unprivileged containers,


, though the containers need to be booted as root.

That could be an OK limitation?

See also:

Exit systemd-nspawn[edit]

To leave the chroot press keep holding key CTRL and press key 5 quickly 3 times within 1 second. [1]

See Also[edit]

LXC[edit] [archive]


mmdebstrap is a tool that can be used to securely create chroots.

Using debootstrap is insecure at times such as if APT is vulnerable and the fixed package only available from APT repository not the regular Debian repository because it can use only 1 APT repository at a time. And does not include all packages created to create a chroot.

A secure alternative is mmdebstrap. [2] See also other advantages of mmdebstrap [archive].


  • xchroot [archive]: chroot for users with Xorg/X11 forwarding and automatic mounting + aufs/unionfs read only root support.


text=Jobs in USA
Jobs in USA

Search engines: YaCy | Qwant | ecosia | MetaGer | peekier | Whonix ™ Wiki

Follow: 1024px-Telegram 2019 Logo.svg.png Iconfinder Apple Mail 2697658.png Twitter.png Facebook.png Rss.png Reddit.jpg 200px-Mastodon Logotype (Simple).svg.png

Support: 1024px-Telegram 2019 Logo.svg.png Discourse logo.png Matrix logo.svg.png

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contriute

Whonix donate bitcoin.png Monero donate Whonix.png United Federation of Planets 1000px.png

Share: Twitter | Facebook

Interested in becoming an author for the Whonix ™ News Blog or writing about anonymity, privacy and security? Please get in touch!

https link onion link

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.

Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)

Whonix ™ is a derivative of and not affiliated with Debian [archive]. Debian is a registered trademark [archive] owned by Software in the Public Interest, Inc [archive].

Whonix ™ is produced independently from the Tor® [archive] anonymity software and carries no guarantee from The Tor Project [archive] about quality, suitability or anything else.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint, Contact.