[lxc-devel] For some reason tty1 is always bound to host's tty1

Michael Tokarev mjt at tls.msk.ru
Tue Nov 24 18:51:28 UTC 2009


Andrian Nord wrote:
> There is a problem - tty1 seems to be always to be actually host's tty1,
> i.e. echoing into it will produce some output on host's console.
> Futhermore, container's tty acts as host's one (probably this is normal,
> but i'm not sure).
> 
> Anyway, if user forgot to remove agetty spawns (or similar) for tty1
> into container's inittab (or similar) it will lead to completelly
> blocked host's first console, which is commonly used by rc-system and
> this may prevent host from proper loading (as it messes up all input and
> output).

> Is this kernel issue or something lxc-specific (I haven't configured any
> lxc.tty's and log says, that there is 0 tty(s) configured)?

It's the way how devices works.  In container you've the same /dev/tty1
as in host.  Ditto for /dev/tty2, /dev/tty3 and so on.

You can:

   a) revoke access to tty devices using cgroup device access methods
   b) configure tty for the container

The b) case is exactly what the lxc.tty parameter is for.

/mjt




More information about the lxc-devel mailing list