Sunday, May 24, 2009

[QnA] How to increase the number of tty in Ubuntu

Because I like to work in virtual consoles (ttys), sometimes I feel only six ttys is not enough. But, how to increase more ttys than the default number, i.e. six, given by Ubuntu? I found there are many tty* in /dev, so I guessed there should be some way to ``enable'' these virtual consoles.

After searching on the internet, I got some information:
  • To open a tty, the file /etc/inittab is the key
  • Ubuntu has no inittab, which has been replaced by the files in /etc/event.d
So, I listed all the files in /etc/event.d and found there are files named from tty1 to tty6. Then I check the contents of these tty* files and found all of them have almost same setting inside, like the follows.

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/getty 38400 tty1

Ah, the rule emerged. I copied the tty6 to be tty8 to tty12 (tty7 is for the GUI desktop, as I know...), then replaces the string ``tty6'' in all the copies to their corresponding tty number. Finally, I have 11 virtual consoles, i.e., tty1 to tty6 and tty8 to tty12.

2 comments:

  1. Anonymous3:42 AM

    For 12.04 (Precise) the tty#.conf files are in /etc/init. Everything else works.

    ReplyDelete
    Replies
    1. Thank you for the info. :-)

      Delete