Terminal – What is Switching Environments System-Wide Called?

openboxterminalwindow-managerxorg

I am currently trying to make an autonomous drone using the Robot Operating System (ROS). To do this, I have installed Raspbian Lite (Jessie) on a Raspberry Pi 3 and am currently using ROS Kinetic on it. Because it is Raspbian Lite, there were no window managers or desktop environments that came along with the installation. I decided to go with Openbox Window Manager and installed a terminal onto it for convenience. I can just call sudo startx, and the window manager opens up, which can be accessed by Ctrl + alt + F2`.

Now my question lies in the fact that I do not understand the process of creating new sessions within the system wide terminal. Is it called the system wide terminal to start with? What are these sessions, that I am invoking with the use of Ctrl+ Shift+ F? Some of them accommodate display managers and some of them accommodate terminals, while I imagine, that a whole desktop environment can be accommodated too. Is there a man page that I can look into?

Best Answer

They are kernel virtual terminal devices, multiplexed onto the physical framebuffer and human-input devices by a terminal emulator program that is built into the kernel itself. To applications programs running on top of the kernel, they look like any other terminal devices, such as a serial terminal device. (They have a line discipline, but no modem control.)

The system implements terminal login by dint of running a getty program (or equivalent) and a login program that accept user credentials and invoke login sessions.

The X server program also needs to use the physical framebuffer and human-input devices. It needs to negotiate sharing them with the kernel terminal emulator. It does so by allocating one virtual terminal and telling the kernel to disconnect that from the kernel terminal emulator.

Hence why it appears that the X server "runs" on a particular terminal. When the kernel terminal emulator sees the hotkey chord for switching to the allocated virtual terminal, it cedes control of the framebuffer and human-input devices to to the X server. When the X server sees the hotkey chord for switching to another virtual terminal, the X server cedes control back.

These hotkey chords are not necessarily symmetrical. On one of my systems the hotkey chord implemented by the kernel terminal emulation program for switching to virtual terminal #2 is Alt+F2 whereas the hotkey chord implemented by the X server for the same action is Ctrl+Alt+F2.

When it comes to graphical login, a display manager handles starting up X servers with greeter programs. You're just starting an X server directly and not using a display manager, of course. Once the user credentials have been authenticated, a desktop manager displays a desktop environment, which comprises a set of X client applications of varying degrees of complexity. For complex desktop environments, there is a whole bunch of server programs interconnected via a desktop bus. (On one of my systems, the so-called "small and lightweight" GNOME Editor requires a D-BUS broker and nine other server programs to be running.)

Some of those X client programs can be other terminal emulators, userspace ones, such as LXTerminal, Unicode RXVT, GNOME Terminal, Terminate, roxterm, evilvte, xterm, and so forth. These do not directly use physical framebuffer and human-input devices, and they make use of pseudo-terminal devices.

Further reading

Related Question