The Be Sure Blog

Code Snippets | Problem Solving | Tips & Tricks

The Be Sure Blog banner

Configure Kali to use the MacBook keyboard

posted on 15.8.2023 by Below Surface in "Kali Linux"

Step 1: Do the basic layout configuration

sudo apt install keyboard-configuration
sudo dpkg-reconfigure keyboard-configuration


MacBook/MacBook Pro

Select your language layout, then hit enter for the following options, or select something other than the default if needed.

Step 2: Make the cmd button work, as it would in MacOS

sudo nano ~/.Xmodmap

Paste this code:

clear control
clear mod4

keycode 105 = keycode 206 =

keycode 133 = Control_L NoSymbol Control_L keycode 134 = Control_R NoSymbol Control_R keycode 37 = Super_L NoSymbol Super_L

add control = Control_L add control = Control_R add mod4 = Super_L

Save and close the editor with

ctrl + o
ctrl + x

Then run the file to test it:

xmodmap ~/.Xmodmap

And if it works for you, add it to the system startup:

sudo nano /etc/init.d/

Add this code:

xmodmap ~/.Xmodmap

Then save and close the editor. Run:

sudo chmod +x /etc/init.d/

Then add it to cron:

crontab -e


@reboot /etc/init.d/

Save and exit, optionally test:

crontab -l

Restart the machine, and see if it the cmd key still works as desired!

Step 3 would be to make the @ button work, but this is still work in progress.


cmd key
keyboard layout


More posts of this category

Installing Kali Linux on a 2012 Macbook Pro

How to switch from MacOS to Kali Linux on the A1398

Kali Linux

Installing Postman on Kali Linux

Follow these steps to install the API testing tool on Kali

Kali Linux

Installing Google Chrome on a Kali Linux machine

How to install the Google browser on Kali

Kali Linux