On the Linux desktop, you may mainly use the GUI, but what if you could use a mode that was just text?

With Linux virtual consoles, you can use the computer without graphics to rescue a broken X system or even use it without a GUI entirely.

What Are Linux Virtual Consoles?

On a Linux system, the console is the keyboard and monitor attached directly to the system. This would take the place of a serial terminal on minicomputer and mainframe Unix systems. This would let the system administrator log in as root where this could be restricted on terminals connected to the system remotely. Instead, Linux uses something called a framebuffer to display text on the screen.

A virtual console is like having a full-screen Linux terminal emulator. On desktop systems, you'll frequently see boot messages before the display manager starts.

Debian Linux boot console

Switching to Virtual Consoles

To switch among the virtual consoles, you can use the Alt + Function Key system. There are typically seven virtual consoles you can use. If you're running a desktop system with X11, it usually starts in the seventh virtual console. To switch to the first virtual console, you'll have to press Alt + F1. If it doesn't work for you, try Ctrl + Alt + F1 instead.

When you switch virtual consoles, they're labeled with the TTY number, going from one to seven, such as "tty1" for the first virtual console.

Linux virtual console login

You'll see a login screen. Log in using your user name and password, and you can enter commands in the shell as you would as if you had opened a terminal window on the desktop. If you ever used MS-DOS on an old PC, this layout will likely look familiar to you.

In the early days of Linux, distributions would typically default to virtual console sessions because X was a resource hog on low-end PCs of the day.

For that reason, Linux users would run it only when they absolutely had to before computers that could run X desktops with decent performance became affordable in the second half of the 1990s.

Scrolling and Using the Mouse in Text Mode

Linux console mouse text selection

Virtual consoles are not only useful for entering commands, but you can also use the mouse and touchpad, provided you install the correct drivers. The console mouse driver is "gpm," which stands for General Purpose Mouse. As with everything else on modern Linux systems, this is usually available through your distribution's package manager.

On Debian/Ubuntu systems:

        sudo apt install gpm
    

On Arch Linux:

        sudo pacman -S gpm
    

Since GPM runs as a server and Arch doesn't start servers by default, you'll have to enable it using systemd:

        sudo systemctl enable gpm.service
    

On Red Hat/Fedora/Rocky Linux systems:

        sudo dnf install gpm
    

With the driver installed, when you use the console, you'll see a mouse cursor on the screen. You can click and edit commands on the command line, as well as copy by selecting text with the left mouse button and pasting it by right-clicking.

You can also scroll the console screen up and down using Shift + Page Up and Shift + Page Down, though Bash and Zsh will often intercept these keystrokes to scroll the command history instead. An alternative is using tmux's copy mode to scroll up and down in the terminal.

Related: How to Install and Configure Tmux for Linux

Uses for Virtual Consoles

Rocky Linux installation program with virtual consoles

While virtual consoles are used less frequently now that graphical desktops with display managers are more common, they still have their uses in Linux today.

If your X session locks up or something else goes wrong, you can switch to a virtual console and log in to try to fix it. You could try killing and restarting the X server, or you could gracefully shut down or restart your machine.

If the X session fails to start, you'll be dumped into a virtual console session anyway. This is yet another reason why it pays to be familiar with the Linux command line.

Virtual consoles are still used in some distribution installation programs, particularly ones that run in text mode. You can switch to another virtual console and see how the installation is going or why an operation seems to be taking a long time. You can also execute other commands in a shell that can be useful if you run into any errors.

Now You Know About Linux Virtual Consoles

Now you know how Linux virtual consoles work. Linux still uses the command line for so many operations. You may be wondering why it is so. A lot of it is due to Linux's Unix heritage.