How can I run VNC on each boot?
Note: I use TightVNC server and Raspberry Pi 4 and Raspbian Buster
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
There are 2 ways you could do this.
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.):
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
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.
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.