lxc-cgroup(1)

πŸ’… lxc-cgroup β€” bestie's guide to cgroups (from lxc-cgroup(1))

ok so picture this: you've got a container, right, and it has a control group just vibing in the kernel, and you need to manage it. That's the whole gig. This is the lxc-cgroup page, section 1 of the manual, and it is genuinely so much simpler than it sounds. Let's get into it 🫢

✨ SYNOPSIS ✨

lxc-cgroup {-n name} {state-object} [value]

that's it. that's the whole thing. name, object, optional value. slay.

🌸 DESCRIPTION 🌸

okay so real talk β€” lxc-cgroup gets or sets the value of a state-object (think something like cpuset.cpus) inside the container's cgroup for the matching subsystem (for example, cpuset). πŸŽ€

The vibe check on the value:

  • no [value] given? it just shows you the current value of the state-object. reading, not writing. observer mode. πŸ‘€
  • [value] given? it sets it. you're the main character now. ✨
⚠️ big important caveat, no cap: lxc-cgroup does NOT check that the state-object is actually valid for the kernel you're running, and it does NOT check that the corresponding subsystem is even contained in any mounted cgroup hierarchy. It's not gonna warn you, bestie. It's not gonna hold your hand. Do your homework first 😭

πŸ¦‹ OPTIONS πŸ¦‹

  • state-object β€” specify the state object name. this is the thing you're poking at πŸ’…
  • [value] β€” specify the value to assign to the state object. leave it out and you're just looking ✨

πŸ‘‘ COMMON OPTIONS πŸ‘‘

these ones are common to most of the lxc commands, so like… you'll see them everywhere. iconic behavior honestly.

  • -?, -h, --help β€” print a longer usage message than normal. the long version, the extended cut πŸ’–
  • --usage β€” give the usage message
  • -q, --quiet β€” mute on πŸ”‡
  • -P, --lxcpath=PATH β€” use an alternate container path. the default is /var/lib/lxc
  • -o, --logfile=FILE β€” output to an alternate log FILE. the default is no log πŸ“
  • -l, --logpriority=LEVEL β€” set log priority to LEVEL. the default log priority is ERROR. possible values are: FATAL, ALERT, CRIT, WARN, ERROR, NOTICE, INFO, DEBUG, TRACE.
okay heads up 🫢 this option sets the priority of the events log in the alternate log file. it does not have an effect on the ERROR events log on stderr. two different logs, two different vibes, don't get it twisted.
  • -n, --name=NAME β€” use container identifier NAME. the container identifier format is an alphanumeric string πŸŽ€
  • --rcfile=FILE β€” specify the configuration file that configures the virtualization and isolation functionalities for the container.
and listen πŸ‘€ β€” this configuration file, if present, will be used even if there's already a configuration file present in the previously created container (the one made via lxc-create). it does not care. it's picking itself. main character file energy fr fr.
  • --version β€” show the version number 🌈

🧚 EXAMPLES 🧚

see what devices are allowed:

lxc-cgroup -n foo devices.list

display the allowed devices to be used. cute little peek πŸ’œ

assign some CPUs:

lxc-cgroup -n foo cpuset.cpus "0,3"

assign the processors 0 and 3 to the container. boom. done. ate. πŸ”₯

πŸ’€ DIAGNOSTIC πŸ’€

  • The container was not found β€” the container is not running. that's the whole reason. it's not there, bestie πŸ™ˆ

⭐ SEE ALSO ⭐

lxc(7), lxc-create(1), lxc-copy(1), lxc-destroy(1), lxc-start(1), lxc-stop(1), lxc-execute(1), lxc-console(1), lxc-monitor(1), lxc-wait(1), lxc-cgroup(1), lxc-ls(1), lxc-info(1), lxc-freeze(1), lxc-unfreeze(1), lxc-attach(1), lxc.conf(5)


and that's the page!! πŸ’– this one came from the lxc source, dated 2026-05-01, and it's page lxc-cgroup(1) of the manual β€” go forth and manage those control groups, bestie, you've got this πŸŽ€βœ¨

πŸ“¦ where this page comes from