On one system make a daemon that listens to requests and opens URLs in a browser.
On the other system set your default browser to something that invokes such a request.
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:
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:
You should designate this script as your default browser.
In KDE: Default Applications → Web Browser
It can also be used as a command line tool: ./open_url.sh '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'
.
1What is your actual question as it seems very broad? – Dave – 2012-09-12T08:29:03.243
Clarification: Are you saying, “When I am in Guest Gnu/Linux web-browser, and I click a specific link, then minimise the guest, maximise the host web-browser, and open the specific page”. Or “When I am in Guest Gnu/Linux web-browser, and I click a specific link, open a page hosted on the host.” Or how to I browse host files from guest, Or something else. – ctrl-alt-delor – 2012-09-12T08:35:59.483
not in guest web browser, kde has got default browser app, I want to make it the host's browser. – cnd – 2012-09-12T08:38:41.193
You are going to have to tell me what you want, I can't guess. So 1) KDE has an tool to set the default web-browser. is that correct? 2) You want the host to use the some browser, as set up in guest kde. is that correct? – ctrl-alt-delor – 2012-09-12T08:45:23.623
>
Can you write some use cases e.g. setup: In guest, default web-browser is set to some special tool that I wrote. Case: user clicks on a link outside of a web-browser, the special tool causes the page to be loaded in hosts web-browser, and focus to be switch to host web-browser. – ctrl-alt-delor – 2012-09-12T08:58:36.523
@richard added to question – cnd – 2012-09-12T09:04:07.413