Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I automatically run Firefox on an Ubuntu Server inside the Amazon EC2 cloud as soon as the server starts up?

I know how to create my own AMIs and all that jazz. I just need to know how to auto-start firefox.

The Ubuntu Edition is 8.04 Hardy. The server environment is Amazon EC2.

share|improve this question
Didn't you ask the pretty much same question here? – Sideshowcoder Feb 18 '10 at 9:32
Yes, and it got plagued with confusion! My apologies, I am a native windows user, I didn't get the terminology correct. – darkAsPitch Feb 18 '10 at 10:37
Justin asked a question on your original post that you didn't answer : what are you trying to accomplish ? Why do you want Firefox started automatically ? Chances are, there is a better and less complicated way of doing what you actually want than this one. – François Feugeas Feb 18 '10 at 12:02
re:defraagh, well then how could I automatically run a virtualbox machine or any other GUI related program on linux startup. Nevermind the fact that I said firefox. – darkAsPitch Feb 18 '10 at 16:24
The question you should answer (or ask yourself) is where is your display (monitor, keyboard, mouse) that will be used by your graphical app. – Diego Torres Milano Feb 18 '10 at 16:31
up vote 1 down vote accepted

Judging from the comments to the original question, and you just want some sort of GUI, isn't vnc-server the obvious solution?

share|improve this answer
You can script vncserver to launch upon start up...or cron it, or whatever you want. – Matt Simmons Feb 18 '10 at 19:35

Well, you could add the line

/usr/bin/firefox &

to the file


That's the literal answer. Whether that does anything useful, well....

share|improve this answer
Or in .bash_profile if it is for a particular user upon log-in; might be useful to test whether the session supports X windows.. – PP. Feb 18 '10 at 14:33
Paul, do I not have to specify a user account as well? I tried this, rebooted, and still firefox only starts when I login via NX server, not on system boot. – darkAsPitch Feb 18 '10 at 16:22
This would start Firefox as the root user. – Ernie Feb 18 '10 at 18:06

Would an init.d script launching gnome-session as the user who has firefox as a startup program work?

share|improve this answer

If you are using gnome. system > preferences > start up applications

add firefox and it will start with that session every time you login. Just like windows.

share|improve this answer
You are right, it will start if I actually connect to it graphically. I need the GUI/Gnome part of ubuntu to start whether I connect to it or not. This seems to be pretty tough on linux. It's easy as pie in windows - GUI starts up whether I am viewing it or not. – darkAsPitch Feb 18 '10 at 17:52
Sorry. I'm having a very hard time getting my head around what you're trying to accomplish. Do you want to export that display (firefox) out to another console. – egorgry Feb 18 '10 at 21:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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