[vbox-dev] Switching from the host to the fullscreen virtual machines using hotkeys

Fabien Meghazi agr at amigrave.com
Wed Feb 4 13:16:36 PST 2009


Hi all,

I'd like to achieve this goal with virtual box :

Having virtual box on a windows or linux host, and then being able to
assign a hotkey that would allow me to switch from the host to any
full screened virtual machine running.
Also, from the full screen virtual machine, I'd like to have a hotkey
to switch back to the host.

I asked the user list if it was possible right now but it seems not really :
http://thread.gmane.org/gmane.comp.emulators.virtualbox.general/5088

I was thinking about this and I had an idea of a feature in virtual
box that would allow to achieve such a goal and much much more.

The basic idea would be to allow scripting/programming vbox on the
host and also from the guests (via guest additions)

We would need a host api and a guest api.

On windows host, it would be possible to make a program in C, C++, C#,
python, ... via a vbox dll or also an activex object so it's also
possible to script it using cscript or whatever.
Maybe this api could be implemented via VBoxManage ? dunno.

For posix hosts, it would be basically the same, an .so that could be
linked when programming in compiled languages or binded for use with
any scripting languages.

So here's an example of code bound to a hotkey on the host:

<pseudo py code>
import vbox, gui
def select_vm():
   selected_vm = gui.display_choice( vbox.get_running_vms() )
   vbox.focus_vm( selected_vm )
</pseudo py code>

On the guests, the principle would be the same except that the "guest
api" would be provided by the guest additions.

Example of a jscript running with cscript bound to Win+Tab

<sample>
var vbox = new ActiveXObject("Sun.VirtualBox");
vbox.focus_host();
</sample>


I was talking here about trivial examples such as hotkeys
customization stuff, but of course a feature like that would allow to
achieve much more interesting goals !
It would bring advanced communication between host and guests and the
possibilities are only limited to the implemented apis. (ex: vbox
plugins )
I guess there might be a security problem because basically, any
malware on the guest could compromise the host and vice versa. But a
sort of "signed" handshake when initiating the api could resolve this
issue.


Please, tell me if this idea is crazy and if I should be banned from
vbox mailing lists for life.
Also, if such a feature already exists then I'll feel stupid but also
happy to learn about it ;-)


PS: my english is very bad, this mail is for sure very unpleasant to
read. I'm very sorry about that.

-- 
Fabien Meghazi

Website: http://www.amigrave.com
Email: agr at amigrave.com
IM: amigrave at gmail.com




More information about the vbox-dev mailing list