Remapping keys on a virtual server

I am running the Ubuntu virtual box on my Mac using Vagrant (which uses VirtualBox under the hood). I would like to reassign the cap lock key to escape when I entered the virtual box but left it unchanged. I tried using xmodmap while I was logged in as described here:

http://ubuntuforums.org/showthread.php?t=263385

When I run xmodmap, I get this error:

xmodmap: unable to open display ''

I have a feeling that this is due to the fact that I basically move away into the virtual box, but this concerns my understanding, and I am certainly mistaken too. Is there something I can do to make this work?

+4
source share
1 answer

Log in to the terminal on ubuntu, set DISPLAY = localhost: 0.0 then run xmodmap in that terminal, on vm.

The X mapping is performed in two parts: the client program, xterm or xmodmap and the server, the process talking to the (virtual) display. xmodmap tells x to interpret keys in different ways.

You would do this as if you were sitting on a machine that works with ubuntu directly. Xmodmap happens on vm and modifies the x server running on the virtual machine. ... as stated above.

If you were in ssh in vm, the key must correctly set DISPLAY. This should tell Xmodmap where to find the server x.

Sorry I don’t have time to check this exact situation. Comment with questions. -Chris

0
source

Source: https://habr.com/ru/post/1415142/


All Articles