Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How configure VirtualBox shortcuts to switch between virtual computer and host with single key combination on windows 10

In practice it's always possible with first pressing host button while virtual computer has keyboard focus and then pressing usual windows 10 shortcut ctrl + windows + left/right.

Is it anyhow configurable on Virtualbox to add a shortcut that captures a key combination and switch between windows workspaces, while Im using the virtual computer on full screen mode. Vitualbox itself captures many of the keystores like host+F, host+L, host+E, etc. Can I somehow add a shortcut similiar to these to switch back to windows and go to another workspace with a single key combination like host + alt + left/right


Update: Apparently depending on the touch-pad model, as long as it supports multi-finger gestures like 3-4 finger swipes, the touch-pad can be used to switch between VM and host no matter who has the keyboard and mouse focus. So this can be a OEM dependent feature. (Tested with Microsoft Surface)

like image 381
Kaan O Avatar asked Sep 11 '15 07:09

Kaan O


2 Answers

Does one of these works for you:

  • Host key + m, minimize virtualbox os window,
  • Click Host key once and release to let the vm lose focus, then Alt + Tab, switch to a window of residing os,

Tips:

  • The Host key is used to transfer focus to residing os, on windows or linux it's right Ctrl by default.
  • If the vm already lose focus, then you don't need to press the Host key first, otherwise you need to press once & release, to transfer focus back to residing os.
  • If you switch back to the vm again via Alt + Tab, then vm will get focus again, then to get back to residing os, you need to press Host key again.

The virtualbox Auto Capture Keyboard option

(from File -> Preference -> Input).

Behavior:

  • If checked, then you need Host key to return focus to residing os, just as described above.
  • If unchecked, then vm is just treated as a simple window in host. You can use Alt + Tab to switch to a window from host anytime, without press the Host key first. But, you also can't switch within windows inside the vm, via Alt + Tab any more.

Which to use:

There is a trade off, it depends on what you use the vm for to decide whether check it or not.
In my case:

  • When I am using Windows vm on a Linux host.
    In the Windows vm browser with proxy is the only thing I need most of the time, and most of the time I am on Linux host.
    So I uncheck it, so that never need to click Host key to get back to Linux host.
  • When I am using Linux vm on a Windows host.
    Actually most of the time I am working on the linux vm, and sometimes need to go to the Windows host.
    So I check it, so that I can switch between windows of Linux vm via Alt + Tab, and when I need to go back to Windows host, I click Host key first or use mouse.
like image 95
user218867 Avatar answered Sep 19 '22 22:09

user218867


No, sorry. What you need is some way to trigger VirtualBox actions from within VirtualBox (e.g. VBoxClient minimize), but that doesn't exist as far as I can tell.

There are a few super janky ways to accomplish this:

  • Share a folder shared between host & guest. On the guest, switch-workspace && touch shared/foo. On the host, whenever shared/foo is modified, minimize VirtualBox.
  • Get port forwarding between guest and host, communicate that you want VirtualBox to be minimized.

Those are both pretty high-effort projects just to save an extra keypress, though.

like image 21
Brian Malehorn Avatar answered Sep 17 '22 22:09

Brian Malehorn