Saturday, October 16, 2010

Reduce number of virtual terminals (TTYs) in Lucid


Most Linux distributions come with several (usually six) virtual consoles enabled by default. Think of it as having six terminal windows you can flip through using (CTRL)+ALT+F[1-6] keys. Sometimes you don't need or want to have that many TTYs. Let's say you have very little RAM, or want to shave a fraction of a second from your boot time, or simply want to strip all that isn't necessary from your installation. Here's how you do it in Ubuntu 10.04 Lucid Lynx.

Let's say you want to leave only two virtual consoles, tty1 and tty2. simply go to /etc/init/ directory and delete, or better yet move to safe location, files tty3.conf, tty4.conf, tty5.conf and tty6.conf

$ cd /etc/init/
$ sudo rm tty[3-6].conf

Next time you boot, only first two TTYs will be present. Note, that this will also shift your X session to where tty3 would normally be, so you can access it by typing ALT+F3 instead of ALT+F7.