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, --escape escape 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, --tty ttynum β€” specify the tty number to connect to, or 0 for 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 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.
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 identifier NAME. 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