LinuxCommandLibrary

lxc-console

launches a console for the specified container

TLDR

Connect to container console

$ sudo lxc-console container_name
copy
Connect to specific tty
$ sudo lxc-console -t 1 container_name
copy
Exit console
$ Ctrl+a q
copy
Display help
$ lxc-console --help
copy

SYNOPSIS

lxc-console [options] -n containername_

DESCRIPTION

lxc-console launches a console for the specified container. It connects to a tty device provided by the container's init system, allowing interactive access.

PARAMETERS

-n, --name NAME

Name of the container to connect to
-t, --tty N
Connect to tty number N instead of an available one
-e, --escape CHAR
Set escape character (default: 'a' for Ctrl+a)
-P, --lxcpath PATH
Use alternate container path
-?, --help
Display help information

CAVEATS

The escape sequence to exit the console is Ctrl+a followed by q (unless changed with -e). The container must have an appropriate getty or login process running on its tty.

HISTORY

lxc-console is part of LXC (Linux Containers), providing OS-level virtualization for running multiple isolated Linux systems on a single host.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community