-
Notifications
You must be signed in to change notification settings - Fork 9
Lxroot
lxroot
is a lightweight alternative to chroot
, Docker, and other software virtualization tools.
lxroot
allows a non-root user to easily and safely create a "chroot-style" virtual software environment (via Linux namespaces), and then run one or more programs (a "guest userland") inside that environment.
Introduction
If you are running Linux on x86_64
, then the quickest way to start using lxroot
is to use vland
. vland
is a convenience wrapper around lxroot
.
lxroot
can run any architecture. At present, vland
supports only x86_64
. vland
could certainly be extended to support other architectures.
The below commands will:
- download
vland
, - install Arch Linux on a guest named
arch-guest
, - install the
chromium
package on the guest, - run the
chromium
web browser on the guest.
Commands
$ wget https://github.com/parke/vland/raw/main/vland
$ /bin/sh vland --create arch arch-guest
$ /bin/sh vland --pkg arch-guest install chromium
$ /bin/sh vland arch-guest -nx -- chromium
vland
can also build, install, and run packages inside a guest. For example:
$ /bin/sh vland --pkg arch-guest build-install lua
$ /bin/sh vland arch-guest -- lua -v
These are just a few of lxroot
's many use cases.
The below table summarizes the Linux distributions that I have used as guests with vland
and lxroot
.
Guest distro | Can install as guest? | Can install packages? | Can build packages? |
---|---|---|---|
Alpine | yes | yes | yes |
Arch | yes | yes | yes |
Ubuntu | work in progress | work in progress | probably |
Void | yes | yes | probably |
Other Linux distributions may also work inside lxroot
. (Some level of custom shimming may be required.)
Due to lxroot
's safety, simplicity, efficiency, and ability to run without root access, lxroot
has a few limitations. These limitations may or may not affect your particular use case.