How to Enable and Troubleshoot Multiple Virtual Consoles in Linux (TTY2-6) for Ubuntu-based Systems


2 views

When working with a headless LAMP Virtual Machine (Linux lamp 2.6.24-18-virtual), you might encounter blank screens when trying to switch between virtual consoles using ALT+F2 through ALT+F6. This typically indicates either missing getty processes or misconfigured virtual terminals.

Linux systems normally provide 6 virtual consoles (tty1 through tty6) accessible via CTRL+ALT+F1 to F6. The graphical interface usually runs on tty7 (CTRL+ALT+F7). In your case, the virtual consoles beyond tty1 appear inactive.

First, verify which terminals are active:

ps aux | grep getty

You should see output similar to:

root      1234  0.0  0.1   1234   567 tty1     Ss+  10:00   0:00 /sbin/getty -8 38400 tty1

For Ubuntu-based systems, edit the inittab file (or create one if missing):

sudo nano /etc/inittab

Add these lines:

1:2345:respawn:/sbin/getty -8 38400 tty1
2:2345:respawn:/sbin/getty -8 38400 tty2
3:2345:respawn:/sbin/getty -8 38400 tty3
4:2345:respawn:/sbin/getty -8 38400 tty4
5:2345:respawn:/sbin/getty -8 38400 tty5
6:2345:respawn:/sbin/getty -8 38400 tty6

For newer Ubuntu versions using systemd, create override files:

sudo systemctl edit getty@tty2

Add these contents and repeat for tty3-tty6:

[Service]
ExecStart=
ExecStart=-/sbin/agetty -8 -o -p -- \\u 38400 %I $TERM

After configuration, restart the services:

sudo systemctl restart getty@tty2
sudo systemctl restart getty@tty3
# Repeat for all necessary TTYs

If consoles remain blank after configuration:

  1. Verify kernel messages: dmesg | grep tty
  2. Check framebuffer status: cat /proc/fb
  3. Test hardware acceleration: glxinfo | grep render

Switch between terminals using CTRL+ALT+F1 through F6. Each should display a login prompt. If issues persist, consider updating your virtual machine's display drivers or checking for conflicts with the hypervisor's console settings.


When working with headless Linux servers or virtual machines, virtual consoles (TTYs) become crucial for multi-session management. The standard Ubuntu/Debian configuration should provide 6 functional virtual consoles accessible via Ctrl+Alt+F1 through F6. However, in your LAMP virtual appliance based on Ubuntu 8.04 (kernel 2.6.24), these appear non-functional.

First, let's verify if the getty service (responsible for TTY consoles) is running:

ps aux | grep getty

If no getty processes appear, we'll need to manually configure them. For modern systems using systemd:

systemctl status getty@tty2.service

For older inittab systems (like your Ubuntu 8.04):

# Edit /etc/inittab (create if missing)
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
# ... repeat for tty4-tty6

For modern systemd systems:

# Enable additional TTYs
sudo systemctl enable getty@tty2.service
sudo systemctl start getty@tty2.service

Some VM configurations require additional parameters. For your LAMP appliance:

# Add to /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
sudo update-grub

While fixing the consoles, consider these temporary access methods:

# Create new screen session
screen -S admin

# Launch tmux for multi-pane access
tmux new -s workbench

After making changes, test with:

sudo systemctl restart getty@tty2.service
# OR for older systems
sudo init q

Check dmesg for console-related errors:

dmesg | grep -i tty