Is there a way to "redirect" a click on a URL in a VirtualBox guest to open in the host OS browser?

I'm using VirtualBox OSE on Ubuntu 10.04.

I have a Windows 7 guest VM which I use almost exclusively for MS Outlook to access my Exchange mailbox. If I click a URL in Outlook it obviously opens in IE in the guest VM, is there any way to have it perform a redirect of some sort?

If I click a URL inside the VM, I want it to load in my default browser in the Ubuntu host.


Solution 1:

If there was such a way, it would be an enormous security hole.

The most you can do is use the Shared Clipboard: With Guest additions installed, the clipboard of your guest OS can be shared with your host OS.

Solution 2:

Theoretically yes. You could have a stub handler within the guest send a message to a daemon running on the host which actually invokes the proper application. I've never seen such a setup myself though.

Solution 3:

I had the same idea as Ignacio Vazquez-Abrams and I implemented it.


So the first part of this is an HTTP server that listens to requests on the machine where you want to open the browser. On an incoming request it opens (in a browser) the URL given as an argument of a POST request.

Pick one:

  • Python script, no dependencies: browser_daemon.py
  • Python script, requires Flask: browser_daemon_flask.py

You should add this script to startup, it's supposed to run in the background.


The second part is something that invokes the request.

Pick one:

  • Shell script, requires curl: open_url.sh
  • Python script, no dependencies: open_url.py

You should designate this script as your default browser. How to do that is... a separate question. You can search for something like "windows set custom executable as default browser".

It can also be used as a command line tool: ./open_url.py 'http://google.com/'


The Python scripts should work on all major systems with any reasonably recent Python version (I suspect 2.6+, 3.1+).

On Windows, if you don't want a Python script to run in a command window, you should change its extension to .pyw. Use Task Manager if you want to stop it (look for pythonw.exe).

VirtualBox network adapter should be set to NAT (default setting). More about the IP address here. The choice of port is arbitrary, feel free to change 1337 to something else everywhere.

The server is secure because it listens only to connections from localhost. VirtualBox makes it work somehow. But if you want this to work remotely, specify the listening IP address as '0.0.0.0' or '' instead of 'localhost'.

Solution 4:

If you're using Google Chrome as your browser on both OSs, push browser may help: http://pushbrowserapp.com/

It's basically an extension that lets you send tabs from one device to another, currently supporting Chrome and iOS devices. In your situation, you'd click the link in Outlook, it'd open in Chrome in the VM, you'd click the push browser icon, and the tab would open in Chrome on your ubuntu machine.