2

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.

2 Answers 2

5

the issue is the description is a bit misleading (for me as well) ..
ctrl_L .. doesnt mean ctrl+l but the left! ctrl button

so you just have to press ctrl + alt (without any other char) on the left side of the keybord

1
  • They should revise their UX... it's crazy... I tried for quite a while to use left ctrl+alt+L. I was ending up killing the process from a ssh remote session.
    – Nordes
    Jul 24, 2019 at 3:47
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .