Page 1 of 1

Buster - lxc-net missing?

PostPosted: 2018-08-29 10:47
by rsi
What is wrong with the buster (testing) development?

https://wiki.debian.org/LXC#Installation

Stretch ships with a new major release of LXC which also includes a helper for easier networking setup called lxc-net. lxc-net allows you to set up a simple bridge for your containers, providing a DHCP-and-NATed IPv4 network. IPv6 support currently (in Stretch) requires manual configuration.


But on buster the 'lxc-net' is missing?!

Code: Select all
root@vmm:/etc/lxc# lxc-net
bash: lxc-net: command not found

Re: Buster - lxc-net missing?

PostPosted: 2018-08-29 11:38
by GarryRicketson
Well, since Debian Buster, is still in the testing stages, and not a stable release,
maybe something is not ready yet, but it looks like the package is available:
https://packages.debian.org/buster/lxc

Looking closer at the wiki: https://wiki.debian.org/LXC#Installation,

I see this :
Missing configuration is sourced from /usr/lib/x86_64-linux-gnu/lxc/lxc-net which contains the default values which means your bridge will be given a subnet of 10.0.3.0. You can change these values if you want in the /etc/default/lxc-net file. There is an Ubuntu patch to /usr/lib/x86_64-linux-gnu/lxc/lxc-net (or /usr/lib/<architecture/lxc/lxc-net) available at its packaging on Github called 0001-Allocate-new-lxcbr0-subnet-at-startup-time.patch that will automatically configure /etc/default/lxc-net with a subnet that is available on your system; typically 10.0.3.0 would just be available. It would pick any free subnet in the range of 10.0.x.0 going up with 10.0.3.0 as the starting point. This is done on system boot in case /etc/default/lxc-net is missing. So in order to use it, you must then delete this file first.
For other purposes, see /SimpleBridge#Using_lxc-net for values you can add yourself.


The Wiki also has a link pointing to this:
https://wiki.debian.org/LXC/SimpleBridge#Using_lxc-net
This information is put in the file /etc/default/lxc-net.

This is also the default configuration for LXC-net as started with Debian Stretch in the default configuration (setup) without the patch applied to it (see the main page)

After creating this file with the required config you can simply start the service with:

systemctl start lxc-net after enabling it with systemctl enable lxc-net. This is covered in the introduction at the Main Page. Commands:
Code: Select all
systemctl enable lxc-net
systemctl start lxc-net


This information is put in the file /etc/default/lxc-net

rsi ยป
Code: Select all
root@vmm:/etc/lxc# lxc-net
bash: lxc-net: command not found

"lxc-net" is a file, not a command, the correct command to start lxc, is :
Code: Select all
systemctl start lxc-net

But be sure you have enabled it first:
Code: Select all
systemctl enable lxc-net


The manual should have more details
There also is a pretty good tutorial here:
https://angristan.xyz/setup-network-bridge-lxc-net/

Re: Buster - lxc-net missing?

PostPosted: 2018-08-29 11:47
by L_V
rsi wrote:But on buster the 'lxc-net' is missing ?!

Code: Select all
apt-file search lxc-net
   lxc: /etc/init.d/lxc-net
   lxc: /lib/systemd/system/lxc-net.service
   lxc: /usr/lib/x86_64-linux-gnu/lxc/lxc-net

Code: Select all
apt policy lxc

Re: Buster - lxc-net missing?

PostPosted: 2018-09-08 16:05
by rsi
Hello and thank you for your hints!
I've missunderstand some things in lxc and the use of it. So, problem is mostly on my side.

Sorry!