Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 11 years, 10 months ago. Modified 5 years, 2 months ago. Viewed k times. However, the VNC server on this VPS can only be started by logging in through SSH and typing the following command: vncserver :1 -geometry x -depth 16 -pixelformat rgb If I run this command on startup or as a schedule task, it won't start.
What are my options? Improve this question. Zero Zero 1 1 gold badge 4 4 silver badges 6 6 bronze badges. Have you tried to figure out why it won't start? Add a comment. Sorted by: Reset to default. Highest score default Date modified newest first Date created oldest first.
Install the VNC server. Launch vncserver for the first time to set up a password. Improve this answer. Stephen Jennings Stephen Jennings I'm getting the following error output gist. So as root you could do: su justin -c vncserver su bob -c vncserver This will create a. Finally, do the following: update-rc. Justin Buser Justin Buser 1, 11 11 silver badges 14 14 bronze badges. Doesn't work. I can't connect.
Boy, Linux is really making want to run back to Windows and embrace it like an old lover. Ack, I didn't see the date on the post. Jeezm I wish SE would mark ancient answers more clearly Worked well for headless ubuntu linux box. Jim Jim 6 6 bronze badges. From what I can gather, the question is about powering up vncserver on startup, not user login. At the end, this is the least complicated solution if you can afford it — brasofilo. Papou Papou 4 4 bronze badges. Peter Steier Peter Steier 11 1 1 bronze badge.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. This will create a new file called StartVNC. Again, the name of the file is not important. Now press the [Insert] key once and add a couple of blank lines by pressing the [Enter] key. Next copy and paste the following contents or simply type them :.
Next we need to make the file executable so, assuming you called your script StartVNC. Now type:. Our script will now be run on boot and so our VNC session will be re-created each time the server is rebooted. If you ever change your mind and want to remove the script from the start-up, simply type the following command:.
My personal preference is to create a cron job to run a script at boot time. The easiest way to do this is to use Webmin. If you decide to go down the cron job route then from within Webmin you can very quickly see exactly what jobs are being run and can also easily enable and disable such jobs just by ticking a box. Then click the Create a new scheduled cron job option at the top of the screen that opens.
Click the button next to the Execute cron job as and choose the username you created when you installed Ubuntu. Type or paste the name of your script including the full path eg. In the When to Execute — Simple schedule drop-down list choose When system boots then click the Create button at the bottom of the screen.
Then click the Run Now button at the bottom of the screen. Wait for the server to reboot and try and initiate a new VNC session from your Desktop computer. Skip to content havetheknowhow. Add VNC to rc. This command switches us into that directory.
So type: mkdir MyScripts Obviously the folder name is not important so feel free to pick something more suitable. Next copy and paste the following contents or simply type them :! Now type: update-rc. If you ever change your mind and want to remove the script from the start-up, simply type the following command: sudo update-rc.
Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent.
Install the VNC server. Launch vncserver for the first time to set up a password. Add the following file as /etc/init. d/vncserver (be sure to modify the USER, GEOMETRY, NAME, etc. to your liking).