I need to run firefox on a remote host via ssh and keep process running even after ssh logout.

I already have tried these ways:

nohup firefox &
disown -h

But it seems these work only for the process without an X11 display, because these work fine with my scripts and I can keep my scripts running even after ssh log out. But I can't do the same for firefox.

How can I make this work for firefox too?


3 Answers 3


Basically it looks like you need a flexible (just an app, not a whole desktop) X session through ssh that you can resume at any time.

I use NX for that. I've also used during some time x2go, but I always come back to NX.

Some links worth to look at:

And a couple of tutorials about NX:


The problem is that X-Windows clients require a X-Windows server to display. When that connection goes away, it is the same as clicking the 'X' button in the window's decoration. I believe there was some experimentation on getting a X client to switch between X servers, but I don't believe it was working properly. If that did work, you could start an X server on the remote system, and just before you exit the ssh session, tell the X client (firefox) to move to the remote X server instead of your X11 Forwarded server (local). Beyond that, I don't believe that you will get this to work since the X11 protocols require a server to talk to.

  • So,basically you are saying there is no way out as the experiment didn't work properly? Jan 28, 2012 at 17:38

As @Arcege says, it's not something that will work in X-Windows, no. You could run a basic VNC server to do the same job but VNC acts as a desktop rather than in "seamless" mode.

  • how do i run basic server? Let me tell you that i have been given some space on cloud, to which I do ssh. I really don't have control on the kind of server running on the cloud.Further the cloud in behind a proxy and we can login to proxy only by creating a secure session via browser before getting connected to internet(outside campus).And i need to run twitter API for my project there even After I logout ! So please help me out Jan 28, 2012 at 18:05
  • Something like: vncserver -geometry 1024x768 -depth 24 will give you a very basic server, probably with something like twm as the window manager. Jan 28, 2012 at 18:10
  • Is there a way to somehow start firefox process as a child of init(or deamon) so that it doesn't die after the parent process(ssh session) is ended ? i also tried to run a script that starts firefox after 20 secs. but the script is able to start firefox only when I am connected to remote via ssh. if I logout then it can't start firefox 1 Jan 28, 2012 at 18:14
  • No, as @Arcege mentioned X-Windows is a client-server protocol. Firefox would need an X-Server to connect to. It will die as soon as it loses connection to the server (or if it could never establish one in the first place). Jan 28, 2012 at 18:17
  • 1
    An alternative, if you don't require graphics, would be to use elinks inside screen. Jan 28, 2012 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .