How to enable multiple virtual consoles on linux?

I'm new to linux so I have no clue how to do this (couldn't find it on the web). I'm running a LAMP Virtual Machine and when I press ALT-F2, F3 etc.. to use a Virtual Console I get a blank screen (all black to be exact) not a login option, so the question is how can I enable multiple consoles for my system?

The linux I'm running is this LAMP Virtual Appliances, Linux lamp 2.6.24-18-virtual (It says Ubuntu but I don't know the version).

I don't know if this helps but I can connect by SSH from the host computer.

Thank you, Rodrigo.


Solution 1:

I am not familiar with that virtual appliance but given the kernel version, it seems like it is based on a 8.04 version of Ubuntu. It is probably using upstart. So you probably need to create files in /etc/event.d for each virtual console you want. You probably already have a file /etc/event.d/tty1 that you could copy to /etc/event.d/tty[2-6]. You'll need tweak the exec line for each file.

Of course you could also simply use GNU Screen and get a similar effect with additional features like being able to disconnect and then reconnect remotely.

Solution 2:

See man inittab (or /etc/inittab). You want to ensure that getty is installed

apt-get install (util-linux|mingetty|ngetty|rungetty)

and ensure that the /etc/inittab file has them running for your default runlevel. E.g.:

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

Solution 3:

I was having the same problem today, though instead of black screen when pressing alt+f2..12 it simply did nothing. I found the solution/answer on Wikipedia.

screen was not installed, so this was no option. I could however use the following command:

    openvt

Then to switch to the newly created Virtual Terminal, I could simply press alt+f2. Another openvt enabled alt+f3, etc. In case the alt+f1..12 keys doesn't work, use chvt n, where n is the virtual terminal you want to switch to (example: chvt 1). Using an invalid number, for example 3 when allocating only 2, gave a black screen for me. To switch back I could use alt+f1.

If you want to disallocate a virtual terminal, use deallocvt n, where n is the virtual terminal to disallocate. For some reason this always gives me "Device or resource busy" though.

Source: http://en.wikipedia.org/wiki/Virtual_console