Jump to content

Welcome, Guest!

Sign in to follow this  

autostart x11vnc in Raspbian


Description

how to autostart x11vnc server at boot your raspberry pi.

Sometimes you need to access toyour raspberry pi but you don't have a monitor to do that. Well, a solution would be autostart x11vnc server on your raspberry pi at boot it. Assuming you have yet configured autologin (other tutorial) you need to complete these steps:

 

1. Install x11vnc using

sudo apt-get install x11vnc

 

2. Set password using

x11vnc -storepasswd

 

Note: You could also run the x11vnc server without password.

 

3.Run the x11vnc server typing: x11vnc -forever -display :0.You should see your local ip address you will need to connect to youraspberry remotely from your network. Keep in memory this IP address.

 

4. Edit a sh script in any directory, for example in /home/pi, let's call it startVnc.sh. To do that, use for example leafpad: right button-->create New --> Blank file and edit:

#! /bin/sh

x11vnc -forever -display :0

 

Save it and make it executable: right button --> file properties --> Make the file executable.

 

4.Go to the directory /etc/xdg/autostart and and in the bar menu select Tools-->Open Current Folder as Root. You need to insert the root password. Note, if you don't have it, previously you can set it typing: sudo passwd root

 

5. Edit a script in /etc/xdg/autostart directory pointing to your script in the step 4 (right button-->create New --> Blank file..):

[Desktop Entry]

Name=VNC Autostart

Exec=/home/pi/startVnc.sh

Type=Application

Terminal=true

 

Save it.

 

6. Install any vnc client on your another computer, for example TightVNC: http://www.tightvnc.com/download.php

 

7. As the x11vnc is yet runnig on you raspberry (step 3), you should access it remotely: run TightVNC viewer--> remote Host: 192.168.1.5:0 where "192.168.1.5" should be the IP address you keep in memory from the step 3. "0" after ":" is the display that we setup "0" in the step 4. So it is not necessary to change this value, You should now view your raspberry pi screen!

 

8.Now you can test it rebooting your raspberry pi!

 

Note: If you have a resolution problem, you may uncomment this line in then config.txt file of the directory /boot:

hdmi_force_hotplug=1



Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

About Us

Bringing you the latest Raspberry Pi news, tutorials and user forum.

The Fruity Computer

×