How to I prevent the screen from locking when I want a virtual machine to ungrab my mouse?

223

Solution 1

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

Solution 2

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:
223

Related videos on Youtube

Mak
Author by

Mak

Updated on September 18, 2022

Comments

  • Mak
    Mak almost 2 years

    1. I want to know the Directory structure of Android.
    2. Which is the necessary Android directory & files to be display to Android User and which is not ?
    3. What if we have to show data of Android phone memory or what if data of sdcard or external memory ?

    Thanks in Advance...

  • Nordes
    Nordes almost 5 years
    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.