6

I often find it convenient to work entirely from the command line, and like to have several tty "consoles" open simultaneously.

How do I make my system default to having more than the traditional 6 tty consoles (CTRL-ALT-Fn)?

Also with the transition to SystemD and Gnome, has the tty console number actually drop? I seem to struggle sometimes opening even one, let alone several, and often end up with a behavior in which several (CTRL-ALT-Fn) combinations all lead to a GUI rather than a tty.

I am running a combo of Ubuntu 18.04 and 18.10 across several machines, if it matters.

  • 2
    You may want to explain why you prever virtual terminals over multi-tabbed windows of a X terminal application. With those, you can easily have as many as you like (I usually have about 20 tabs of xfce-terminal running, spread over ~three windows on each of five workspaces). – leftaroundabout Mar 10 at 0:13
  • 2
    @leftaroundabout Why? I just prefer it most of the time! Most of the time the GUI remains unused, and lonely, sitting at the login screen. – haziz Mar 10 at 0:14
  • Not saying I'm not prone myself to this kind of stubborn behaviour, but it does seem objectively irrational. – leftaroundabout Mar 10 at 0:22
  • @leftaroundabout I am actually not being stubborn. About the only "killer app" for the GUI, as far as I am concerned, is the web browser, and very occasionally a photo library/photo editing tool (and Adobe Lightroom and my birdwatching database app are about the only applications still preventing me from dumping Windows/Mac completely). Most of the time I am inside Emacs at the command line, with the occasional use of ssh, gcc, scheme REPL etc. almost all from the command line. I would have browsed the web from the CLI if the CLI web browsers were more usable (which even I admit they are not). – haziz Mar 10 at 0:28
  • 2
    Well, my point is, {X|gnome|kde}-terminal is a killer app for the GUI as well! I often do everything in the terminal as well, but I still wouldn't want to miss the window manager for easy organisation of the terminal tabs and -windows. – leftaroundabout Mar 10 at 0:37
14

Before answering your question, I would rather point you to use something like screen or tmux.

But if you insist on using ttys, you can spawn a new one with:

sudo systemctl start getty@ttyN.service

with N being a number not already in use.

You could change the default number of ttys started at boot (6) to something else by editing /etc/systemd/logind.conf and uncommenting the first line and change the number 6 to something else like:

[Login]
NAutoVTs=7

Source: https://wiki.archlinux.org/index.php/Getty

  • I did tinker with tmux, briefly, a few years ago. I did not find it particularly intuitive. Swapping between several tty consoles, is however, brain-dead simple. I know it sounds strange coming from a die-hard Emacs fan! – haziz Mar 9 at 22:30
  • 10
    @haziz: The advantage of tmux is not that it is intuitive. It is that you can SSH into it, and then it will protect your shell(s) from accidental SIGHUP on disconnect (if the internet drops). – Kevin Mar 9 at 23:44
5

You cannot, short of recompiling the kernel.

But that is not what you really want.

No, I'm not going to try to sell you on switching to some other way of doing things, as others have here. The question that you have formulated has a fundamental error in its premise.

You have 63 kernel virtual terminal devices available. Always. To change this would involve recompiling the kernel, and possibly dealing with knock-on effects caused by assumptions in the rest of the operating system about the major and minor device numbers. But I suspect that this is far more than enough for you.

What you actually want to change is the number of TTY login session services that are started on your system. Not all of those 63 terminal devices have a TTY login session service started against them. You want more login sessions.

Yes, the behaviour has changed with systemd. TTY login services are now ordinary services, like any other — an innovation from AT&T System 5 Release 4 back in 1988 that the Ubuntu world first gained with Upstart.

Nowadays on Ubuntu systemd-logind starts TTY login sessions on demand, as each kernel virtual terminal is activated by the key chords that switch amongst KVTs. There are controls in its configuration file that place an upper limit on the KVT number for which it will do this, and that can force a particular numbered KVT to always have a TTY login session started.

But of course you can manually start and enable the autovt@name services.

That several KVTs show a GUI is not really anything to do with systemd, in contrast, and everything to do with the fact that that is how multiple users are logged on with GUIs. Each GUI session has a KVT, so that it can coöperate with the KVT switching and HID sharing. If you have more than one logged in GUI session (at least one being devoted to the GUI login subsystem itself) then more than one of the KVTs is claimed.

(I had a user of my softwares who likewise found the TUI WWW browsers not up to the job, in this particular case of reading DocBook doco, as the GUI WWW browsers can. So I wrote a tool. ☺)

Further reading

0

I am just coming to answer one part of your concern, and as I can't yet comment, I am adding it as an answer.
Your concern that Ubuntu has fewer ttys is due to the fact that the GUIs where moved to tty1 (ctrl + alt + F1) and tty2 (ctrl + alt + F2) instead of F7 and F8, there are still the same amount of ttys by default.
To create a new tty, I would try the answers provided by the others here.
Good luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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