A
virtual console – also known as a
virtual terminal (
VT) – is a conceptual combination of the keyboard and display for a computer
user interfaceThe user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...
. It is a feature of some
operating systemAn operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
s such as
UnixWareUnixWare is a Unix operating system maintained by The SCO Group . UnixWare is typically deployed as a server rather than desktop. Binary distributions of UnixWare are available for x86 architecture computers. It was originally released by Univel, a jointly owned venture of AT&T's Unix System...
,
LinuxLinux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
, and BSD, in which the
system consoleThe system console, root console or simply console is the text entry and display device for system administration messages, particularly those from the BIOS or boot loader, the kernel, from the init system and from the system logger...
of the computer can be used to switch between multiple virtual consoles to access unrelated user interfaces. Virtual consoles date back at least to
XenixXenix is a version of the Unix operating system, licensed to Microsoft from AT&T in the late 1970s. The Santa Cruz Operation later acquired exclusive rights to the software, and eventually superseded it with SCO UNIX ....
in the 1980s.
Usually in Linux (see
Linux consoleThe Linux console is a system console support in the Linux kernel. The Linux console was the first functionality of the kernel, developed as early as in 1991 . On PC architecture, it is common to use VGA-compatible video hardware. Implementations of computer graphics on Linux are excluded from the...
), the first six virtual consoles provide a text terminal with a login prompt to a
Unix shellA Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems...
. The graphical
X Window SystemThe X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
starts in the seventh virtual console.
In Linux, the user switches between them with the key combination
AltThe Alt key on a computer keyboard is used to change the function of other pressed keys. Thus, the Alt key is a modifier key, used in a similar fashion to the Shift key. For example, simply pressing "A" will type the letter a, but if you hold down either Alt key while pressing A, the computer...
plus a
function keyA function key is a key on a computer or terminal keyboard which can be programmed so as to cause an operating system command interpreter or application program to perform certain actions...
– for example
Alt+F1A function key is a key on a computer or terminal keyboard which can be programmed so as to cause an operating system command interpreter or application program to perform certain actions...
to access the virtual console number 1.
Alt+Left arrow changes to the previous virtual console and
Alt+Right arrow to the next virtual console. To switch from the X Window System,
Ctrl+Alt+function key works. (Note that users can redefine these default key combinations.)
The need for virtual consoles has lessened now that most applications work in the graphical framework of the X Window System, where each program has a window and the text mode programs can be run in
terminal-emulatorA terminal emulator, terminal application, term, or tty for short, is a program that emulates a video terminal within some other display architecture....
windows. If several
sessionsIn computing, a login session is the period of activity between a user logging in and logging out of a system.On Unix and Unix-like operating systems, a login session takes one of two main forms:...
of the X Window System are required to run in parallel, such as in the case of
fast user switchingFast user switching is a feature on some modern multi-user operating systems such as Windows XP and newer, Mac OS X, Linux. It allows users to switch between user accounts on a single PC without quitting applications and logging out. Analogous functionality was first developed on consumer level...
or when debugging X programs on a separate X server, each X session usually runs in a separate virtual console.
GNU ScreenGNU Screen is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session...
is a program that can change between several text-mode programs in one textual login. There are also other graphical frameworks such as
Y Window SystemThe Y Window System is a windowing system, consisting of a window server and a client library for writing applications. It was written by Mark Thomas as the subject of his Master's thesis at Imperial College, London. It is intended to be a successor to the X Window System, hence the name...
, and
FrescoIn computing, Fresco was a windowing system intended as a replacement for the X Window System. It was free software, licensed under the terms of the GNU Lesser General Public License ....
.
Interface
The virtual consoles are represented by device special files /dev/tty1, /dev/tty2 etc. There are also special files /dev/console, /dev/tty and /dev/tty0. (Compare the devices using the patterns vcs ("virtual console screen") and vcsa ("virtual console screen with attributes") such as
/dev/vcs1 and
/dev/vcsa1.
) The virtual consoles can be configured in the file /etc/inittab read by
initinit is a program for Unix-based computer operating systems that spawns all other processes. It runs as a daemon and typically has PID 1. The boot loader starts the kernel and the kernel starts init...
-- typically it starts the text mode
loginIn computer security, a login or logon is the process by which individual access to a computer system is controlled by identifying and authentifying the user referring to credentials presented by the user.A user can log in to a system to obtain access and can then log out or log off In computer...
process
gettygetty, short for "get teletype", is a Unix program running on a host computer that manages physical or virtual terminals . When it detects a connection, it prompts for a username and runs the 'login' program to authenticate the user....
for several virtual consoles.
X Window SystemThe X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
can be configured in /etc/inittab or by an X display manager.
Programs used to access the virtual consoles typically include:
- chvt to switch the current virtual console
- openvt to run a program on a new virtual console
- deallocvt to close a currently unused virtual console.
The program
startx starts the
X Window SystemThe X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
on a new virtual console. There are also other graphical programs that can start from the console, such as
LinuxTVThe LinuxTV project is an informal group of volunteers who develop software related to digital television for the Linux operating system. The community develops and maintains the DVB driver subsystem which is part of the Linux 2.6.x kernel...
and
MPlayerMPlayer is a free and open source media player. The program is available for all major operating systems, including Linux and other Unix-like systems, Microsoft Windows and Mac OS X. Versions for OS/2, Syllable, AmigaOS and MorphOS are also available. The Windows version works, with some minor...
.
Programs can access the virtual consoles by the device special files. In text mode, writing to the file displays text on the virtual console and reading from the file returns text the user writes to the virtual console. As with other text terminals, there are also special
escape sequenceAn escape sequence is a series of characters used to change the state of computers and their attached peripheral devices. These are also known as control sequences, reflecting their use in device control. Some control sequences are special characters that always have the same meaning...
s,
control characterIn computing and telecommunication, a control character or non-printing character is a code point in a character set, that does not in itself represent a written symbol.It is in-band signaling in the context of character encoding....
s and
termios functionIn computing, a system call is how a program requests a service from an operating system's kernel. This may include hardware related services , creating and executing new processes, and communicating with integral kernel services...
s that a program can use, most easily via a library such as
ncursesncurses is a programming library that provides an API which allows the programmer to write text user interfaces in a terminal-independent manner. It is a toolkit for developing "GUI-like" application software that runs under a terminal emulator...
. For more complex operations, the programs can use console and terminal special
ioctlIn computing, ioctl, short for input/output control, is a system call for device-specific operations and other operations which cannot be expressed by regular system calls. It takes a parameter specifying a request code; the effect of a call depends completely on the request code. Request codes are...
system calls. Graphical programs can use libraries such as
DirectFBDirectFB stands for Direct Frame Buffer. It is a software library for GNU/Linux/Unix-based operating systems with a small memory footprint that provides graphics acceleration, input device handling and abstraction layer, and integrated windowing system with support for translucent windows and...
,
DRIIn computing, the Direct Rendering Infrastructure is an interface and a free software implementation used in the X Window System to securely allow user applications to access the video hardware without requiring data to be passed through the X server. Its primary application is to provide...
,
SDLSimple DirectMedia Layer is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices....
or the earlier
SVGALibSVGAlib is an open-source low-level graphics library which runs on Linux and FreeBSD and allows programs to change video mode and display full-screen graphics. Some popular games like Quake and Doom used it in their original releases....
.
Unix systems
Unix workstations, such as those manufactured by
SunSun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...
or
Silicon GraphicsSilicon Graphics, Inc. was a manufacturer of high-performance computing solutions, including computer hardware and software, founded in 1981 by Jim Clark...
, did not include virtual consoles. The only purpose of a console would be to fix the system so that graphical environment could start.
Sun
Niagara-based|right|262px|UltraSPARC T1 processorSun Microsystems' UltraSPARC T1 microprocessor, known until its 14 November 2005 announcement by its development codename "Niagara", is a multithreading, multicore CPU...
servers running virtualization with
Logical DomainsLogical Domains is the server virtualization and partitioning technology from Sun Microsystems released in April 2007. It has been re-branded as Oracle VM Server for SPARC since Oracle Corporation completed the acquisition of Sun in January 2010. Each domain is a full virtual machine with a...
get virtual console services from the
Control domain.
See also
- Computer console for the concrete console
- Text terminal for the textual interface in general
- Pseudo terminal
In some operating systems, including Unix, a pseudo terminal is a pseudo-device pair that provides a text terminal interface without an associated device, such as a virtual console, computer terminal or serial port...
for even more virtual consoles
- Terminal emulator
A terminal emulator, terminal application, term, or tty for short, is a program that emulates a video terminal within some other display architecture....
for an application program that has the same function as a textual virtual console
External links