Adding Virtual Consoles under FreeBSD

First of all, if you aren't smart enough to do this by reading the FreeBSD FAQ Entry written for this procedure, you are probably in trouble. Yet, this document will remain true to the spirit of this page, providing you step-by-step examples for neanderthals.

1. Determine how many virtual consoles you want to use.

By default, FreeBSD has 4 defined, three of which are "on". These are accessed by hitting ALT-Fx where x is the number of the virtual console. So, the default setup allows you to switch between ALT-F1, ALT-F2 and ALT-F3. If you are using X, it will default to ALT-F4, or ttyv3.

This document will assume that you want to enable all the F-keys up to F12. If you want fewer virtual consoles, don't add as many ttyvx entries.

2. Edit the file /etc/ttys.

You will see some default entries for your tty entries. An unmodified /etc/ttys file generally has this info at or near the top:

ttyv0   "/usr/libexec/getty Pc"         cons25  on  secure
# Virtual terminals
ttyv1   "/usr/libexec/getty Pc"         cons25  on secure
ttyv2   "/usr/libexec/getty Pc"         cons25  on secure
ttyv3   "/usr/libexec/getty Pc"         cons25  off secure

3. Add lines for your new virtual terminals:

ttyv0   "/usr/libexec/getty Pc"         cons25  on  secure
# Virtual terminals
ttyv1   "/usr/libexec/getty Pc"         cons25  on secure
ttyv2   "/usr/libexec/getty Pc"         cons25  on secure
ttyv3   "/usr/libexec/getty Pc"         cons25  on secure
ttyv4   "/usr/libexec/getty Pc"         cons25  on secure
ttyv5   "/usr/libexec/getty Pc"         cons25  on secure
ttyv6   "/usr/libexec/getty Pc"         cons25  on secure
ttyv7   "/usr/libexec/getty Pc"         cons25  on secure
ttyv8   "/usr/libexec/getty Pc"         cons25  on secure
ttyv9   "/usr/libexec/getty Pc"         cons25  on secure
ttyva   "/usr/libexec/getty Pc"         cons25  on secure
ttyvb   "/usr/libexec/getty Pc"         cons25  off secure

This is pretty straightforward. If you can't comprehend what I just did, use your cut and paste features. When you are done editing /etc/ttys, save it.

4. Create some extra vty devices.

We have to create more devices for our new virtual consoles. As root, do this:

# cd /dev
# ./MAKEDEV vty12

5. Restart init on-the-fly.

Init is process #1. As root do this:

# kill -1 1

6. Test your work.

Hit ALT-F5. If you get a virtual console prompt, try ALT-F12.

NOTE: If you are in X, use CONTROL-ALT-F5 and CONTROL-ALT-F12.

You should get a beep and nothing else on F12. Test the rest of your virtual consoles. If you have failed to get it working, you better double-check The FreeBSD FAQ Entry because "it works on my machine."

FreeBSD for the Lazy and Hopeless