Enabling VNC server on Raspberry Boot Up

Enabling VNC server on Raspberry Boot Up

Connecting to your Raspberry Pi remotely with VNC is fine as long as your Pi does not reboot. If it does, then you either have to connect with SSH and restart the VNC Server or arrange for the VNC Server to run automatically after the Raspberry Pi reboots.

There are several different methods of arranging for some code to be run as the Pi starts. The method described below is probably the easiest to use. You can adapt it to run other commands instead of starting the VNC server.

Step 1.

Open a Terminal session on the Pi, or connect using SSH. A new terminal or SSH session will automatically start you off in your home directory of /home/pi. If you are not in this directory, change to it by typing: 

$ cd /home/pi

Then cd to the .config directory by typing: 

$ cd .config

Note the ‘.’ at the start of the folder name. This makes it a hidden folder that will not show up when you type ‘ls’.

Step 2.

Issue the command below to create a new directory inside .config called ‘autostart’. 

$ mkdir autostart

cd into that new directory by typing: 

$ cd autostart
learn_raspberry_pi_autostart1.png

Step 3.

All that remains is to edit a new configuration file. So type the following command to open the nano editor on the new file: 

$ nano tightvnc.desktop

Edit the contents of the file with the following text. 

[Desktop Entry]Type=ApplicationName=TightVNCExec=vncserver :1StartupNotify=false
learn_raspberry_pi_autostart2.png

Type ctrl-X and then Y to save the changes to the file.

Thats all there is to it. The next time you reboot the VNC server will restart automatically.

Add the following lines in

sudo nano /boot/config.txt

hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=85

for better UI

IF you want to install team viewer

wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb
sudo apt-get -f install ./teamviewer-host_armhf.deb

Leave a Reply

Your email address will not be published. Required fields are marked *