Autostart TigerVNC on Raspberry Pi 3+

1,950 views
Skip to first unread message

dick....@gmail.com

unread,
Apr 30, 2019, 4:21:21 PM4/30/19
to TigerVNC User Discussion/Support
I confess, this should not be a difficult thing to do, and I am really embarrassed to ask for help.

My Raspberry Pi is working great, and I installed TigerVNC server so that I can run it "headless" (no monitor, no keyboard, no mouse). I can use Putty to access the Pi over SSH, and would like to automate the step of starting VNC server manually.

I want the VNC server to start automatically when the Pi is booted. Google search turns up numerous "how to's" to start RealVNC and TightVNC, but I cannot seem to find a tutorial on starting TightVNC server.

Can somebody please point me to instructions specific to TigerVNC?

dick....@gmail.com

unread,
Apr 30, 2019, 4:41:42 PM4/30/19
to TigerVNC User Discussion/Support
Sorry. I cannot even type correctly. It is TigerVNC that I want instructions for.

Pierre Ossman

unread,
May 8, 2019, 3:20:54 AM5/8/19
to dick....@gmail.com, TigerVNC User Discussion/Support
How did you install TigerVNC? There should be a "vncserver" service that
you can start. I think the configuration file for it is in /etc/defaults
on Debian based systems.

Regards
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

dick....@gmail.com

unread,
May 9, 2019, 4:51:40 PM5/9/19
to TigerVNC User Discussion/Support
Thanks to Pierre for offering assistance.

Alas, since no one responded in a week, I went back to tightvnc. I still have the same problem: I can start vncserver from a console login, and as long as the computer is not restarted, vncserver works fine. Even though I followed the setup instructions, vncserver does NOT start automatically when my Raspberry Pi 3+ is restarted.

Maybe the startup configuration has to go into "root" somehow? (the default user account on Raspberrian is "pi" - a bit silly, but easy to type.)

Russ DiBennetto

unread,
Nov 12, 2023, 2:46:51 PM11/12/23
to TigerVNC User Discussion/Support
This worked for me
from a terminal enter the following
sudo crontab -e
(you may have to choose you editor if it is the first time logging in)
scroll to the bottom of the page and go to a blank line
enter the following
@reboot sudo tigervncserver

save the file and reboot.

Russ DiBennetto

unread,
Dec 3, 2023, 12:28:09 PM12/3/23
to TigerVNC User Discussion/Support
This is what you do the and this works my previous post was incorrect

cd "/etc/systemd/system"
Copy and paste this into a file is called "tige...@10.service"
If the owner of the file is not root:root make it root:root
Then execute the following two commands:

sudo systemctl enable tige...@10.service
sudo systemctl start tige...@10.service
connect to xxx.xxx.xxx.xxx:5910

From then on the sever should start on bootup

Here is the file (hint watch the spacing

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User="your username"
PAMName="your username"
PIDFile=/home/pi/.vnc/%H%i.pid
ExecStart=/usr/bin/tigervncserver :10
ExecStop=/usr/bin/tigervncserver -kill%i

[Install]
WantedBy=multi-user.target

Ralf Ferner

unread,
Dec 27, 2023, 10:55:53 AM12/27/23
to TigerVNC User Discussion/Support
Perfect Russ, worked for me.

Thanks a lot

James Kirk

unread,
Feb 5, 2024, 3:35:33 AM2/5/24
to TigerVNC User Discussion/Support
I think Im not doing this right. I cannot get he autostart info to work. I created this file:

_________________________

tige...@10.service
_________________________

in this folder:

/etc/systemd/system

the File is Root:Root
_________________________

The file contain this code:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User=Bob
PAMName=Bob

PIDFile=/home/pi/.vnc/%H%i.pid
ExecStart=/usr/bin/tigervncserver :10
ExecStop=/usr/bin/tigervncserver -kill%i

[Install]
WantedBy=multi-user.target
_________________________________

I ran these two lines:

sudo systemctl enable tige...@10.service
sudo systemctl start tige...@10.service
__________________________________
 
Rebooted the system and it did not autostart. I had to run:
tigervncserver from the cmd line to be able to open the Viewer. Any help appreciated.

Tony P

unread,
Feb 13, 2024, 9:04:48 PM2/13/24
to TigerVNC User Discussion/Support
no file in list  "tige...@10.service" or anything even close.
I have P4 with the lastest PI os as of feb 2024

pi@raspberrypi:~ $ cd "/etc/systemd/system"
pi@raspberrypi:/etc/systemd/system $ ls
bluetooth.target.wants                      halt.target.wants
dbus-fi.w1.wpa_supplicant1.service          multi-user.target.wants
dbus-org.bluez.service                      network-online.target.wants
dbus-org.freedesktop.Avahi.service          poweroff.target.wants
dbus-org.freedesktop.ModemManager1.service  printer.target.wants
dbus-org.freedesktop.nm-dispatcher.service  reboot.target.wants
dbus-org.freedesktop.timesync1.service      remote-fs.target.wants
default.target                              sockets.target.wants
dev-serial1.device.wants                    sshd.service
display-manager.service                     sysinit.target.wants
getty.target.wants                          timers.target.wants
ge...@tty1.service.d                        wayvnc.service.wants
graphical.target.wants

Jeremy “Jaggerfrost” Hillis

unread,
May 16, 2024, 4:11:50 AM5/16/24
to TigerVNC User Discussion/Support
To add on Russ's instructions:

cd "/etc/systemd/system"
sudo nano

create the file with this config(remove " around username):

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User="your username"
PAMName="your username"
PIDFile=/home/pi/.vnc/%H%i.pid
ExecStart=/usr/bin/tigervncserver :10
ExecStop=/usr/bin/tigervncserver -kill%i

[Install]
WantedBy=multi-user.target

then ctrl+x and save the buffer and name it "tige...@10.service"

Then run the two following commands:

sudo systemctl enable tige...@10.service
sudo systemctl start tige...@10.service

now you can connect to xxx.xxx.xxx.xxx:5910 using the TigerVNC Viewer on your respective device.

From then on the sever should start on bootup

Reply all
Reply to author
Forward
0 new messages