7

In the early days of computing, the setup is usually like this:

enter image description here

and we call the VT-100 "physical terminal".

But in Linux, we call virtual terminals "virtual" (the ones accessed by pressing Ctrl + Alt + F*). What I don't understand is why do we call them "virtual". When you use virtual terminal, you are also sitting in front of a screen and you see texts as you type on a keyboard, just like when you are using a VT-100 terminal. How is this "virtual"? How is it different from using a "physical terminal" such as a VT-100?

The only difference I can see is that when using a physical terminal you are using a serial cable to connect to the computer. Is using a serial cable what sets apart between physical terminal and virtual terminal?

3 Answers 3

10

No, it's not the use of serial cable that distinguishes between physical terminal and virtual terminal.

The reason why Linux virtual terminal is called "virtual" is because Linux itself implements the functionality of the terminal, unlike before that the functionality of the terminal is implemented by a separate device such as a VT-100.

In your diagram, the VT-100 accepts user input from the keyboard, sends bytes to the VAX-11 computer through the serial cable, the VAX-11 computer processes what it receives from the serial port, sends the output back to the terminal through the serial cable in the form of bytes, and the terminal decodes what it recieves and renders the output text on the screen. It is not the computer such as VAX-11 that renders the output to the screen but a separate physical device such as a VT-100. What the computer only does is to receive bytes through the serial port, process it, then send the output back to the terminal as bytes through the serial port. It has no mechanism to render texts on screen; that mechanism is done by a separate physical device. That's why it's called physical terminal.

In a modern Linux distro, the functionality of that physical terminal is implemented by Linux, that is, it is Linux that renders texts on the screen. There is no separate physical device that does the rendering of texts on the screen. That's why it's called virtual terminal.

4
  • 5
    That, and they're also "virtual" in the sense of several of them being multiplexed on the same physical console. Commented Mar 26 at 8:24
  • 5
    In particular, a terminal like VT-100 is a fixed-function device, not a general purpose computer that can provide a VT-like terminal interface, or anything else. Also there's the thing that a Linux machine can have multiple virtual terminals, so it can't be right to call the whole computer "a terminal". (well u1686_grawity sniped me to it)
    – ilkkachu
    Commented Mar 26 at 8:25
  • 3
    Just a comment. Linux supports physical terminals just fine and this is often used in a server environment.
    – doneal24
    Commented Mar 26 at 19:49
  • @ilkkachu "Linux machine can have multiple virtual terminals", I can switch between hardware emulated terminals with STRG+ALT+F1.. , because there are so many terminals available, i think this is a good argument, why they are all virtual, but when i look at tty7, it is the one listed with (:0), and it is no text Terminal, it runs with a GUI, and on this GUI i can emulated with software a lot of other virtual (pseudo) terminals. why is this called the terminal where the keyboard and screen is physically connected, and where does a message go if i use, sudo echo "hello" > /dev/tty7 Commented Mar 28 at 13:39
3

Let's take an analogy.

Here is a computer, and connected to it by a cable (in this case probably USB, or maybe PS/2) is a keyboard:

A 2006 Dell PC, with keyboard and mouse attached with wires

[Source: Jeremy Banks, CC BY 2.0, via Wikimedia Commons]

The keyboard is responsible for detecting which key was pressed, and transmitting an agreed/documented "scan code" to the computer. The computer doesn't need to know how the keys are physically arranged.

Here are two more computers, but this time each has a virtual keyboard:

A tablet and a phone, both showing a virtual keyboard on the screen

[Source: lolobosse, Mocho (original picture), modification: Mielon, CC0, via Wikimedia Commons]

The role which was previously filled by a separate physical device, is now built into the computer itself, with the functionality it provided implemented in software on top of a generic processor. That software has to convert from the position on the screen the user touched, directly to a character input.


At first glance, the VT-100 in your diagram might look like just a keyboard and a screen, but it is actually performing a more complex job. When the user presses a key, it does not send the VAX-11 scan codes, it translates directly to ASCII characters; and in return, it receives a stream of characters which it must render to the screen, as well as "control codes" which change its output and behaviour.

When you use a "virtual terminal", all of this extra responsibility has moved into software on the computer, just as the responsibility of the physical keyboard moved into the tablet or phone. The software has to convert keyboard activity into ASCII input, and ASCII output into display on the screen, rather than sending and receiving data over a cable and leaving a separate terminal to "understand" it.

2
  • That Dell keyboard in the first image is very likely connected via USB, and while USB uses serial signaling, it's a quite different and far more complex protocol compared to the RS-232/UART serial connections one usually means when saying "serial cable", which is what dedicated terminals were also connected with
    – ilkkachu
    Commented Mar 27 at 7:02
  • 1
    @ilkkachu Yeah, that was a bit of a stretch; I don't think it's necessary for the analogy, so have reworded.
    – IMSoP
    Commented Mar 27 at 7:29
2

I would say that the differentiator is whether the device (the terminal in this instance) is a physical device or not.

  • Physical terminal - a physical device connected by a physical cable of some sort. If it's local to the computer then it would have been a serial line. Other options could be a multiplexer or even modem. (History: my sixth form college in the early 1980s had something like a Decwriter LA120 connected to the polytechnic/university on the other side of town. There was a 150 baud modem at each end of the line allowing around 15CPS. Much of the polytechnic/university had physical terminals connected through Gandalf multiplexers rather than individual serial cables back to the host computers.)
  • Virtual terminal - implemented in software and often intended to emulate characteristics of a physical device. For example, as you have noted the Linux console implements a virtual terminal. As do xterm and gnome-terminal.

The Linux console could arguably be classed as a physical terminal, except that by using the Alt/Fn keys you can switch between multiple virtual terminals, each one independent of the others. It's a bit of a blurred line in this situation, really.

1
  • OK, I've deleted my previous comments, because they've led us down an unhelpful path. If you'll allow me to start fresh: Can you clarify where you think the line becomes blurred? From the definitions you give, the Linux console seems to quite clearly fall in the "virtual" category - it is implemented in software, and intended to emulate characteristics of a physical device. Are you thinking of the whole PC, including the Linux console, as becoming a "physical terminal" when that is all that is running?
    – IMSoP
    Commented Mar 27 at 23:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .