202

I hope the question is self-explanatory.

My understanding is that gnome-terminal and konsole are virtual terminals, and they are basically serving the same purpose, i.e. a command line environment for various optional command interpreters. (I'm not even sure if that's the right way to look at it.)

I assume that the real terminal is where I am teleported to occasionaly by mis-keying Ctrl+Alt+F1,F2, etc.

But "There be Dragons" in that black-screen hinterland, so I'm outta-there as quickly as I can press Ctrl+Alt+F7 (I learnt that somewhere: "When all is black and dark: press the secret keys to return :)

  • Is/are the "real" terminal(s) the one(s) that exist behind the Ctrl+Alt+F1,F2, etc. keys?
  • And what is so "real" about them vs the "virtual" ones?
  • And how to they differ? Is it as simple as "no GUI" vs "GUI"?

P.S. are "console" and "terminal" synonymous?

N.N.
  • 18,219
Peter.O
  • 24,681
  • 29
    Do not fear the command line. It can make your life at lot easier for some things once you're more familiar with it. – Larry Coleman Nov 22 '10 at 01:14
  • 2
    Related: http://superuser.com/questions/96628/why-are-things-like-gnome-terminal-called-terminal-emulators-instead-of-just-t – Matthew Nov 22 '10 at 01:20
  • 12
    @Larry: Emboldened by your words, I ventured into the dragon's lair (Ctrl+Alt+F1), and I actually logged in this time!... There was silence.. but I could see my customized terminal prompt (from the land of X).. Interesting I thought, and felt brave enoght to call out the the beast: I said "echo $TERM"... and lo and behold! it spoke back to me! It said, "linux"... Immediately I realized that he is a cousin of "gnome-terminal" and "konsole" who reply "xterm".. So it's not a dragon after all, but rather, it is a virtual terminal emulating a linux (real) terminal. – Peter.O Nov 22 '10 at 04:00
  • 5
    Do not fear the Linux Console: He is a very powerful yet tamed Dragon, and he is your best friend when compiz crashes ;) – MestreLion Feb 01 '15 at 11:47
  • Also, you may call him a cousin of gnome-terminal, after all they both serve the same purpose. A cousin that does not depend on any graphical environment, and is connected to a device that that grants him somewhat more powers. – MestreLion Feb 01 '15 at 11:50

3 Answers3

158

My understanding is that virtual terminals basically serve the same purpose: ie. A command line environment for various optional command interpreters

This isn't strictly true. Virtual Terminals are merely programs that send keystrokes and receive output (this is called Standard In, Standard Out[ and Standard Error]) to a process in the background. This is a basic inputprocessingoutput system, and is at the heart of your operating system.


A teletype (or teleprinter)


Man working at a Computer Terminal

Let's see if I can explain it properly:

In a Unix–like system such as Linux there is the concept of "everything is a file". That means, for example, your DVD Drive is a file (/dev/sdb1), your keyboard is a file (/dev/input/keyboard) and so on.

Another set of those magical files are the TTYs, where TTY stands for Teletype. A Typewriter that sends keystrokes to a computer, which in turn sends letters back to the Type Ball. This would have represented a physical device, a remote typewriter, in the same way as /dev/lp0 may represent your printer.


A hardware terminal, the VT100

The Teletype workstations would have been called "Consoles" or "Terminals", a virtual terminal, as opposed to a real one, thus is any application or machinery that provides the same functionality as this workplace arrangement - which is accessing the computer by sending keystrokes to it and receiving output back from it, printing it to a piece of paper. You can imagine that a Modem works in a very similar way.

Terminals, such as the one pictured above, are cheap and simple computers that emulate the functionality of a teletype. When we say terminal emulator these days, we - in turn - usually mean a program that emulates the functionality of such a machine.

There are still terminal based computer systems in use. They are in fact getting ever more popular. In the past, the reason for terminals was that a computer at every desk was completely ridiculous - where computers filled a room and were immensely expensive. Now, it saves money and makes administration easy.


a "thin client" – the modern equivalent of the VT100

I hope that this is helpful. Please alert my if I've made a mistake.


Does that mean that Control-Alt-F1,F2,etc are also virtual terminals, and the only difference between them and "gnome-terminal" / "konsole" is that they don't have a GUI?

