Jump to content

Welcome, Guest!


Tutorial: autostart x11vnc in Raspbian

Recommended Posts

autostart x11vnc in Raspbian

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

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: where "" 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:


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


About Us

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

The Fruity Computer

  • Create New...