noVNC failed to connect to server

Hello when I click on the VNC option I just get “Failed to connect to server”.
I have a GoPiGo3
I am using stretch from the image: “”
I have a static IP working. When I visit the IP (in Chrome, Firefox or IE) the terminal shell in a box works, but the noVNC does not connect.

The VNC was working for me with an earlier Jesse image.

Thinking this may be related to my Camera video stream issues:

Hi @jhutton,

We’ve released the official version just a couple of hours ago. You might want to give that a try.

Thank you!

Just downloaded the new image from here:

Connecting with ssh works fine (via the web interface, or via terminal from another computer on my network). Trying to connect with noVNC via the web interface gives this screen:


Connection with RealVNC client works (dex.local:1)

Note: http://IP:8001/vnc_lite.html works, but not the vnc.html

Hi @jhutton,

Are you somehow using Cinch on it, because I’m seeing a 10.10.10.x IP address in the address bar. If so, can you try testing it without having Cinch enabled?

@cleoqc please take a look at this one - what do you know about this thing?

Thank you!

The screen grab you see above is from me. IP address is

This is the screen I get when I go to

When I click the “Launch VNC” link, I get the screen from my previous post with “Failed to connect to server” message.

As @jhutton pointed out, if I go to it works (screen below):

typing robots1234 in the password box on this screen gets me to the desktop:

This is from the image here:

I haven’t installed anything additional after loading this image.

No, I don’t think I’m using Cinch.

We’ll try doing a more rigorous test and then we’ll be back with an answer for you.

Thank you!

Hi @jhutton @kev.r,

We flashed the 2018.06.01 image of Raspbian For Robots a couple of times and noVNC still seems to work even on the first shot.

Here’s a screenshot of ours:


What’s interesting is that you need to access the Pi at address which is a bit unusual. Can you both tell us again how does your network configuration look like and how you have set it up in more details? Like which cable goes to where? What did you use: internet sharing or Bonjour? How’s the router set up? Stuff like that.

Thank you!

Downloaded the 2018.06.01 image again, erased and re-flashed my SD card. This is the first boot of the card, have not updated or installed anything.

Here’s the screen I get when I type dex.local in the address bar of chrome:


When I click the “Launch VNC” icon, I get this:

These screen grabs are from Chrome running on my iMac, but I get the same results from Safari and Firefox on the iMac.

Also the same results from Chrome on my PC (Windows 10) and Chromium on another Raspberry-Pi (plain Raspbian desktop) on my local network.

The address you saw from my previous screen grabs was not, it was (this is the address my GoPiGo gets from DHCP on my local network).

Nothing special about my local network setup. Computers and my router (cable modem) are all connected to a simple network switch.

If I just type dex.local:8001 in the address bar of Chrome, I get this:

If I then click the link to vnc_lite.html, I get this:

Typing robots1234 in the password field and pressing enter gives me this:

Looking into this issue further today and I’ve identified the problem.

When I type dex.local into the address bar of Chrome, I get this page:
When I click on the Launch VNC icon, I get this page (I have opened the Developer Tools in Chrome so you can see the error console):

It’s a bit difficult to read the error console, here’s an expanded view:

As you can see, it’s trying to connect to //dex:8001 and it can’t resolve that host name.

If I change the URL in the address bar from:




It connects immediately and I get this screen:

The file that loads when you go to dex.local is /var/www/novnc/index.php

If you change line 54 of this file from:

  <a href=" http://<?php echo $dexhost; ?>:8001/vnc.html?host=dex&port=8001&autoconnect=true&password=robots1234">


  <a href=" http://<?php echo $dexhost; ?>:8001/vnc.html?host=<?php echo $dexhost; ?>&port=8001&autoconnect=true&password=robots1234">

It will correct this problem.

Here is my edited version of /var/www/novnc/index.php:

  // Get host name and IP address
  $ethernetIP = $_SERVER['SERVER_ADDR'];
  $dexhost = $_SERVER['HTTP_HOST'];

    <title>Dexter Industries Raspbian for Robots</title>
    <link rel="stylesheet" href="css/main.css">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />

  <div class="main-container">
            <div class="main wrapper clearfix">
	<a href="" target="_blank">
     <img src="img/dexter-logo-sm.png" class="standard logo" alt="Dexter Industries!" >
     <img src="img/dexter-logo-retina.png" class="retina logo" alt="Dexter Industries!" >
  <h1>Raspbian for Robots.</h1>


    Welcome to Raspbian for Robots, our custom software for your Dexter Industries robots! There are two ways to view and program your robot.
    The easiest and most user friendly way for beginners is to go in through VNC (virtual network connections), which will show you a little desktop in your browser with icons and folders.
    If you are more advanced and want to work in the command line, choose Terminal and have fun!
<section class="vnc">
  <a href=" http://<?php echo $dexhost; ?>:8001/vnc.html?host=<?php echo $dexhost; ?>&port=8001&autoconnect=true&password=robots1234">
    <img src="img/vnc.svg" onerror="this.src='img/vnc.png'; this.onerror=null;"style="height:128px;">
    <span class="button">Launch VNC</span>
    <em>Password: <strong>robots1234</strong></em>
<section class="bash">
  <a href="http://<?php echo $dexhost; ?>:4200">
    <img src="img/bash.svg" onerror="this.src='img/bash.png'; this.onerror=null;"style="height:128px;">
    <span class="button">Launch Terminal</span>
      Username: <strong>pi</strong>
      Password: <strong>robots1234</strong>
<section class="IP">
    <li>Your Host is: <?php echo $dexhost; ?> </li>
    <li>Your IP is: <?php echo $ethernetIP; ?> </li>

<h3>Need more help?</h3>

    <li>See more about the <a href="" target="_blank" class="product brickpi">BrickPi.</a></li>
		<li>See more about the <a href="" target="_blank" class="product gopigo">GoPiGo.</a></li>
		<li>See more about the <a href="" target="_blank" class="product grovepi">GrovePi.</a></li>
		<li>See more about the <a href="" target="_blank" class="product pivotpi">PivotPi</a></li>

    <li>Ask a question on our <a href="" target="_blank" class="product">forums.</a></li>
</div> <!-- #main -->
   </div> <!-- #main-container -->

  • This corrects the problem as explained above.
    • Connects to dex.local instead of trying to connect to dex (this also works if you connect to a machine that does not have bonjour installed by using the IP address instead of the host name)
  • I made the changes to the php code in the first 5 lines to correctly retreive the host IP address.
  • I modified the <section class="IP"> to display the name and IP address of the host connected to.

Here’s what I get when I go to http://dex.local with the changes above:


Clicking the Launch VNC icon now connects immediately as expected.

@RobertLucian I don’t see how you are able to connect as shown in your screen capture above with the parameter host=dex in the URL.

Sorry for the long post, but I’m trying to explain fully.


1 Like

Thanks @kev.r . That edit fixes it for me as well. Thanks.

Hi @kev.r,

That’s a really great solution! Great work Kev (Kevin I suppose) ! And thank you a lot!

We’ll have it fixed and then release another version of Raspbian For Robots that will have the fixed version of noVNC.

Kudos to you!

thank you @kev.r !
The code is now in:
and a new image will be released shortly.

Perfect contribution! :heart_eyes:

@cleoqc, @RobertLucian

Looking for solutions to the problems posted in this forum helps me increase my knowledge and understanding.

I’m glad to be able to contribute something.


Just downloaded and flashed the new image from here:

All now works as expected.


1 Like

That’s really great to hear that.

Please let us know if anything goes bad.

Thank you!