Saturday, May 10, 2014

Fedora on a Mac: Change Cmd Key to Ctrl Key

I am running Fedora 20 on Virtualbox on a Mac.  This works pretty good provided that I use XFCE or LXDE and turn fancy desktop animations off, because the Mac version of Virtualbox doesn't do any video acceleration.

My prime annoyance is that the Linux Copy and Paste uses the Ctrl key, while the Mac uses the Command key.  This requires a hand shift when I copy and paste from the VM to the host.  A simple solution is to map the Linux VM Command key into another Control key, using xmodmap.

Create ~/.Xmodmap:
remove mod4 = Super_R 
remove mod4 = Super_L 
add Control = Super_R 
add Control = Super_L

Add a line to .bashrc:
xmodmap .Xmodmap

and apply the change by executing:
# xmodmap .Xmodmap

Now, in the Virtualbox configuration, change the Host key which is by default Command Left to something else.  I simply selected Command Right

From now on, I can copy and paste with the same key combination between the VM and the host with my left hand, without upsetting my muscle memory.

No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.