Parameters for lxc-config

Hello,

I am currently through the “Linux Fundamentals” on the HTB Academy. It was updated recently and added new sections. One is about “Containerization” and talks about Docker and Linux Containers / LXC.

Specifically on the LXC part, it references some commands for “lxc-config”:

  • lxc-config -n container name -s storage
  • lxc-config -n container name -s network
  • lxc-config -n container name -s security

Since the entire sections talks specifically of Ubuntu, I made a VM on VMware with Ubuntu 23.02 (latest as of today) to test some things out.
Here are the commands I used :

  1. sudo apt-get install lxc lxc-utils lxc-templates -y
  2. sudo lxc-create --name linuxcontainer --template ubuntu
  3. sudo lxc-start -n linuxcontainer
  4. sudo lxc-attach -n linuxcontainer
  5. sudo lxc-config -n linuxcontainer -s network

When reaching that last command, I was met with “Unknow configuration item : -n”.
When using : lxc-config --help it seems that the only option available is “-l”.

Am I missing something ?
I guess I can always edit the configuration files directly ?
The documentation I found online only makes all this more confusing.

Thanks

TLDR : How to configure the network settings for an LXC container ?

Idk man try this:

and we aren’t noobs anymore we do not read the docs we ask chatgpt.