X11VNC on beaglebone black running Debian

176 views
Skip to first unread message

Bill Dussault

unread,
Dec 9, 2015, 9:54:34 PM12/9/15
to Milwaukee Linux User's Group
Greetings,

I am trying to install X11VNC and log into it via my laptop and I am having some tough luck I've been hacking away at it for a week with no
new results and was wondering if anyone could help me Saturday.


Here is what I have done..........

The first steps:

sudo apt-get update
sudo apt-get install x11vnc  

I have changed my IP address (within my 2wire router ) to a 192.168.1.XX
My router for some reason still thinks it is the old IP address even when I refresh it. 
(Later on I changed the static address so they both match)

I have turned on VNC on the firewall  on my 2wire router

Next I installed VNC: 

   - Debian:       sudo apt-get install x11vnc

3. Enter the below command
 
    -Debian:
    x11vnc -bg -o %HOME/.x11vnc.log.%VNCDISPLAY -auth /var/run/lightdm/root/:0 -forever

(I'm not sure if I turned it on)

I can ping the beaglebone from my computer

C:\Users\William>ping 192.168.1.XX

Pinging 192.168.1.XX with 32 bytes of data:
Reply from 192.168.1.XX: bytes=32 time=3ms TTL=64
Reply from 192.168.1.XX: bytes=32 time=3ms TTL=64
Reply from 192.168.1.XX: bytes=32 time=5ms TTL=64
Reply from 192.168.1.XX: bytes=32 time=3ms TTL=64

Ping statistics for 192.168.1.XX:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 5ms, Average = 3ms

So I can See it. 

I start  tightVNC on my laptop

192.168.1.XX:5900
192.168.1.XX:5901  

I get connection has been gracefully closed.  Or  Connection was actively Refused...

X11VNC has a few configurations when opened on the desktop I am unfamiliar with. No passwords in use as of yet (I was warned when I started)

Does anyone see anything out of whack?

Later this week.................

Here is where I am at:

on the Desktop I click to run X11VNC Allow the default port 5900 to stay I do not click "Enable SSL" because I do not want encryption.  I click "OK" and the next screen shows up in the GUI configuation.
I click X Show instructions and X Accept Connections

The dialog box shows "X11VNC has failed to start .... Maybe there is another VNC server listening on port 5900..... (There isn't)

I then looked into the $dmesg | tail

Here is the last thing it spits out
libphy 4a10100.mdio.00 Link is - 100/FULL
Ipv6 ADDRCONF(NETDEV_CHANGE): eth 0 Link becomes ready.

I have looked at the router. I initially changed the IP address to XXX.XXX.1.100 but the router config still claimed it was XXX.XXX.1.70 I have no idea why that was
I then changed the Static IP to XXX.XXX.1.70 and enable VNC connections STILL NO LUCK. 

What the heck is going on Anything else ask I'll give just help me get this working 

Thanks

Bill

Tom P

unread,
Dec 10, 2015, 10:28:57 AM12/10/15
to MilwaukeeLUG
No guarantee that my previous work with Raspberry Pi will help you in the least, but here are my notes anyhow:

Install VNC server

  • Install: apt-get install x11vnc
  • Create file /home/pi/.config/autostart/x11vnc.desktop with this in it:
    [Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    Name=x11VNC
    Comment=
    Exec=/usr/bin/x11vnc -display :0 -usepw -allow "192.168.100." -noxdamage -ncache 10 -ncache_cr -forever -shared -noipv6 -no6 -ultrafilexfer 
    Icon=/usr/share/pixmaps/gksu-root-terminal.png
    StartupNotify=false
    Terminal=false
    
  • Logging to /var/log/ causes it not to work: Don't do this: -o /var/log/x11vnc.log


Approaches to Autostarting VNC that should have worked (but didn't)

  • Create file: /etc/init.d/vncboot with the following content:
    ### BEGIN INIT INFO
    # Provides: vncboot
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start VNC Server at boot time
    # Description: Start VNC Server at boot time.
    ### END INIT INFO
    
    #! /bin/sh
    # /etc/init.d/vncboot
    
    USER=pi
    HOME=/home/pi
    
    export USER HOME
    
    case "$1" in
     start)
      echo "Starting VNC Server"
      #Insert your favoured settings for a VNC session
      #su - pi -c "/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565"
      su - pi -c "/usr/bin/x11vnc -display :0 -usepw -allow "10.194.130." -noxdamage -ncache 10 -ncache_cr -forever -shared -noipv6 -no6 -ultrafilexfer -o /var/log/x11vnc.log"
      ;;
    
     stop)
      echo "Stopping VNC Server"
      /usr/bin/vncserver -kill :0
      ;;
    
     *)
      echo "Usage: /etc/init.d/vncboot {start|stop}"
      exit 1
      ;;
    esac
    
    exit 0
    
  • Make read/executable: chmod 755 vncboot
  • Enable dependency-based boot sequencing: update-rc.d /etc/init.d/vncboot defaults
    • Success message: update-rc.d: using dependency based boot sequencing
    • Failure message: update-rc.d: error: unable to read /etc/init.d//etc/init.d/vncboot
  • But the above step didn't work for me, so I did: update-rc.d vncboot defaults
  • Reboot the Pi

