0

Is a Virtual Terminal the terminal that you get when you type Ctrl+Alt+F#, and which is represented by the file /dev/tty#.

While a Pseudo Terminal is a terminal that actually runs "inside" a tty, for example: gnome-terminal, xterm, etc. And which is represented by the file /dev/pts/#.

Am I correct?

marked as duplicate by Kusalananda, Jeff Schaller, Eric Renouf, don_crissti, Anthon Apr 15 '17 at 22:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • One important difference, is that pseudo-terminals always are pairs - one master and one slave. eg. /dev/ptyp4 (master) and /dev/ttyp4 (slave). These days this is somewhat hidden in that a program now uses /dev/ptmx - the psaudo-terminal multiplexer - to get the file-descriptor to a new master, while the corresponding slave is created under the /dev/pts/-directory. The virtual consoles don't have such a pairing (they just got the /dev/ttyn device), and they're directly connected to the kernel. – Baard Kopperud Apr 15 '17 at 8:49
  • In addition we also got /dev/ttySn (also not pairs) which correspond to the serial-ports... This is where physical terminals - ie. teletypers or screen&keyboard-combos - would've been connected to the computer. Before the PC, such terminals connected to serial-lines, was how most people would use Unix-computer (eg. a mainframe). – Baard Kopperud Apr 15 '17 at 8:53
  • Not a duplicate as indicated, since the accepted answer doesn't mention pseudo-terminals, and the one answer mentioning pseudo-terminals is largely incorrect. – Thomas Dickey Apr 15 '17 at 10:54
  • Thomas, the accepted answer in the linked duplicate does mention "pseudo ttys"...? – Jeff Schaller Apr 15 '17 at 12:13
1

"Virtual Terminal" is a loosely defined term that can mean different things depending on who is talking. All terminals are virtual nowadays if opposing virtual terminals to physical terminals (e.g. a real DEC VT100).

On Linux, /dev/tty[n] are virtual consoles. They are virtual terminals (terminal emulators) implemented by the kernel and independent of the graphic environment, if any.

/dev/pts/# are channels used to interact with local or remote terminal emulators like gnome-terminal or Windows putty.

0

A pseudo terminal is a kernel concept that was introduced to present terminal line discipline to programs so that the programs think they are talking to a real terminal. This enables the programs to work unmodified regardless if they are talking to a real terminal device (e.g. a serial port) or a pseudo terminal.

For example, the interface provided by a network connection does not look like a serial line at all, so a pseudo terminal pair (a master and a slave) is used. The network handler process opens the master side of the pseudo terminal and reads from it and writes to it. What is written to the master side appears for reading on the slave side, and vice versa. In addition all the ioctls for changing line discipline etc. are available on the file descriptors on the slave side.

In short, you could say that a pseudo terminal enables you to simulate a real terminal using software.

  • That's half - it doesn't help with distinguishing virtual terminals from pseudo-terminals. Also, there's no links to the information cited. – Thomas Dickey Apr 15 '17 at 10:56
  • I was piggybacking on @lliagre's answer, which covered what a Virtual Terminal is. A terminal (real or virtual) and a pseudoterminal are different concepts. A virtual terminal is a software implementation of a real terminal, i.e. software that functions like a real terminal, but instead of using external harware components, uses a windowing system window (for example, an X11 window) for output and simulates a keyboard using the input events of the windowing system. A pseudoterminal is essentially a kernel software component ("driver" if you wish) that implements POSIX Terminal I/O. – Johan Myréen Apr 15 '17 at 11:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.