Posts: 40
Joined: Wed Jan 25, 2012 3:53 pm

Start TightVNC Server at Boot [obsolete]

Wed Jun 06, 2012 9:14 am

Hi All,

I got my Pi last week and am loving playing around on it. It's really my first time seriously using Linux, although I would consider myself a Windows "power user" and have used Cygwin (for hobby OS development). So far, I'm booting from a 4GiB SD card and have the rest of my system on an external USB hard drive which I can SAMBA in to from my Windows machine.

The thing I'm stuck with, is getting TightVNC server running at boot time without requiring me to login (i'm using the Arch Linux for ARM distro). I have followed various online tuts, but the ones I have found involve scripts which seem to run at login-time rather than boot time. Anything that I have found which starts the server at boot time involves editing scripts in "/etc/init.d" which Arch does not appear to have (although it does have "/etc/rc.d").

The situation so far, is that if I reboot the Pi, login via puTTY and start tightVNC, all is well. I get a nice view of lxde which runs surprisingly quickly (it surprised me, anyway!). If, however, I try the above without first logging in via puTTY, the Pi actively refuses the connection.

So, the question is: How do I get this server running correctly at boot time in Arch Linux without requiring manual login?


Posts: 33
Joined: Wed Dec 07, 2011 9:12 pm

Re: Start TightVNC Server at Boot

Wed Jun 06, 2012 8:02 pm

I've never used Arch, but I think you should have a file called /etc/rc.local this can be used to add any commands or scripts you want to run at boot time.
If you edit the file and add this to the end it should start the vncserver, I've tried it in Debian and it works anyway. If rc.local has a line saying "exit 0" at the end put the command before that or it won't get run.

Code: Select all

/usr/bin/sudo -u your_username vncserver
Any commands in rc.local are run as root, so sudo -u is used to make vncserver run as though you ran it using your normal username. Might be worth checking that sudo is in /usr/bin, you can do this by doing,

Code: Select all

which sudo
if it's somewhere else change /usr/bin/sudo to wherever it lives.

Posts: 40
Joined: Wed Jan 25, 2012 3:53 pm

Re: Start TightVNC Server at Boot

Thu Jun 07, 2012 6:19 pm


Spot on, thank you!

I had previously tried adding vncserver to rc.local, but had assumed that it doesn't work like that in Arch, because nothing seemed to happen.

Actually, my incorrect assumption was that sudo was automatically installed as a part of "core linux". Up until now, I have been either logging in as root or using "su" to run privileged commands. "pacman -Sy sudo" fixed this problem and I can now login to lxde via VNC without manually loging in through SSH.

Thanks again for your helpful post!

Posts: 1
Joined: Mon Jul 02, 2012 10:05 am

Re: Start TightVNC Server at Boot

Mon Jul 02, 2012 10:08 am

hello pgix
I was wondering about your word, did you mean that you need to connect your Archlinux to the server automatically when you connect?
Actually I am working on something like that right now

Posts: 2
Joined: Fri Nov 15, 2013 4:18 am

Re: Start TightVNC Server at Boot

Sat May 30, 2020 7:12 pm

Install node-red
get the startup trigger node and the deamon node
pipe the startup trigger node to the daemon node in a flow
configure daemon node with command "vncserver" and argument ":1"

Posts: 10788
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Start TightVNC Server at Boot

Sat May 30, 2020 7:37 pm

NevergoldMel wrote:
Sat May 30, 2020 7:12 pm
Install node-red
2020 answer to a 2012 problem... doesn't really anything significant

Posts: 2727
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Start TightVNC Server at Boot

Sat May 30, 2020 9:20 pm

This may not meet your need, but It enables you to set up virtual VNC desktops quickly and easily, with multiple display dimensions. The newly-created desktop will have to login (via whatever display manager you have installed (e.g., lightdm, xdm, etc).

The VNC services are set up at boot time via systemd, so no need to login to the pi to get things started.

I haven't tested this on Arch, but will be happy to work with you to get it working if you have any problems.
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards:
Easily run and manage your network's DHCP/DNS servers on a Pi:
Easy and secure IPSEC/IKEV2 VPN installer/manager:
Lightweight Virtual VNC Config:

User avatar
Posts: 5405
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Start TightVNC Server at Boot

Sat May 30, 2020 10:34 pm

Is this the longest necro ever?

User avatar
Forum Moderator
Forum Moderator
Posts: 14734
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Start TightVNC Server at Boot

Sun May 31, 2020 1:10 am

probably, (but the record is broken constantly) locking and marking obsolete (the standard solution). :ugeek:

I think that people simply don't have any idea how old the posts are they react to, and if they re-activate such old threads google will send more people. Sigh..... :evil: :cry:

Return to “Beginners”