Apple’s X11 Keymap and virt-manager 4

Posted by peter on June 01, 2009

Apple’s default X11 key mapping causes trouble when using virt-manager on the local X server. For reasons unknown to me, Apple maps the option/alt key to Mode_switch, meaning that when virt-manager grabs the cursor, it’ll never let go, as there’s no way of sending Ctrl+Alt to it- apparently it works explicitly off of keysyms instead of mod maps. It’s been long enough since I’ve dealt with X11 configuration issues that I had to do a little hunting to figure things out, so I figured I’d throw my solution up here.

On the machine where you’ll be running your X server (your mac), stick this in ~/.Xmodmap-

clear Mod1
keycode 66 = Alt_L
keycode 69 = Alt_R
add Mod1 = Alt_L
add Mod1 = Alt_R

This will make the control keys on your keyboard emit (I think) more sensible events, while keeping Mod1 in the same place. Finally, no more restarting X11 when you want to break free of virt-manager.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. Tim Kersten Sun, 06 Sep 2009 04:52:16 UTC

    Judging by your post, you have virt-manager running on OS X. How did you get it running?

  2. peter Tue, 08 Sep 2009 20:30:18 UTC

    I did try this, but ran into enough trouble building the requisite libraries that I gave up on the idea for now (trouble building libvirt). I’m just using virt-manager via SSH and X11 forwarding. Hardly snappy, but works well enough on the links I’m dealing with.

  3. bbeausej Sun, 14 Mar 2010 12:33:08 UTC

    Oh man thanks so much for posting this!

    A quick fix to a super annoying issue!

    -b

  4. Libok Zhou Mon, 15 Mar 2010 18:52:25 UTC

    Hi, Peter.
    It works perfectly, Thank you so much:)

    Also, I’ve re-post this on my own blog:
    http://libok.cn/blog/?action=show&id=293

Comments