See: https://www.raspberrypi.org/documentation/remote-access/vnc/

See http://c-nergy.be/blog/?p=8361 See http://randomstuffidosometimes.blogspot.se/2015/05/x11vnc-autostart-on-raspbian-raspberry.html



--
You received this message because you are subscribed to the Google Groups "Milwaukee Linux User's Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MilwaukeeLUG...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--
Tom Peters • a50m...@gmail.com • N9QQB (amateur radio) • Six meters: The Magic Band
"HEY YOU" (loud shouting) • Second Tops (Set Dancing) • FIND ME ON FACEBOOK
43° 7' 17.2" N by 88° 6' 28.9" W • Elevation 815' • Grid Square EN53wc
LAN/Telecom Analyst • Open-source Dude • Musician • Registered Linux User 385531

Tom P

unread,
Dec 10, 2015, 11:28:44 AM12/10/15
to MilwaukeeLUG
Other thoughts:
(I don't bother telling you to use sudo or su because I assume you'll do that for commands that require it.)
Firewall? Which firewall would that be? On the laptop? On the BBB? for purposes of testing, you should shut them both down for a brief time. # service iptables stop maybe.

Your changes on the 2-Wire router aren't needed and could be a problem--UNLESS you intend to VNC to the BBB or the laptop from outside of your network (outside your house/business). The router shouldn't get involved in machines that are all on the local LAN talking to each other. BY opening that up to VNC (by which I assume you mean you opened up port 5900 by name (VNC) or by number (59xx) you opened your LAN to outside attack via that port.

I can't make out what you're doing on your router with regard to the IP of the BBB. The BBB is getting an address, in general,  by one of three  methods
  1. Static, set by a configuration file on the BBB
  2. Dynamic, set by the DHCP service on the router, which has a fixed pool of addresses. Each host that boots up and says "Bro, give me an address" gets one from the pool.
  3. DHCP reservations, which is complicated unless you've done it before, and requires entering the MAC address of the host (the BBB) into the router, along with an IP address you're sure is not in the DHCP pool range.

So which one are you doing?

On the BBB, do ifconfig and see what the IP address is. Make sure you can ping it by THAT ip address from the laptop. Still on the laptop, do nmap ip-address-of-the-bbb and get the list of ports open on the BBB. You should see a port in the 59xx range. You'll want to install nmap if you don't have it. It's a handy tool. Here's what I got:
PORT     STATE SERVICE
22/tcp   open  ssh
5900/tcp open  vnc
MAC Address: AA:BB:CC:DD:EE:FF (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 1.26 seconds


YMMV of course.

Back on the subject of IP addresses, poke around your router and see if you can find out the DHCP range. If you have a lot of devices and computers on this network, maybe don't change it, maybe just note it. Static address you have to choose from those that are not in the DHCP pool and not the address of the router itself. I found this: (YMMV)

3801HGV web interface > Settings > Lan > DHCP > Configure manually
Router address: 192.168.1.1
Subnet mask: 255.255.255.0
First DHCP address: 192.168.1.2
Last DHCP address: 192.168.1.254

That's bad, because there's no place for static addresses, just 192.168.1.1 (the router) and the DHCP range. If yours came out of the box that way, there's going to be trouble when you manually assign addresses.

On my networks, the first hundred addresses are reserved for static addresses, addresses from .100 to .200 are DHCP, and above that are for a few special devices.

You could scan your network to see what addresses are in use, and reduce the DHCP pool so that it includes most of them, and then reboot those you didn't include so they get new addresses from the pool:
nmap 192.168.1.1-254
  or
nmap 192.168.1.*


Using the -sP gives shorter output per host and doesn't list the ports open:
nmap -sP 192.168.1.*

Really short output:
nmap -sP 192.168.1.*|grep "Nmap scan report for"

xheralt

unread,
Dec 10, 2015, 9:01:24 PM12/10/15
to Milwaukee Linux User's Group
First thing, us the desktop's firewall configured to let communications on 5900.5901 thru?  The most basic firewalls tend to block that.  I need to go look at the one place I use x11vnc, which is the ancient P4 configured to act as an internet radio at a local coffee shop (Ruby G's, 21st & Wells, not from the the MLUG meeting place) to see what settings I used.

I seem to recall that I always have to specify "-display", typically "-display :0" 

How is your %VNCDISPLAY env variable set up?  Is is just the number '0' or is it ':0' ?  The difference being '-display :%VNCDISPLAY' versus '-display %VNCDISPLAY'

While it may not solve your main problem, have you tried using '-auth guess' instead specifying?  Might save you a little typing if it works... :)

Bill Dussault

unread,
Dec 11, 2015, 10:10:16 PM12/11/15
to Milwaukee Linux User's Group
Thank you very much for your reply. I'm going to try all of this tonight

Bill
Reply all
Reply to author
Forward
0 new messages