Connect and share knowledge within a single location that is structured and easy to search. However the second line never appears to run, If I ssh into the machine after startup VNC is running but not an openbox session and I have to manually enter the second command at which point everything works as intended. Since you are backgrounding Xvfb , openbox-session is started almost immediately after Xfvb is started. So the display isn't ready yet when openbox-session starts.
Something like:. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 7 years, 5 months ago. Modified 2 years, 1 month ago. Viewed 8k times. I'm trying to get a openbox based VNC to run on start up, I have added the following to rc.
Is there anyway to make this completely automated? I am aware there is no password and that is intended. Improve this question. Are you certain it never runs? Perhaps the display isn't ready yet when that command is started and openbox fails. You're right, the display wasn't ready yet. By default, the VNC server accepts incoming connections from any host.
This default setting leaves your Ubuntu VNC server open to anyone who knows your IP address — which can be a security risk. This way, you would not need to open new ports on your firewall to allow connectivity to your VNC server instances. First, start a VNC server instance on your server by running the command below. This VNC instance will only accept connections locally and effectively lock down access from anywhere else. To better understand the command, refer to the inline comments.
Type yes and press Enter. Type in the user account password at the password prompt and press Enter. At this point, the SSH tunnel is now open. Do not close the terminal, or the SSH tunnel will terminate, too. Now, open your preferred VNC viewer on your computer. Type localhost in the address text box at the top and press Enter. The VNC server installs without a built-in daemon. But you can work around that limitation by turning the VNC server into a service — which runs automatically at startup.
And below are the steps to enable the Ubuntu VNC server to autostart. Run the below command to create a new systemd unit file and open it in nano for editing. The unit name can be anything you want. In this example, the name would be atavncserver. To adjust the color depth and screen resolution, modify the -depth and -geometry parameter values, respectively. In this example, the color depth is 24 bit , and the resolution is x Next, run the below reload the systemd service manager configuration.
This step essentially adds the service you created to the available service list. Now that the system recognizes the new atavncserver service run the below command to enable that service. To find out if the service has started, run the below command to check the service status.
You should see a similar to the screenshot below showing that the service status is active running. You now have a Ubuntu VNC server service that runs at startup automatically. And being a service, you can now perform the start , stop , reload , and restart with the systemctl command. Related: Controlling Systemd services with Ubuntu systemctl. In this tutorial, you have learned how to install and configure an Ubuntu VNC server.
At this point, you should be able to connect to your VNC desktop from any computer or device securely and easily. Thank you for reading, and happy learning! Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.
Can't keep up with the tutorials? The best guide for protecting Microsoft Office data. You've migrated to the cloud, now what? ATA is known for its high-quality written tutorials in the form of blog posts. ATA Learning.
Table of Contents. Twitter Facebook LinkedIn. Creating a new VNC server password. Starting the Ubuntu VNC server instance.