MayADevBe Blog

A Blog about Computer Science

How to change the keyboard layout in Kali Linux

I recently used VirtualBox to install a Kali Linux machine on it. Because I have a German QWERTZ keyboard instead of the English standard QWERTY, the mapping of the keys was all over the place. This is why I had to change the keyboard layout in Kali Linux.

Option 1 - Use the Command Line

Because the key mapping is incorrect, using the console to write commands can be quite annoying. If you want to use the console, I would recommend simply copy/pasting the command.

$ setxkbmap -layout <countrycode>

You only have to insert the two-letter country code. For example us for English or de for German. Keep in mind that the standard shortcut for pasting in the terminal is CTRL+SHIFT+C (STRG+UpArrow+C).

Option 2 - Use the GUI

To prevent typing nonsense and needing to find the correct country code, you could also use the second option, which is to use the GUI.

  1. Go to the Kali Linux ‘Settings’ Kali Linux Settings

  2. Under ‘Hardware’ choose the ‘Keyboard’ option. Kali Linux Settings Keyboard

  3. Then go to the ‘Layout’ tab. Kali Linux Settings Keyboard Layout

  4. In the ‘Keyboard layout’ table click on the existing layout (by default English), click on edit and choose your language. Kali Linux Settings Keyboard Layout Language

I had a problem with this method. The layout would not update. If this is the case try to toggle the ‘Use system defaults’ button on and off again. For me, this updated the layout and my typing finally made sense.

Share on: