-2

How can I run VNC on each boot?

Note: I use TightVNC server and Raspberry Pi 4 and Raspbian Buster

Greenonline
  • 2,740
  • 4
  • 23
  • 36

2 Answers2

2

There are 2 ways you could do this.

Cron:
You can edit the crontab by typing this in the terminal: crontab -e. Then you should add this line to it @reboot vncserver :1.
Read the Cron docs here: https://www.raspberrypi.org/documentation/linux/usage/cron.md

Systemd (I'm not a 100% sure about the exact instructions but I think this is how you would do it.):
Type sudo nano /lib/systemd/system/vncstart.service. Add this to the file:

[Unit]
Description=Start VNC
After=multi-user.target

[Service] ExecStart=/usr/bin/vncserver :1

[Install] WantedBy=multi-user.target

Then enter:

sudo systemctl daemon-reload
sudo systemctl enable vncstart.service

Read the systemd docs here: https://www.raspberrypi.org/documentation/linux/usage/systemd.md

After you're done with one of these reboot to check if it's working.

aklingam
  • 974
  • 4
  • 16
0

If you REALLY want to use TightVNC server see:- https://raspberrypi.stackexchange.com/a/39374/8697

I wouldn't bother; The RealVNC included with Raspberry Pi OS is simpler and has many advantages.

Milliways
  • 59,890
  • 31
  • 101
  • 209