2

I have a linux box in my office. I left a firefox window open there and came to home. I'd like to access the firefox window over ssh from my home. Is it possible?

  • 1
    No. Next time use vnc. Or just kill firefox, then run again in vnc. I hope it saves its state. – Ipor Sircer Sep 20 '16 at 13:13
3

You'd need to start x11vnc or vino-server in that X session, port forward connections to that VNC server and attach to that.

For instance, with $pid the pid of firefox:

ssh -Y host vino-preferences

Enable sharing without prompt and set a VNC password.

ssh host

On the remote shell, run:

xargs -0a "/proc/$pid/environ" sh -c '
  exec env "$@"  /usr/lib/vino/vino-server --tube' sh

To start vino.

Note which port the vnc server is on.

Type ~C to bring the ssh prompt, run (here if VNC is on port 2)

-L 5900:localhost:5902

to setup the port forward.

Then one the ssh client, connect to that VNC server with:

vinagre :0

(use a different port than 5900/:0 above if the VNC port is already in use on the local machine).

It's a bit simpler with x11vnc:

Run vncpasswd on the remote host to set a VNC password and:

xargs -0a "/proc/$pid/environ" sh -c '
  exec env "$@" x11vnc' sh

And proceed as above for the port forward and connecting to the VNC server.

0

By default, no. Your running firefox instance is talking to the X server on your desktop.

Depending on your desktop it may have built in "desktop sharing", which is typically a built-in VNC server. You could connect to that and access your whole desktop remotely.

Alternatively there are solutions such as XPRA ( http://xpra.org/ ) which are "screen for X11"; you run the XPRA server, which creates an X server. Inside that you can run your firefox, xterm, whatever. And then attach to that server remotely. But this requires pre-planning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.