lxc-console(1)
π» lxc-console(1) β your girl's guide to popping open a container console β¨
okay so real talk, bestie: this is the lxc-console page from the LXC manual, and it's literally just about launching a console into a container. Cute, simple, kinda iconic. Let's get into it π«Ά
πΈ NAME
lxc-console β launch a console for the container you pick π
π SYNOPSIS
lxc-console {-n name} [-e escape character] [-t ttynum]
β¨ DESCRIPTION
So here's the vibe: if the tty service is configured and available for the container you named as the parameter, this command launches a console that lets you log on to the container. That's it, that's the whole serve π
The tty slots situation, because this part matters: the available ttys are free slots that get taken up by this command. So picture it β your container has four ttys available, and you've launched the command four times, each one grabbing a different tty. The fifth command? It fails. No console available. Not me getting ghosted by my own container π
The command connects to a tty. If that connection is lost or broken, no big deal β you can launch the command again and it regains the tty at the exact state it was in before the disconnection. Slay, persistence.
Also: a ttynum of 0 may be given to attach to the container's /dev/console instead of its dev/tty<ttynum>. Different door, same house π₯
And bestie, there's a keyboard escape sequence you can use to disconnect from the tty and quit lxc-console. The default escape sequence is Ctrl+a q. Memorize it, it's your little exit strategy π«
π¦ OPTIONS
-e,--escapeescape character β specify the escape sequence prefix to use instead of Ctrl+a. You can give it as'^letter'or just'letter'. For example, to use Ctrl+b q as the escape sequence, use-e '^b'. Custom escape routes, we love to see it π-t,--ttyttynum β specify the tty number to connect to, or0for the console. If you don't specify it, the next available tty number gets automatically chosen by the container. Let the container decide, honestly, main character energy π
π§ COMMON OPTIONS
These options are common to most of the lxc commands β the shared group-chat of flags, iykyk πΈ
-?,-h,--helpβ print a longer usage message than normal. The verbose bestie π--usageβ give the usage message. Short and sweet.-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.
heads up bestie π β 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. Don't get it twisted.
-n,--name=NAMEβ use container identifierNAME. The container identifier format is an alphanumeric string. Name your child, periodt π--rcfile=FILEβ specify the configuration file to configure the virtualization and isolation functionalities for the container.
This configuration file, if present, will be used even if there is already a configuration file present in the previously created container (via lxc-create). It overrides, bestie, that's the whole point π―
--versionβ show the version number. β
π DIAGNOSTIC
tty service deniedβ no tty is available, or there isn't enough privilege to use the console. For example: the container belongs to user"foo"and"bar"is trying to open a console to it. Denied. Not your container, not your console π
π 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) β the whole friend group, go say hi π¦
and that's the page, bestie!! π this one's dated 2026-05-01, straight from the lxc-console(1) manual β go forth and console responsibly β¨ππ
π¦ 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