I'm trying to write a simple upstart script for my ubuntu server, which starts vnc4server. But it does not work.

Here's the script:

# vnc-server.conf

start on runlevel [2345]
stop on runlevel [016]

        su skerit -c 'vnc4server :0 -geometry 1024x768'
end script

post-stop script
        su skerit -c 'vnc4server -kill :0'
end script

#End of File

The command in the first script block works fine when executing it in the terminal, but running start vnc-server does not have the same effect.

  • check dmesg for more detail.
    – accuya
    Feb 1, 2013 at 6:49

2 Answers 2


Even though the documentation I've read says upstart shouldn't work this way, I had to place the command in a 'post-start script' block in stead of a regular 'script' block.


post-start script
        su skerit -c 'vnc4server :0 -geometry 1024x768'
end script

That did the trick


Could it be a PATH issue? Try giving the full path to vnc4server in the script. You can find the full path through

which vnc4server

Disclaimer: have not used upstart.

  • Hmm, I've changed the command to /usr/bin/vnc4server, but it still does not work. So that's not it I'm afraid.
    – skerit
    Mar 20, 2012 at 17:28

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.