Jump to content
Read the Funtoo Newsletter: Summer 2023 ×

LXC fun

Recommended Posts

Before asking my list of questions, first some back ground info:

Since earlier this year I work for a thrift shop-chain. Part of my job (for 2 days/week) is running the PC refurbishment project. When I first joined this project Linux Mint was used to install a new OS on refurbished computers. Trust me, systemd on a P4 is a disaster. But who wants systemd anyway ;)  So after a while I came across some nice professional network hardware (Gbit managed switches, several) and using an Intel Core 2 machine I created a local network w/o internet access. I also took the decision to change the OS to Devuan Linux with the MATE DE, as the intended audience/user-base are novice Linux users. To this aim I maintain a local repo of Devuan, updated weekly via a portable HDD drive. In the near future a new fiber-optic internet connection will be activated, but as its speed cannot match what I have now to transfer large chunks of data (sorry, packages ;) ) I'll keep the local repo in use for the time being. But the updating process will need some overhauling, having to log around with heavy USB drives is getting quite tedious now.


So, with the upcoming access to high-speed internet I've obtained permission to connect to the to-be-launched wifi network during the night to update said repo. But I also would like to have a local Funtoo repo on the same machine, equally updated during the night. This means I need at least 2 virtual machines and from reading my way around, it seems Linux Containers may do what I want: run a Funtoo base system, with a pair for virtual machines on top, one running Funtoo and the other Devuan, each updating itself during the night before switching off again. (I'll be writing some scripts for that, but first getting to grips with LXC!) Is this possible, how do I proceed (the replacement server already has a fresh Funtoo 1.2 install on it) and how do I create my own containers as I'm aware there's nothing for Devuan nor the Core2 metal the server runs on (Funtoo only supports Westmere so far, by the looks of it).



Link to comment
Share on other sites


there is also lxd-p2c tool:

lxd-p2c -h
  Physical to container migration tool

  This tool lets you turn any Linux filesystem (including your current one)
  into a LXD container on a remote LXD host.

  It will setup a clean mount tree made of the root filesystem and any
  additional mount you list, then transfer this through LXD's migration
  API to create a new container from it.

  The same set of options as `lxc launch` are also supported.

  lxd-p2c <target URL> <container name> <filesystem root> [<filesystem mounts>...] [flags]

  -c, --config        Configuration key and value to set on the container
  -h, --help          Print help
  -n, --network       Network to use for the container
      --no-profiles   Create the container with no profiles applied
  -p, --profile       Profile to apply to the container
      --rsync-args    Extra arguments to pass to rsync
  -s, --storage       Storage pool to use for the container
  -t, --type          Instance type to use for the container
      --version       Print version number


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...