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.

I also got stuck on this as the whole section seems to be full of, now, incorrect information and commands. I’m looking into using LXD instead as my starting point but am very disappointed with the errors that keep cropping up in HTB Academy modules.

The only positive spin is that I am probably learning more because I am having to go find other sources and write my own comprehensive notes. Progress is a lot slower though as I can’t just echo what I’m being shown.

If I were paying for this module I’d be rather irate and errors like this put me off spending actual money on future modules. Up until the module got updated it was, for the most part, correct.

Really annoying! The module is outdated and the command is full of mistaks when running in the virtual machine. I thought it was my VM’s problem, so I paid for academy subscription and use the Pwnbox it offered me, but still full with errors. So in the end I skipped this part.