Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This happens in both KVM with virt-manager as well as VirtualBox.

The key combo to ungrab the mouse from KVM is Control-Option-L on my Apple MacBook Pro keyboard. Option on Mac keyboards is mapped to the PC-keyboard ALT key.

Control-Alt-L also locks the screen under Ubuntu Unity.

I cannot find a way to edit the key accellerator in either software package.

I don't think this is just the lock screen keyboard accellerator though, because VirtualBox does have a way to configure the ungrab keys. Because my keyboard doesn't have a righthand Control key. I use F1 to ungrab under VB. This also result in locking the screen.

share|improve this question

1 Answer 1

It sounds like your keyboard isn't either sending the correct keycodes or they're being intercepted by the desktop shell. You can verify that your key presses mean what you press by running xev in a terminal. Here's me pressing left ctrl + left alt on my happy hacker keyboard (PC).

KeyPress event, serial 36, synthetic NO, window 0x4a00001, root 0xbe, subw 0x0, time 675936933, (432,537), root:(2033,590), state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x4a00001, root 0xbe, subw 0x0, time 675937205, (432,537), root:(2033,590), state 0x4, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

You can change the key combo that locks the screen, it's under System Settings->Keyboard->Shortcuts->Lock Screen. You could completely disable it if you want.

QEMU/KVM, which is what's actually managing the VM, appears to have several options for setting focus grabbing defaults.

‘-alt-grab’ Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt).

‘-ctrl-grab’ Use Right-Ctrl to grab mouse (instead of Ctrl-Alt).

Now I'm not sure how you would tell virt-manager to keep this default but it is easy enough to grab the arguments it's using the run your VM, run it yourself from the CLI, and just add one of these switches to see if it addresses your problem. If it works, then write a simple script to start your VMs that way. Easiest thing to do is disable the screen lock shortcut and just use the gui to accomplish that. Good Luck.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.