Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-user:virtualization:lxc [2021/08/09 09:09] – [Installing via image (amd64 only)] describe upgrading process xorbugdocs:guide-user:virtualization:lxc [2024/07/28 00:56] (current) – Grammar and spelling memicinn19
Line 1: Line 1:
 ====== OpenWrt in LXC containers ====== ====== OpenWrt in LXC containers ======
  
-OpenWrt can run inside LXC container, using the same kernel as running on the host system. This can be useful for development as well as for VM hosting.+OpenWrt can run inside an LXC container, using the same kernel as running on the host system. This can be useful for development as well as for VM hosting.
  
 ===== Privileged vs Unprivileged ===== ===== Privileged vs Unprivileged =====
Line 9: Line 9:
 ===== Basic Overview ===== ===== Basic Overview =====
  
-The following gives a rough idea on how to get things up and running. Before anything, install LXC on the host machine and make sure it supports running unprivileged containers. You will likely also need bridge functionality and/or additional underlying related subsystems ( macvlan etc. ) if used. +The following gives a rough idea on how to get things up and running. Before anything, install LXC on the host machine and make sure it supports running unprivileged containers. You will likely also need bridge functionality and/or additional underlying related subsystems (macvlanetc.) if used. 
  
-==== Installing via image (amd64 only) ==== +==== Installing via image ==== 
-For the //amd64// architecture only (as of June 2021), the //download// template allows to retrieve an OpenWrt image from the [[https://images.linuxcontainers.org/|remote mirror]].+For some (//amd64//, //arm//...architectures, the //download// template allows to retrieve an OpenWrt image from the [[https://images.linuxcontainers.org/|remote mirror]].
 To create the OpenWrt container, just do: To create the OpenWrt container, just do:
 <code>lxc-create -n <container_name> -t download -- -d openwrt -a amd64</code> <code>lxc-create -n <container_name> -t download -- -d openwrt -a amd64</code>
-and spell the release you want to install when asked to. For any error related to fetching the GPG key, just export DOWNLOAD_KEYSERVER to a different key server and retry, e.g.:  +and spell the release you want to install when asked to. For any error related to fetching the GPG key, just specify a different keyserver (e.g. keyserver.ubuntu.com) by either setting ''DOWNLOAD_KEYSERVER'' or appending the ''--keyserver'' option.
-<code>export DOWNLOAD_KEYSERVER=keyserver.ubuntu.com</code>+
  
-The container will be created according to your default LXC config files (unless you use ''--config'' to specify a different config), so you may probably want to customize it further (e.g. add network interfaces or mount points) by modifying the final config in the container directory (see //lxc.container.conf(5)// man page).+The container will be created according to your default LXC config files (unless you use ''--config'' to specify a different config), so you may probably want to customize it further (e.g. add network interfaces or mount points) by modifying the final config in the container directory (see //lxc.container.conf(5)// man page). Depending on your setup, you may need to ''attach'' and temporarily give a fixed IP address to the relevant interface in order to establish the first connection.
  
 === Upgrading to the latest release === === Upgrading to the latest release ===
 Once a new release becomes available, as announced by the OpenWrt team, you can install and migrate to it: Once a new release becomes available, as announced by the OpenWrt team, you can install and migrate to it:
-  - install the new release image as above (it will tipically be available within the next day)+  - install the new release image as above (it will typically be available within the next day)
   - replace the new container's config file with the old one (remember to edit relevant options if needed e.g. the rootfs path, the host name, the autostart flag...)   - replace the new container's config file with the old one (remember to edit relevant options if needed e.g. the rootfs path, the host name, the autostart flag...)
   - backup the settings of the currently running OpenWrt as you would usually do, and shut it down   - backup the settings of the currently running OpenWrt as you would usually do, and shut it down
-  - start the new container and restore OpenWrt settings (you may first need to ''attach'' and temporarily give it a fixed IP address to establish the connection)+  - start the new container and, if it's safe to do so (as it usually is for minor releases), restore OpenWrt settings from backup
  
-Alternatively, some other upgrade methods may include the use of the official images from the x86 download page.+Note: if you are still getting the previous image after more than 24h since the new release (images are currently built daily by lxc), chances are an old cached image is being used. In this case, you can delete the old image by appending the ''--flush-cache'' option to the command.
 ==== Installing via rootfs extraction ==== ==== Installing via rootfs extraction ====
 For all other architectures, some manual steps are required: For all other architectures, some manual steps are required:
  • Last modified: 2021/08/09 09:09
  • by xorbug