Yes, basically. The difference between TTY1-7 and gnome-terminal is that the system provides the ttys, whereas gnome-terminal and konsole are themselves running on a tty (which is running the graphical subsystem). This abstraction can be nested even deeper (e.g. x-forwarding, using the telnet protocol to act as a terminal, ...), after all, the human—computer interface acts just like any other file. And can be piped, abstracted and moved about in the same way.

  • 16
    Was your answer helpful? ...Absolutely!! ...very well explained... I'd never thought of a keyboard as a file, but it makes sense (a read-only file)... and a "thin client" is a term I had heard touted about on some podcasts, but it just went over my head and I thought it referred to some new CPU architecture (a-la RISC) .. but it actually means that good ideas don't go away, and that CICS (or at least its offspring) is still alive and well... very interesting... Thanks (now I've got a bit more reading to do ... you've started something :) – Peter.O Nov 21 '10 at 14:42
  • 20
    This is a bit random and hasn't got a lot to do with Linux, but none the less: If you'd like to learn some of the very basics of how a computer actually works, have a listen to http://twit.tv/sn - episodes 233, 235, 237, 239 and 241. A series on "how computers work from the absolute basics", where basic means "low level". Not a lot of people know this stuff, it's great fun. – Stefano Palazzo Nov 21 '10 at 15:06
  • Security Now! I haven't missed a single episode. A top podast (I haven't understood it all, but I have listened to them all :) – Peter.O Nov 21 '10 at 15:39
  • your Linux Terminal Server Project Wikipedia page links to the German version. Maybe you should change it to English, for convenience's sake? – Oxwivi Feb 23 '11 at 17:27
  • 1
    @TokiTahmid whoops! Corrected, Thank you very much. It wasn't intentional, just a mistake :) – Stefano Palazzo Feb 23 '11 at 17:34
  • 4
    My recollection is that the VT-100 was considered a (video) terminal, not a virtual terminal or terminal emulator. Many devices containing their own microprocessors were considered terminals, whatever other devices they emulated, as long as they were designed to provide input and output directly to a user. If the computer/human interface is implemented in software on a device that is not dedicated to being a terminal, I would term that interface or software a virtual terminal. The purpose of the overall device is the difference, not the technology nor the communications protocol used. – John S Gruber Jun 01 '12 at 17:13
  • 1
    A computer console is a device used to control a computer as a whole. For Unix-related systems this could be any terminal on which a user can become a super-user or run sudo. Mainframes most often had terminals that had special privileges based on how they were directly connected to the mainframe. – John S Gruber Jun 01 '12 at 17:25
  • [1] One point: As I know it, VT100 is not a terminal emulator but a terminal. (The wikipedia page of VT100 that I linked does not call VT100 a terminal "emulator") A terminal is any physical device that takes input from the user to send this input to a computer (possibly after some processing on the input) and displays the output received from the computer. A teletypewriter is a terminal that does these functionality by using an electromechanical keyboard for input and paper for output. – Utku Jun 26 '16 at 13:54
  • [2] A "video terminal" such as VT100 does these functionality by an electromechanical keyboard for input and a video display for output. In neither of these, no real computation (except possibly minor processings on the input and output) happens. A terminal emulator is a software that does these functionalities in software. – Utku Jun 26 '16 at 13:54
  • Fair point @Utku, the VT100 should be called a Terminal. – Stefano Palazzo Jun 28 '16 at 09:10
  • 2
    @JohnSGruber Your recollection is correct the VT100, and its kin, are 'video' terminals, to distinguish them from the paper-based TTY, the top photo in this answer. The three benefits of a VT over a TTY were much quieter, no wasted paper (but w/o scroll that wasn't always good), and speed - the TTY was pretty much limited to 110baud (10 char/sec) the VTs could go as high as 19,200baud, iirc. Later they even came up with 'smart terminals', a VT with the ability to do some processing on the incoming signal and add color to the text, and even, for a price, graphics. –  Feb 01 '17 at 03:56
14

Pretty sure calling it a "virtual terminal" is a throwback to when there were physical terminals connected to unix servers...

RobotHumans
  • 29,530
  • Okay... That makes sense... "back then" before multi-tasking existed, and the very idea of it was abstract and "virtual"... So it is the same idea as a Virtual Machine vs a hardware "box". – Peter.O Nov 21 '10 at 12:40
  • 2
    Does that means that Control-Alt-F1,F2,etc are also virtual terminals, and the only difference between them and "gnome-terminal" / "konsole" is that they don't have a GUI? – Peter.O Nov 21 '10 at 12:47
  • @fred.bear: Take a look at Wikipedia. – Jamie Schembri Nov 21 '10 at 13:16
  • virtual because the human input/output end of the terminal actually connects to a running process (through /dev/pts/*). Non-virtual terminals are things like the Linux text console (backend provided by kernel code to turn keystrokes into terminal input characters, and terminal output into characters on screen, including processing escape codes for color, cursor movement etc.). Or the oldest example of a non-virtual terminal, the serial ports. Terminal handling provided by whatever you hooked up to your serial port. You can boot with the text console on a serial port. – Peter Cordes Aug 05 '14 at 07:34
13

In addition to the answers above, see this comprehensive explanation ot terminals. The TTY, despite its apparent simplicity, is conceptually a rather complicated part of Linux.

loevborg
  • 7,282
  • 1
    Thanks loevborg. It is a really interesting article which goes a long way to explain a lot of the "mysterious" terminology... (eg. a "zombie" process ;) – Peter.O Dec 07 '10 at 23:25