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 logFILE. the default is no log π-l,--logpriority=LEVELβ set log priority toLEVEL. the default log priority isERROR. 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 identifierNAME. 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
- alpine 3.24: lxc-doc 7.0.0-r0 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms