VNC Setup Guide!!! Board side only...

4,986 views
Skip to first unread message

Wilfredo Nieves

unread,
May 20, 2013, 11:12:29 PM5/20/13
to beagl...@googlegroups.com
Hey guys

  Thought i would make a tutorial on installing x11vnc and setting it up to auto load at startup with a permanent connection.
 

  I am doing it so that anybody that is interested in using vnc can find the info in one location.

  Ok here goes nothing!

1. Open a terminal and type "opkg update" and hit enter.

2. Type "opkg install x11vnc" and hit enter.

3. Type "x11vnc -bg -o %HOME/.xllvnc.log.%VNCDISPLAY -auth /var/run/gdm/auth-for-gdm*/database -display :0" and hit enter.

4. Type "nautilus" it will bring up a new window. Make sure not to mess with any files if you do not know what they are. Nautilus gives you the ability to delete and modify system files.

5. Now find a place to create a new file (make sure it is some where it will not get deleted).

6. Now right click and select create new document > empty file.

7. Now name the file what ever you like but make sure it is something that makes sense. Also make sure the name ends with ".sh". For instance i used "VncStartup.sh".

8. Now double click the file and it will open an editor.

9. Now type.

   "#!/bin/sh
    exec x11vnc -forever"

10. Now save the file and close the editor.

11. Make note of the file path, you will need it in the next step.

12. In the terminal type "chmod a+x /your/file/path/here" (for instance mine was chmod a+x /MYscrpits/VncStartup.sh) and hit enter.

13. Now on the panel (up top where it says Applications, Places, System) select System > Preferences > Startup Applications.

14. Select the startup programs tab and click Add.

15. For the name you can choose what ever you like (i used Vnc Startup). Now click browse and locate the file you created earlier and click open. For the comment you can type in a description that tells you what it does and click save.

16. Close the startup applications window and restart your board.

Now you should have a working vnc connection and it doesn't matter how many times you terminate your connection to the board, you will always have a connection and not have to restart x11vnc every time you want to use it.

Please note that you will need to know the ip address of the board to connect to it.

Wilfredo Nieves

unread,
May 20, 2013, 11:14:51 PM5/20/13
to beagl...@googlegroups.com
If i missed anything let me know or if anybody would like to add feel free to do so.

-Wil

Kleven Bingham

unread,
May 21, 2013, 11:46:15 AM5/21/13
to beagl...@googlegroups.com
I can't test this right now because I have a crazy work week and I just reflashed my BBB the other day (opkg update/upgrade went in the weeds) but I'm pretty sure that I was able to simplify this by installing the angstrom-x11vnc-xinit package.

If I remember correctly, this provided a clean way to manage VNC through systemd - but I might be imagining that part.  I was looking at this over two weeks ago and I've slept since then.

But I know for certain that I did not have to execute anywhere near this many steps after I installed that package.

A caveat is that I have no idea if this package is for root auto-login only or if it works just fine with a normal multi-user password protected setup.  Like I said, I looked at this a while ago and unfortunately I can't go back to it right now.  But I wanted to throw it out there as something to take a look at.

Kleven

Wilfredo Nieves

unread,
May 24, 2013, 9:00:20 PM5/24/13
to beagl...@googlegroups.com
Hi Kleven

Just got done trying your two step method and it is the same as just installing x11vnc. It would still have to be configured. But by all means if you do have an easier way I am open to suggestions. Anything to make this as simple and painless of a process would be great.

The reason it is broken down so much is because I made it so that anyone with absolutely zero experience could zip through it without having to try to piece info together from different sites.

But like I said I am open to suggestions.

Best way to improve ones self is constructive criticism.

-Wil

Kleven Bingham

unread,
May 25, 2013, 1:47:13 PM5/25/13
to beagl...@googlegroups.com
Hmm... I just reflashed with the 2013.05.20 image a couple days ago and after installing and configuring a few things earlier today, I did this:

opkg install angstrom-x11vnc-xinit

And then I rebooted.  VNC automagically started up and served display :0 - I'm connected to it right now.

Are you using an older image?  If I have time I will try this again making sure I do nothing else but flash and then install the angstrom-x11vnc-xinit package so I can be certain I'm not doing something else that changes how this works.

As far as I can recall the only other thing I setup on the BBB since I reflashed was ntpd, but perhaps I am overlooking some other thing I might have done.

Venkat Bommakanti

unread,
May 25, 2013, 4:20:44 PM5/25/13
to beagl...@googlegroups.com
Can confirm the following:
  • 1. Upgrade to 05/20/13 image
  • 2. Run:
    • opkg update
    • opkg upgrade
  • 3. Reboot bbb
  • 4. Run: opkg install angstrom-x11vnc-xinit
  • 5. Reboot bbb
  • 6. From a vnc-client (vnc viewer), access 192:168.7.2:0
  • 7. Should see bbb desktop
If I skipped (2) and tried (4) direct, the install of x11vnc would fail.

thanks,
/venkat

Wilfredo Nieves

unread,
May 25, 2013, 5:11:17 PM5/25/13
to beagl...@googlegroups.com

I may have done something wrong then because that is the same procedure I used except mine was on my network and not over the USB.

Good to hear though cuz now I can stop writing this script that was kicking my ass this morning.

-Wil

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Venkat Bommakanti

