Tuesday, December 11, 2012

virt-manager and xquartz

'ssh -X'ing to a Linux KVM machine, running virt-manager, and getting a VNC display to an OS X/xquartz box was problematic until I found http://blog.loftninjas.org/2010/11/17/virt-manager-keymaps-on-os-x/  Turns out, the keymap isn't set and falls back to the OS X mapping, which I guess isn't compatible.  On OS X:
$setxkbmap -print
xkb_keymap {
        xkb_keycodes  { include "empty+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "empty(basic)"  };
        xkb_geometry  { include "pc(pc104)"     };
};
On an Ubuntu machine that worked:
~$ setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)"    };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete"    };
    xkb_symbols   { include "pc+us+inet(evdev)+ctrl(nocaps)"    };
    xkb_geometry  { include "pc(pc105)"    };
};
I didn't take the time to figure out which differences are important.  Instead, I did the suggested "virsh edit IMAGEID" and add "keymap='en-us'" to the "graphics" line.  This edits the "/var/run/libvirt/qemu/IMAGEID.xml" file.  Once this was done, I did have to destroy to the running instance and then start it; rebooting the guest didn't work.  I had also downloaded the newest xquartz from http://xquartz.macosforge.org/ so the alt key remapping can be done via the preferences.

No comments: