This is a slight variant on an earlier set of instructions I posted a while ago here.
The basic premise is to use another computer as the input console for the Raspberry Pi without needing to get a separate screen, keyboard and mouse on the Pi. Ideal if you've got a room full of laptops, chrome books or iMacs for example.
This way differs from the previous in that you don't need to install any software on the host computer/laptop. You can set the Raspberry Pi up so that it provides everything the host computer needs through the web browser. It makes it as easy as typing an address in

Here is an example of the end product on Windows / IE:

What will it work on?
Any HTML5 compliant web browser. But basically these and above:
- Chrome 8
- Firefox 4
- Safari 5
- iOS Safari 4.2
- Opera 11
- IE 9
Best to start with a fresh install of Raspbian and follow these instructions while logged in as the default pi user.
So the aim here is to install the VNC server software as well as a web based HTML5 client onto the Raspberry Pi.
We're first going to need to install a few packages (TightVNC server and screen). Run these commands from the terminal.
Code: Select all
sudo apt-get update
sudo apt-get install tightvncserver screen -y
Code: Select all
tightvncserver
Code: Select all
cd /usr/local/share/
sudo git clone git://github.com/kanaka/noVNC
Code: Select all
cd noVNC
sudo cp vnc_auto.html index.html
Code: Select all
cd utils
sudo ./launch.sh
Code: Select all
No installed websockify, attempting to clone websockify...
Code: Select all
Navigate to this URL:
http://blablabla
Press Ctrl-C to exit
WebSocket server settings:
- Listen on :6080
- Flash security policy server
- Web server. Web root: /usr/local/share/noVNC
- No SSL/TLS support (no cert file)
- proxying from :6080 to localhost:5900
Next we need to set everything to start automatically since you're probably going to want to use the Raspberry Pi in headless mode.
To do this we just need to create a few scripts inside init.d, enter the following commands.
Code: Select all
cd /etc/init.d/
sudo wget https://dl.dropboxusercontent.com/u/14125489/RaspberryPi/vncboot --no-check-certificate
sudo nano vncboot
Press Ctrl - O followed by Enter to save, then Ctrl - X to quit from editing.
The script we've just created basically makes VNC part of the background services that Linux is controlling.
We next need to register the script, enter the following commands:
Code: Select all
sudo chmod 755 vncboot
sudo update-rc.d vncboot defaults
That's the server part done. Next we need to setup a similar script for the HTML5 client.
Code: Select all
sudo wget https://dl.dropboxusercontent.com/u/14125489/RaspberryPi/vncproxy --no-check-certificate
sudo chmod 755 vncproxy
sudo update-rc.d vncproxy defaults 98
Now you should be able to reboot and both services will start up automatically.
Code: Select all
sudo reboot
You will be prompted for the password that you specified when setting up the VNC server.
I have occasionally observed an error on the first time that you try to connect, I think this is being caused by the proxy getting started before the VNC server socket is open.
If you see this the top bar goes red. Just hit refresh (F5), enter the password again and it should work.
Master and slave mode
There is another trick you can do here if you want to really have things sown up. I also describe this in the previous post but there are a few differences here.
Using the following instructions each Raspberry Pi will be directly connecting to the host computer using a single Ethernet cable, thus making a completely isolated point to point network between the two and therefore your network administrators shouldn't have any cause to complain. Note: you don't need a cross over cable for this, a standard cable will work because the Pi Ethernet port auto-switches the transmit and receive pins.
Firstly we'll need to install some more software on the Pi. We’re going to make the Pi Ethernet port behave in a similar way to a home router. This means assigning a static IP address to it and installing a DHCP service (dnsmasq) that will respond to address requests from the host computer.
Enter these commands:
Code: Select all
sudo apt-get install dnsmasq -y
Code: Select all
sudo nano /etc/network/interfaces
Code: Select all
iface eth0 inet dhcp
Code: Select all
# iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
The Raspberry Pi will now have a static address of 10.0.0.1
Next we need to configure dnsmasq (that we installed earlier) to give out IP addresses. I am going to explicitly specify a configuration file for the dnsmasq service so let’s first make a backup of the default config file and then save my one in its place.
Code: Select all
cd /etc
sudo mv dnsmasq.conf dnsmasq.default
sudo nano dnsmasq.conf
Code: Select all
interface=eth0
dhcp-range=10.0.0.2,10.0.0.250,255.255.255.0,12h
dhcp-option=3,10.0.0.1
dhcp-option=6,10.0.0.1
Next we're going to make a small edit to the hosts file. This will allow the user to type in pi into the browser instead of 10.0.0.1.
Enter the following command to edit the hosts file.
Code: Select all
sudo nano /etc/hosts
Code: Select all
10.0.0.1 pi
Next disconnect the Pi from the LAN and reboot.
Code: Select all
sudo reboot
The host computer should then be given an IP address which will be 10.0.0.X where X is a random number between 2 and 250.
One thing to try is to open up a command prompt on the host computer (a Terminal on OSX and Linux) and enter the following command;
Code: Select all
ping 10.0.0.1
You should now be able to open up a web browser on the host computer and enter pi into the address bar to get to the VNC client page.
Note: Windows users: This may not work properly on Windows (you'll still need to use 10.0.0.1) but if you install a package called winbind you'll be able to type the Raspberry Pi hostname into the browser. Usually this is raspberrypi. The winbind package can be installed with the command below:
Code: Select all
sudo apt-get install winbind

You will be prompted for the password that you specified when setting up the VNC server.
I have occasionally observed an error on the first time that you try to connect, I think this is being caused by the proxy getting started before the VNC server socket is open.
If you see this the top bar goes red. Just hit refresh (F5), enter the password again and it should work.
Hope it's helpful!
Dave