-
Notifications
You must be signed in to change notification settings - Fork 1
tutorial
- Basic usage
- Install and build packages
Introduction
- Tutorial 1 shows how to install
vland. -
vlandis a Dash shell script. - At present,
vlandonly supportsx86_64Linux systems.
Commands
$ wget https://github.com/parke/vland/raw/main/vland
$ chmod +x ./vland
$ ./vland --help
Commentary
- Line 1 downloads the
vlandshell script. - Line 2 makes the script executable.
- Line 3 prints out
vland's help message. - Optional: You may copy
vlandinto yourPATH, if you wish.
Introduction
- Tutorial 2 continues from the end of tutorial 1.
-
vlandcontains a built-in self-test. - Tutorial 2 is optional. Feel free to skip ahead to tutorial 3.
- However, if
vlandseems to be having problems, you may wish to run the self-test, as described below. - The self-test will create the directory "$HOME/vland" and will write 901MB of files inside "$HOME/vland".
Commands
$ ./vland --self-test
Commentary
vland's self test will attempt to do the following:
- Install Alpine Linux into a userland named
vland-self-test. - Install
vlanditself insidevland-self-test. - Run
vlandinsidevland-self-testto install a nested Arch Linux userland inside thevland-self-testuserland. - Then finally run ...
- ... (on your host) a child
vlandprocess to run: - ... (in
vland-self-test) a grandchildvlandprocess to run: - ... (in the nested Arch userland) an interactive (simulated root) shell.
- ... (on your host) a child
If vland's self test fails, please consider submitting a bug report on Github.
If the self-test works, you should see a bunch of output, and then, after (probably) 30 to 120 seconds, something like the below:
----------------------------------------------------------------
vland --self-test now launching interactive root shell ...
----------------------------------------------------------------
+ /bin/sh /home/user/vland vland-self-test -n -- vland arch -nr
+ exec lxroot /home/user/vland/land/vland-self-test /home/user/vland/over/vland-self-test -n -- vland arch -nr
+ exec /home/user/vland/dist/bin/lxroot-x86 /home/user/vland/land/arch /home/user/vland/over/arch -nr
root -nr ./arch ~
Introduction
- Tutorial 3 continues from the end of tutorial 1.
Commands
$ ./vland --create arch
$ ./vland arch -nr
# pwd
# id
# cat /etc/issue
# uname -a
# exit
Commentary
- Line 1 creates a userland named
arch. - Line 1 also installs Arch Linux in the
archuserland. - Typically, the userland will be created at
$HOME/vland/land/arch. - Fyi, the full syntax of
--createis:vland --create distro [userland] [overlay] - If
lxrootand/oraria2care not installed on the host, thenvlandwill automatically download and use static builds of each.
Introduction
- Tutorial 4 continues from the end of tutorial 3.
Commands
$ ./vland arch -nr -- pacman -Syu chromium
Commentary
-
./vland archtells vland to run a command inside thearchguest -
-ngrants network access -
-rsimulates uid = 0 (root) -
--precedes the command - The command
pacman -Syu chromiumwill be run inside thearchguest.
Introduction
- Tutorial 5 continues from the end of tutorial 4.
Commands
$ ./vland arch -nx -- chromium
Commentary
-
./vland archtells vland to run a command inside thearchguest -
-ngrants network access -
-xgrants the guest access to the host's Xorg server -
--precedes the command - The command
chromiumwill be run inside thearchguest.
Introduction
- For certain downloads,
vlanduses thearia2cdownload utility. - If
aria2cis not installed on the host system,vlandwill download a static bulid ofaria2c. - Tutorial 11 shows how I use
vlandto create a static build ofaria2c.
Commands
$ wget TODO
$ /bin/sh aria2c-static.sh --run
$ ls -lh
Commentary
- Line 1 downloads my
aria2c-static.shscript. - Line 2 runs my
aria2c-static.shscript. This script:- installs vland
- installs a Void Linux userland
- builds custom versions of key libraries
- builds a static build of
aria2c
-
vlanditself creates and configures guest userlands. - However, to actually execute a program inside a guest userland,
vlanduses a separate tool called Lxroot. - You may, if you wish, learn about Lxroot by reading the Lxroot tutorial.
The below package building tutorials depend on features that are not available in the published version of vland. This is because: I am simultaneously developing the features and writing the below tutorials. Soon, I hope to publish an updated version of vland.
vland can install and build Alpine Linux packages, as follows:
Commands
./vland --alpine-pkg-install overlay [guest] [-- package ...]
./vland --alpine-pkg-build overlay [guest] [-- package ...]
./vland --alpine-pkg-build-install overlay [guest] [-- package ...]
In each of the above commands:
- If
guestis not specified, then theoverlay's default guest will be used. - If the
overlayand/orguestdo not exist, then they will be created. - If the operation is a
buildoperation, then theoverlayandguestwill be configured for building packages. - Zero or more
packagesmay be specified. - If you specify a
buildoperation with zero packages, then theoverlayandguestwill still be configured for building packages. This can be convenient if you wish to build packages manually. - If one or more
packagesare specified, then the specified packages will be built and/or installed as described in the following table of operations.
| Operation | Action |
|---|---|
--alpine-pkg-install |
Install the specified packages on the specified guest. |
--alpine-pkg-build |
Build the specified packages on the specified overlay and guest. |
--alpine-pkg-build-install |
Build and then install the specified packages on the specified overlay and guest. |
Additional notes, just fyi:
- Installing packages will make changes to the
guest, but not (at least typically) to theoverlay. - Building packages will make changes to the
overlay, as packages are built in$HOME/vland-build. - Building packages will also make changes to the
guestif any build-time dependencies need to be installed.
vland can install and build Arch Linux packages, as follows:
Commands
./vland --arch-pkg-install overlay [guest] [-- package ...]
./vland --arch-pkg-build overlay [guest] [-- package ...]
./vland --arch-pkg-build-install overlay [guest] [-- package ...]
./vland --arch-aur-build overlay [guest] [-- package ...]
./vland --arch-aur-build-install overlay [guest] [-- package ...]
In each of the above commands:
- If
guestis not specified, then theoverlay's default guest will be used. - If the
overlayand/orguestdo not exist, then they will be created. - If the operation is a
buildoperation, then theoverlayandguestwill be configured for building packages. - Zero or more
packagesmay be specified. - If you specify a
buildoperation with zero packages, then theoverlayandguestwill still be configured for building packages. This can be convenient if you wish to build packages manually. - If one or more
packagesare specified, then the specified packages will be built and/or installed as described in the following table of operations.
| Operation | Action |
|---|---|
--arch-pkg-install |
Install the specified packages on the specified overlay (and guest). |
--arch-pkg-build |
Build the specified packages on the specified overlay (and guest). |
--arch-pkg-build-install |
Build and then install the specified packages on the specified overlay (and guest). |
--arch-aur-build |
Build the specified AUR packages on the specified overlay (and guest). |
--arch-aur-build-install |
Build and then install the specified AUR packages on the specified overlay (and guest). |
Additional notes, just fyi:
- Installing packages will make changes to the
guest, but not (at least typically) to theoverlay. - Building packages will make changes to the
overlay, as packages are built in$HOME/vland-build. - Building packages will also make changes to the
guestif any build-time dependencies need to be installed.