~# lxc profile device show default
# (...sic...)
console:
path: /dev/console
type: unix-char
tty:
path: /dev/tty
type: unix-char
tty0:
path: /dev/tty0
type: unix-char
ttyS0:
path: /dev/ttyS0
type: unix-char
Add with:
lxc profile device add default console unix-char path=/dev/console
lxc profile device add default tty unix-char path=/dev/tty
lxc profile device add default tty0 unix-char path=/dev/tty0
lxc profile device add default ttyS0 unix-char path=/dev/ttyS0
Open console with:
lxc-console -P /var/lib/lxd/containers -t 0 -n my-container
I use an lxcon
bash alias:
alias lxcon='lxc-console -P /var/lib/lxd/containers -t 0 -n'