Linux X11 Keyboard Console – How to Switch to TTYs Without Function Keys

consolekeyboardlinuxx11

At the moment I have a keyboard which lacks function keys (F1 through F12), and I was wondering – is there a way I could switch to textual TTYs (and back, which might prove to be a problem if I were to use xmodmap)?

Best Answer

Assuming Linux, you can use chvt (as in sudo chvt N) to switch virtual terminal, where N is the number corresponding to the VT to activate. For example, sudo chvt 1 for the first VT, and sudo chvt 7 for the VT where you will most often find X running.

Note that chvt requires root privileges to do its thing, hence the sudo is necessary unless you are already logged in as root.

On Debian, chvt is provided by the packages kbd and console-tools; mine is the one from console-tools. Other distributions are likely similar.

By the way, this took me about 15 seconds to find by typing linux remap virtual terminal switch into Google. :-) I was expecting to find something to actually remap the switch to another key combination, but chvt answers your question just as well.

Related Question