Is there a way that I can stop the Ctrl+Alt+F4 key combination from switching to a virtual terminal? I still want the other key combinations to switch to terminals - I just want to change the F4 one because I often use that keyboard shortcut in a Windows VM.

  • You can use Host + F4 to issue a Ctrl + Alt + F4 for the VM (assuming VirtualBox)
    – Lekensteyn
    Jun 23, 2011 at 16:31
  • You might be able to remove tty4 from the getty list, but not sure it wouldn't push 5, 6, 7, etc. down. If you can live with 1 VT, your X server, and a log window, you can probably cram it all into F1, F2, F3. I forget the file you edit, that's why this is a comment.
    – Broam
    Jun 23, 2011 at 17:26

2 Answers 2


You can modify the keymap, with the following command:

xmodmap -pke | sed -n 's/ = .*VT_4.*/ = /p' | xmodmap -

Tested on 14.04, and 14.10, and it works. To have the command work even after restart, use upstart. For additional ways, and info see here

  • Should this take effect immediately?
    – Mario
    Jun 23, 2011 at 22:09
  • Hmm, I executed this and ran xmodmap -pke | grep 'keycode\s*70' to verify it was gone. Ctrl-alt-F4 still switches to the terminal, and more interestingly, any time I switch to a TTY, the setting is reset. Please note, I ran the above in a gnome console window
    – Mario
    Jun 23, 2011 at 22:14
  • Uhm, it works for me. If disabled in the host, when executed in the guest it switch to the ubuntu guest vt4. If disabled also in the guest I have no effect at all.
    – enzotib
    Jun 24, 2011 at 5:42
  • I'm running Ubuntu 10.10 using compiz Window Manager. Not sure why this isn't working.
    – Mario
    Jun 25, 2011 at 14:35

On Gnome Wayland you can unset this keybinding for virtual terminal switching by setting this dconf property:

dconf write /org/gnome/mutter/wayland/keybindings/switch-to-session-4 "['']"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .