but it's not clear which are accurate, up-to-date etc.
I tried with Ulli's instructions, but that resulted in a non-booting instance (quite possibly because I did something wrong), seems to duplicate some configuration that's built-in, and seems to have some unique external dependencies.
I then tried Emanuelis's method, but that looks incomplete, at least by comparison.
So I ended up with elements from each.
There is also the question about what networking configuration to use.
My hosting provider has some
for fully bridged setups, and recommend
If you use an internal bridge, you can either configure a traditional subnet,
or use point-to-point transfer links using RFC1918 addresses (see this description by Marc Haber).
When I initially tried the latter, I found that I needed to specify "scope link" on the internal link
(and use "pinpoint" in /etc/network/interfaces)
or specify an explicit "src" on the default route to make sure that the packets were sent from the
public IP rather than the internal link IP (see these notes).
Then it worked well. This scheme is appealing in that
you don't waste IP addresses to the controlling host and subnet broadcast, and there's something satisfying
about plumbing explicit links. But, it does make the network layout look more
complex (for things like ip addr list, ip route list, and outbound traceroute),
and complicates the configuration in /etc/network/interfaces,
so in the end I changed to a traditional subnet.
Preparing the controlling host
To prepare the controlling host:
Creating a new container
To create a new container:
I imagine there will be further tweaks, but this is a good start.
We've already seen
To list processes belonging to all LXC containers:
I'm going to skip lxc-ls because it's needlessly confusing.
Sharing a filesystem
The recommended way of sharing part of the controlling host filesystems with the container
is to use bind mounts. For example:
LXC seems to work just fine. It's fast.
Documentation is lacking, and tooling seems limited.
In terms of complexity it's not dissimilar to the early days of Xen and KVM.
So far so good.
At this point I can see myself switching to LXC for my hosting purposes.
To do next (time permitting):
reconfigure the host and use LVM for the containers
actually use it for a while for for real work in multiple containers
try nested containers, to test the install instructions (and just because you can)
review online resources more to see what else I'm missing, and update this post accordingly
maybe do some performance tests
look into libvirt support
look into limiting CPU/IO etc through cgroups, and document that in a separate post
run some KVM guests alongside; that should just work
experiment with NAT to see if I can add additional containers on RFC1918 addresses