12

As I know

  • tty1 for gui login page
  • tty2 for gui using
  • tty3-6 for user using

What are tty0,tty7-tty63 and ttyS0-ttyS31 used for?

muru
  • 207,228
MohamedJ
  • 139

1 Answers1

27

From a distribution agnostic viewpoint:

tty%d (numeric suffix, with no letter between, starting from 1) are all "virtual consoles" which have no specific designated purpose. These can be text terminals, or a graphical server can be launched on top of the text terminal. These might be dynamically allocated. Some distros will start their first graphical interface on a specific one of these, but which one has changed several times and subsequent ones will be dynamically assigned.

tty0 is special. Rather than a real tty, this is internally aliased by the kernel to the current active virtual console. It can be treated as a normal tty device, except that it won't work until one of the other tty%d devices has been initialized and assigned as console.

ttyS%d are hardware serial ports. The devices are likely preallocated and may not necessarily correspond to existing serial hardware. But if you do have directly connected serial ports, they typically are assigned sequentially starting from ttyS0

If you have USB serial devices, they may show up as /dev/ttyUSB%d or ttyACM%d depending on the underlying device model, and number assignment varies depending on order they were plugged in and they may get shuffled if they are unplugged and replugged.

Thanks to Rinzwind for these details on typical distribution specific virtual console uses:

  • In gnome3, tty1 is the first GUI desktop. gnome2 uses tty7 instead.
  • getty (text login prompt) is set up on tty1 - tty6
  • tty8 - tty12 are typically left with nothing on them, but they can be claimed by anything, and both GUI and getty interfaces can be added with some config file changes (typically systemd) or by spawning additional GUI logins.

Typically you switch to a virtual console with alt-Fkey (where Fkey is one of the function keys F1-F12) (or ctrl-alt-Fkey if you were in a GUI) so to access consoles above 12, you have to either bind a custom console key to that or switch to it with a command line tool or some other method (like alt-arrow).

user10489
  • 5,533