24

I'm currently running a VirtualBox of Arch Linux with Windows 7 x64 as the host. In Arch, I use dwm for window management. As dwm is heavily dependent on hotkeys, I've used the Alt key as its META key to prevent conflict with the Windows 7 host. However, when using Emacs (also heavy hotkey usage) within dwm, there are issues because it's also using Alt for its own META.

I'd like to change either dwm or Emacs to use the windows key as META, but commands such as Win+L will be captured by the host machine and lock my system. Is there any way to prevent these hotkeys from being triggered while within VirtualBox?

3 Answers 3

21

I had the same problem (Linux guest in Windows host with wmii windows manager). This registry hack works perfectly.

Open up regedit.exe through the start menu search box, and then browse down to the following key, creating it if it doesn’t exist:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

On the right-hand side, create a new DWORD 32-bit value named DisableLockWorkstation and give it one of these values:

• 1 – Disable Lock Workstation
• 0 – Enable Lock Workstation

The changes should be immediate, no need to restart anything.

5
  • +1 this worked for me on Windows 7 64-bit Nov 20, 2010 at 5:49
  • Works on Windows 10 too, nice
    – Hubro
    Jan 13, 2016 at 13:50
  • 1
    No idea why my edit was rejected but if you need permissions to create this key, you'll need to start regedit as an administrator. HKCU will now refer to the admin so find your user's hive in HKU\[your SID]. To get your SID, run Powershell and type "wmic" then "useraccount where name='your_username' get sid". From there, follow the instructions as above, just in HKU\[Your SID] instead of HKCU. Unfortunately, doing this disables the ability to lock entirely. An alternative is to instead disable Win+key hotkeys with a DWORD NoWinKeys=1 key in this same place.
    – sraboy
    May 30, 2016 at 0:17
  • 5
    This will completely remove the lock feature though, not just the hotkey for it, which may not be ideal
    – Eldamir
    Feb 14, 2017 at 12:37
  • I had to create the System key for this to work. As this is global I also created two registry scripts for values 1 and 0 so i can disable and enable when needed.
    – elig
    Jun 27, 2020 at 17:49
11

Had exactly the same problem, deactivating the Auto-capture keyboard worked for me.

File > Preferences > Input > Auto-capture keyboard

2
  • Does not work for me, unfortunately
    – St.Antario
    Jan 7, 2020 at 12:58
  • Finally the control+windows+arrow doesn't stuck on the desktop with the VM. You saved me.
    – thanos.a
    Apr 20, 2020 at 14:55
3

Win+L works in the guest for me under an XP host. However, with security being increased in Windows 7 I suspect that the "Lock Screen" and "Task Manager" hotkeys (Win+L and Ctrl+Shift+Esc) are given the same status as the Secure Attention Sequence (Ctrl+Alt+Del) and can't be overridden by an application. Presumably other non-security-critical hotkeys such as Win+E work in the guest not the host?

1
  • 2
    I just tested a WinXP guest on Win7 host - the Winkey+L does in fact "lock" both the host and guest. It didn't seem to matter if the guest was in full screen mode or not.
    – Goyuix
    Jul 18, 2010 at 14:38

You must log in to answer this question.

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