VirtualBox

Ticket #4208 (new defect)

Opened 6 years ago

Last modified 4 weeks ago

Command-Q not passed to client OS

Reported by: gilpinheiro Owned by:
Priority: major Component: other
Version: VirtualBox 2.2.4 Keywords:
Cc: Guest type: Linux
Host type: Mac OS X

Description (last modified by frank) (diff)

Certain key combinations are not being passed through to the client OS.

Usecase: Command-Q (in X11 as Meta-Q) to quit an application in the client OS results in the "Close virtual machine" dialog (and leads to a 'stuck' command key modifier after dismissal, until meta is pressed again).

Also see Command-H for another example of this problem

 http://www.virtualbox.org/changeset/1320 describes a fix, but from what I can tell has either not been applied, or does not work.

Partially related to Ticket #1668, but currently the exhibited behaviour is inconsistent with the behaviour of other keyboard combinations (i.e. pass everything to the client) - 1668 describes how passing through these key combos, if _optional_, may still be useful to some.

Change History

comment:1 Changed 5 years ago by dylanjustice

Also applies to Linux host.

comment:2 Changed 4 years ago by mackyle

Still a problem in VirtualBox 4.0.6

comment:3 Changed 3 years ago by dgatwood

Still a problem in 4.2 RC2. It's a royal pain in the backside. In particular, it absolutely removes the ability to skip the Mac OS X registration process (which until 10.7 or so could only be accomplished by hitting Command-Q). Very annoying.

comment:4 Changed 14 months ago by nnyby

Are there any solutions for this? This bug prevents me from quitting or restarting xmonad in a linux guest.

comment:5 follow-up: ↓ 6 Changed 14 months ago by frank

  • Description modified (diff)

You can change the corresponding shortcut setting in File / Preferences / Input / Virtual Machine. Enter 'q' in the search bar and you will find the setting for 'Close' action. This will at least prevent opening the close dialog when you press Cmd-Q. However, the real fix to your problem is to change the host key from Cmd to something else.

comment:6 in reply to: ↑ 5 Changed 14 months ago by rcobbe

Replying to frank:

You can change the corresponding shortcut setting in File / Preferences / Input / Virtual Machine. Enter 'q' in the search bar and you will find the setting for 'Close' action. This will at least prevent opening the close dialog when you press Cmd-Q. However, the real fix to your problem is to change the host key from Cmd to something else.

Unfortunately, this problem seems to be independent of the host key and the setting in the preferences box that you mention. I've set my host key to right-control, and I get the described behavior when I hit right-control-Q and when I hit cmd-Q (using either command key). If I remove the setting for Close in File/Prefs/Input/Virtual Machine, then right-control-Q gets passed through to the guest OS, but cmd-Q is still intercepted by VirtualBox.

(VirtualBox 4.3.12 r93733, host OS MacOS 10.9.3, guest OS LinuxMint 17 x86_64)

comment:7 Changed 14 months ago by rcobbe

I wonder if this might explain why changeset 1320 didn't fix the problem:

When I'm in the VirtualBox VM application (as opposed to the VirtualBox manager) and I go to the host OS's menu bar and open the VirtualBox VM menu, I see Cmd-H, Cmd-Opt-H, and Cmd-Q keyboard shortcuts listed for the "Hide VirtualBox VM", "Hide Others", and "Quit VirtualBox VM" menu options.

This makes me wonder if these shortcuts are registered with the host OS/Carbon/Cocoa/whatever in such a way that MacOS intercepts them before VirtualBox gets to decide whether to handle these key events itself or to pass them on to the guest OS.

Caveat: I've done almost no native MacOS development, so I really know very very little about how keyboard accelerators work on this platform. So I could be entirely wrong.

comment:8 Changed 9 months ago by Calion

It is at least possible to change the keyboard shortcut for "Quit VirtualBox VM" to something else than Command-Q via the Keyboard Preference Pane. That way, at least you don't accidentally bring up the Quit dialog for the VM every time you try to quit an application. To do so, choose "Other" from the bottom of the list of applications in the sheet, choose Show in Finder from the Dock icon of the VM while it's running, and drag it to the Open/Save dialog.

For this to work, I ended up having to change the Host key to something other than Left Command.

Last edited 9 months ago by Calion (previous) (diff)

comment:9 Changed 8 weeks ago by colons

I have had to rebind stuff in my guest away from cmd-q, cmd-h and cmd-shift-3 and -4 because the host steals them, which is messing with my muscle memory. There is nothing I can do about cmd-shift-3 and -4 without changing my screenshot shortcuts, too, which I really don't want to do.

Full-screen XQuartz gets this right.

comment:10 Changed 4 weeks ago by nitrous

This doesn't just affect cmd+h and cmd+q, but also cmd+alt+h, cmd+shift+h, etc. I have already changed the shortcuts to hide and quit from OS X, so I still have access to global OS X hotkeys. Please restore the behaviour from years ago where all key combinations can be passed to the guest -- you could add an option to pass all keys except host to the guest, so that users who prefer the current behaviour are happy too.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use