Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| lxc_openwrt_host [2021/09/19 08:41] – finish copying post and formatting it darksky2 | lxc_openwrt_host [2021/09/22 08:05] – [Setup on the OpenWRT host] darksky2 | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| | tbd | s390x| | | tbd | s390x| | ||
| - | ===== Example using OpenWRT ARM64 MVEBU ESPRESSOBIN et ESPRESSOBIN ULTRA ===== | + | ===== Example |
| - | ==== Install some necessary tools ==== | + | This example was using OpenWRT ARM64 MVEBU ESPRESSOBIN et ESPRESSOBIN ULTRA. It has also been verified on a OpenWRT aarch64 Raspberry Pi4 B. |
| - | < | + | |
| - | ==== Install some necessary kernel modules | + | [[https:// |
| + | ==== Setup on the OpenWRT host ==== | ||
| + | Install some necessary tools and prerequisites: | ||
| + | < | ||
| + | Install the needed kernel modules: | ||
| < | < | ||
| - | ==== Install | + | Install |
| - | < | + | < |
| - | ==== Install all lxc stuff ==== | + | FIXME: Note that getopt should be a package dependency, see: [[https:// |
| - | < | + | |
| - | ==== Check your kernel config | + | Additional packages exist that can add functionality but that aren't strictly required. |
| - | < | + | < |
| + | |||
| + | FIXME: Note that until [[https:// | ||
| + | |||
| + | Edit ''/ | ||
| + | < | ||
| + | |||
| + | Optionally check the kernel config | ||
| + | < | ||
| + | # lxc-checkconfig | ||
| LXC version 4.0.5 | LXC version 4.0.5 | ||
| --- Namespaces --- | --- Namespaces --- | ||
| Line 89: | Line 100: | ||
| usage : CONFIG=/ | usage : CONFIG=/ | ||
| - | ==== Create a LXC container | + | In order to download distro images |
| - | < | + | - Use a keyserver on the host which requires additional setup, or |
| - | Setting up the GPG keyring | + | |
| - | ERROR: Unable | + | |
| - | lxc-create: myLMS: lxccontainer.c: | + | |
| - | lxc-create: myLMS: tools/ | + | |
| - | + | ||
| - | ==== Fix the Unable to fetch GPG key from keyserver ==== | + | |
| - | There are two possible solutions to this. | + | |
| - | - Use a keyserver on the host | + | |
| - Disable validation (not recommended) | - Disable validation (not recommended) | ||
| - | === 1. Use a keyserver on the host ==== | + | To verify signature of the images, we need to install some additional packages which can be remove after the guest is setup: |
| + | < | ||
| - | < | + | Alternatively, |
| - | root@ultra: | + | |
| - | Setting | + | |
| - | Downloading the image index | + | |
| - | Downloading the rootfs | + | |
| - | Downloading the metadata | + | |
| - | The image cache is now ready | + | |
| - | Unpacking the rootfs | + | |
| - | </ | + | |
| - | === 2. Disable gpg validation === | + | Example: |
| - | < | + | < |
| - | Downloading the image index | + | |
| - | WARNING: Running without gpg validation! | + | |
| - | Downloading the rootfs | + | |
| - | Downloading the metadata | + | |
| - | The image cache is now ready | + | |
| - | Unpacking the rootfs | + | |
| - | --- | + | ==== Create |
| - | You just created | + | There are many different distros available for installation. |
| + | < | ||
| - | To enable SSH, run: apt install openssh-server | + | This guide will use Debian Buster selected |
| - | No default root or user password are set by LXC.</ | + | |
| - | ==== List container and status | + | < |
| + | Setting up the GPG keyring | ||
| + | ERROR: Unable to fetch GPG key from keyserver | ||
| + | lxc-create: myLMS: lxccontainer.c: | ||
| + | lxc-create: myLMS: tools/ | ||
| + | |||
| + | ==== Container management | ||
| + | |||
| + | To list the installed containers and query their status, use **lxc-ls**: | ||
| < | < | ||
| NAME STATE | NAME STATE | ||
| myLMS STOPPED 0 | myLMS STOPPED 0 | ||
| - | ==== Starting the container ==== | + | Start and stop containers with **lxc-start** and **lxc-stop** respectively: |
| < | < | ||
| root@ultra: | root@ultra: | ||
| Line 139: | Line 138: | ||
| myLMS RUNNING 0 | myLMS RUNNING 0 | ||
| - | ==== Stopping the container ==== | ||
| < | < | ||
| root@ultra: | root@ultra: | ||
| Line 145: | Line 143: | ||
| myLMS STOPPED 0 | myLMS STOPPED 0 | ||
| - | ==== Networking | + | Setup networking |
| < | < | ||
| ... | ... | ||
| Line 154: | Line 152: | ||
| lxc.net.0.flags = up | lxc.net.0.flags = up | ||
| lxc.net.0.hwaddr = 00: | lxc.net.0.hwaddr = 00: | ||
| + | |||
| + | Optionally mount a share from the OpenWRT host inside the guest | ||
| + | Make sure to create the path to the share in the container, then edit the container config adding the following line: | ||
| + | < | ||
| + | |||
| ==== Setup the containerized guest distro ==== | ==== Setup the containerized guest distro ==== | ||
| Line 183: | Line 186: | ||
| ==== Auto start the container on OpenWRT host ==== | ==== Auto start the container on OpenWRT host ==== | ||
| - | < | + | < |
| + | uci show lxc-auto | ||
| uci add lxc-auto container | uci add lxc-auto container | ||
| uci set lxc-auto.@container[-1].name=myLMS | uci set lxc-auto.@container[-1].name=myLMS | ||