What you're seeing is basically the OpenBox windows manager, and it's now far easier for you to do useful things with your Raspberry Pi!
Monday, 10 December 2012
Installing VNC on a Raspberry Pi
Where Raspberry Pi really differs from things like Arduino is that it uses a Linux distro complete with an X Server - this means it has a graphical windows-based interface similar Windows or OSX. I'm avoiding using an additional monitor/keyboard/mouse so I want to be able to view and interact with this remotely. There is a protocol called VNC used to access X Servers remotely to enable this (identical idea to Windows Remote Desktop). To enable remote access to our Rapsberry Pi we first have to install a VNC Server. Linux uses package management systems to simplify the installing of the vast array of available open source Linux software, the same way the Apple App Store and Google Play enable this for mobile phone/tablet software. To install our VNC server with first have to connect to the Pi over SSH, we then issue the command 'sudo apt-get install tightvncserver' and hit return. Sudo grants us permissions to install software (we're usually prompted to re-enter our password - 'raspberry' unless it's been changed), apt-get is the package management program, install tells apt-get we want to install something, tightvncserver is the name of the thing we want to install. Answer Y at the prompt and in a few second our VNC Server is installed. Now type 'vncserver' and hit enter, for a password you can put anything you like ('raspberry' may be a good choice!), you most likely wont need a view-only password, you should now being seeing something like this:
The part 'New 'X' desktop is raspberrypi:1' is signifiant as the ending number is the display number needed to connect (you can have multiple VNC Servers running simultaneously with different display numbers). You now need a VNC client to connect to your Pi, there are plenty of free options but to get up and running quickly I'd use TightVNC under Windows and Chicken under OSX (under Linux you'll probably find one already installed). The host you specify is the IP address of your Pi and the display number is most likely 1 (this is the number from earlier), you'll also need the password you entered earlier, if everything went to plan you'll now see something like:
What you're seeing is basically the OpenBox windows manager, and it's now far easier for you to do useful things with your Raspberry Pi!
What you're seeing is basically the OpenBox windows manager, and it's now far easier for you to do useful things with your Raspberry Pi!
Getting Started - SD Card Image and SSH
Getting going with the Raspberry Pi starter kit should be plug and play but for me things didn't quite go to plan; the red PWR came on but the green ACT light just flashed a couple of times and stopped. Connecting it up to my TV (over HDMI) showed a problem mounting one of the partitions and the from the forums this seemed to be a problem with the image on the SD card - this is no big deal as you'd want to make sure you have the latest image on to begin with anyway. Putting the latest SD card image on under OSX didn't help (seems that OXS adds additional files to the SD Card which can cause problems), but under Windows 7 using the latest Raspbian image and Win32DiskImager things worked perfectly and the Pi booted up properly. When it boots you see lots of ACT light action and when you plug in an ethernet cable the LNK, FDX and 100 LEDs will come on (assuming you have a switch etc on the other end of the cable).
I was determined not to connected the thing up to my TV and mess about with an additional keyboard and mouse, the problem with this is that by default the Pi uses DHCP to get an IP address. This means you really need a DHCP server to see what IP address the Pi got in order to connect to it, this is no problem at home where you can just log into your adsl/cable router and see the new entry appear:
Once you know the IP address you can connect to it using SSH (Secure Shell), OSX and Linux have an SSH client built in, under Windows the excellent and free PuTTY can be used. You'll be logging in using the username 'pi' and the password 'raspberry', using PuTTY you'd be putting in the IP address you found earlier as the Host Name then using both username/password to log in, under OSX/Linux you'd be opening an iTerm/Console window and typing 'ssh xx.xx.xx.xx -l pi', hitting enter then putting in the password. From this point onwards it doesn't matter what platform you're working under, what you should be seeing now is something like:
Now you can do something more exciting like install VNC Server so you can see a Window-based Desktop. Don't forget to run 'sudo halt' and wait for all the light apart from the red PWR one to go off before you unplug the power.
I was determined not to connected the thing up to my TV and mess about with an additional keyboard and mouse, the problem with this is that by default the Pi uses DHCP to get an IP address. This means you really need a DHCP server to see what IP address the Pi got in order to connect to it, this is no problem at home where you can just log into your adsl/cable router and see the new entry appear:
Once you know the IP address you can connect to it using SSH (Secure Shell), OSX and Linux have an SSH client built in, under Windows the excellent and free PuTTY can be used. You'll be logging in using the username 'pi' and the password 'raspberry', using PuTTY you'd be putting in the IP address you found earlier as the Host Name then using both username/password to log in, under OSX/Linux you'd be opening an iTerm/Console window and typing 'ssh xx.xx.xx.xx -l pi', hitting enter then putting in the password. From this point onwards it doesn't matter what platform you're working under, what you should be seeing now is something like:
Now you can do something more exciting like install VNC Server so you can see a Window-based Desktop. Don't forget to run 'sudo halt' and wait for all the light apart from the red PWR one to go off before you unplug the power.
Subscribe to:
Posts (Atom)


