VirtualBox

Opened 15 years ago

Last modified 7 years ago

#4208 new defect

Command-Q not passed to client OS

Reported by: Gil Pinheiro Owned by:
Component: other Version: VirtualBox 2.2.4
Keywords: Cc:
Guest type: Linux Host type: Mac OS X

Description (last modified by Frank Mehnert)

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 (11)

comment:1 by Dylan Justice, 14 years ago

Also applies to Linux host.

comment:2 by mackyle, 13 years ago

Still a problem in VirtualBox 4.0.6

comment:3 by dgatwood, 12 years ago

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 by nnyby, 10 years ago

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

comment:5 by Frank Mehnert, 10 years ago

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.

in reply to:  5 comment:6 by rcobbe, 10 years ago

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 by rcobbe, 10 years ago

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 by Calion, 9 years ago

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 years ago by Calion (previous) (diff)

comment:9 by colons, 9 years ago

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 by nitrous, 9 years ago

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.

comment:11 by crystalbrittle, 7 years ago

This is still a problem in MacOS 10.11.6 El Capitan with Xubuntu linux and VirtualBox 5.1.28. Is there any way to nudge someone to take ownership of this issue? This is an pretty annoying workflow hinderance that is keeping me from switching to VirtualBox from VMWare (Would love to finally ditch VMWare! :-) )

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use