unread,
May 25, 2013, 7:07:21 PM5/25/13
to beagl...@googlegroups.com
On Saturday, May 25, 2013 2:11:17 PM UTC-7, Wilfredo Nieves wrote:

I may have done something wrong then because that is the same procedure I used except mine was on my network and not over the USB.

Can get it to work over ethernet/intranet too.
The only hiccup though is that X related apps hog cpu resources like crazy:
  • With just X/x11vnc running in "sleep" state, %CPU use is 10%
  • With both + a terminal, %CPU use for all 3 is 20% and stays there
  • With both + gnome-system-monitor, %CPU for all 3 jumps to 80% and stays there
So I think, as expected, the bbb is not really suited for X-based use.

/venkat

Wilfredo Nieves

unread,
May 25, 2013, 8:02:07 PM5/25/13
to beagl...@googlegroups.com

Ok I'll give it a shot here in a bit.

-Wil

Kleven Bingham

unread,
May 25, 2013, 9:58:43 PM5/25/13
to beagl...@googlegroups.com
Yes, I will second this observation re: performance. Running the Gnome desktop and a VNC server on display :0 definitely makes things a bit sluggish.

Running top doesn't show major CPU loading so perhaps it's memory or something in the network stack being obnoxious.

Venkat, thanks for the clarification. I knew I was probably forgetting something and the update/upgrade was an important detail I missed.

Wilfredo Nieves

unread,
May 26, 2013, 1:46:40 PM5/26/13
to beagl...@googlegroups.com

Ok tried it again and I feel Like an idiot. I was trying to vnc from my phone and it still would not connect until I realized I was trying to use the wrong port. Switched the port to 5900 and it works great.

Thanks for the info Kleven. It is much easier this way.

-Wil

Wilfredo Nieves

unread,
May 27, 2013, 10:56:19 AM5/27/13
to beagl...@googlegroups.com

I'm not sure that it would be a good idea to add it to the image. Most users won't use it. It would just add to the teams work load trying to maintain it and keep it working. I think it is just as easy for anyone to install it themselves using Klevens procedure and that way the SW guys can concentrate on trying to get all the other stuff working.

-Wil

On May 27, 2013 5:08 AM, <john.hin...@gmail.com> wrote:
This worked well for me and VNC seems to be fine over a wired network connection (it is a little slow over the USB virtual network).

However the 'opkg upgrade' step seems to be unnecessary and a really, really bad idea. When I ran it, it downloaded endless stuff until the memory was full and left me with a bricked BBB. I reloaded the 05/20/13 image and then:

opkg update
opkg install angstrom-x11vnc-xinit
reboot
connect to VNC at 192.168.7.2::5900

Or better, substitute the IP address of the BBB wired ethernet connection (which you'll need anyway to complete the opkg steps).

They really, really ought to put this into the starter image so we can get going with a graphical desktop using only the USB cable shipped in the box.

Wilfredo Nieves

unread,
May 29, 2013, 8:36:54 AM5/29/13
to beagl...@googlegroups.com

Ok I see your point.

-Wil

On May 29, 2013 6:33 AM, <john.hin...@gmail.com> wrote:
The problem is you need a working internet connection on the board to do this install and that requires hardware that is not in the box (an Ethernet cable and something to plug it into). If it was there by default you could get up an running with a graphical UI very quickly and easily. Lots of people seem to be having trouble getting the HDMI working (which again requires hardware not in the box), so this would give them an alternative to get some encouraging early success. If someone does not want the overhead of the VNC server they can easily disable it in the start-up options (which appears to already have redundant Bluetooth and Touch-screen support enabled by default, so what is one more thing?)

Koen Kooi

unread,
May 29, 2013, 8:39:55 AM5/29/13
to beagl...@googlegroups.com

Op 29 mei 2013, om 14:03 heeft john.hin...@gmail.com het volgende geschreven:

> The problem is you need a working internet connection on the board to do this install and that requires hardware that is not in the box (an Ethernet cable and something to plug it into).

Wrong. You can use the mini usb cable to access the internet if you turn on connection sharing on the computer where you plug it into.

Wilfredo Nieves

unread,
May 29, 2013, 8:45:47 AM5/29/13
to beagl...@googlegroups.com

I was going to say "what if they don't have internet access". But they must have to have ordered a board.

-Wil


Op 29 mei 2013, om 14:03 heeft john.hin...@gmail.com het volgende geschreven:

> The problem is you need a working internet connection on the board to do this install and that requires hardware that is not in the box (an Ethernet cable and something to plug it into).

Wrong. You can use the mini usb cable to access the internet if you turn on connection sharing on the computer where you plug it into.

camero...@gmail.com

unread,
Sep 30, 2013, 10:52:03 PM9/30/13
to beagl...@googlegroups.com
Another way to approach this is by using the autorun script section on you BBB and doing it through node.js. All you have to do is add this script to your autorun folder in Cloud9 and reboot the board.

var sys = require('sys');
var exec = require('child_process').exec;
var child;

// executes `pwd`
var command = "x11vnc -bg -o %HOME/.x11vnc.log.%VNCDISPLAY -auth /var/run/gdm/auth-for-gdm*/database -display :0  -forever";
child = exec(command, function (error, stdout, stderr) {
  sys.print('stdout: ' + stdout);
  sys.print('stderr: ' + stderr);
  if (error !== null) {
    console.log('exec error: ' + error);
  }
});
Reply all
Reply to author
Forward
0 new messages