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.






Judging by your post, you have virt-manager running on OS X. How did you get it running?
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.
Oh man thanks so much for posting this!
A quick fix to a super annoying issue!
-b
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