ENABLE AUTOSTART FOR X11VNC

ENABLING AUTOSTART FOR X11VNC ON KALI LINUX RASPBERRY PI

TO INSTALL VNC check my last post INSTALL X11VNC ON KALI LINUX RASPBERRY PI 

Once you've started the service, it'll run until you stop it or reboot.
To Autostart it during BOOT , follow these steps.
Create a file "sharex11vnc" in the directory /usr/local/bin
Open a terminal, type


  • cd /usr/local/bin

this will take you to that directory.
To create a file, type


  • nano sharex11vnc

Enter the following,

 #!/bin/sh
x11vnc -ncache 10 -auth guess -repeat -nap -loop -forever -rfbauth ~/.vnc/passwd -desktop "VNC ${USER}@${HOSTNAME}"|grep -Eo "[0-9]{4}">~/.vnc/port.txt

# comment this out if you dont want a pop up telling you which port you're using


zenity --info --text="Your VNC port is 'cat~/.vnc/port.txt'"


press Ctrl+x then press "y" then hit Enter. This will save the file.
This script will run the x11vnc during boot.
Once the file is created, we need to give some permissions, type


  • chmod 755 /usr/local/bin/sharex11vnc


Now we have to set the x11vnc to autostart using the the sharex11vnc file.


  • Goto Applications -> Settings -> Sessions and Startup.


Select "Application Autostart"  and click on "Add" button.
In the Add application, Enter name (Whatever you want), description (can be left empty) and in Command, enter "x11vnc" (without quotes). Click on OK and check the "X11VNC" box and close it.

Comments

Popular posts from this blog

INSTALL TIGHTVNC ON KALI LINUX RASPBERRY PI

INSTALL X11VNC ON KALI LINUX RASPBERRY PI