Showing posts with label Raspbian. Show all posts
Showing posts with label Raspbian. Show all posts

Thursday, December 3

Remoting into the Pi - all the tools you'll ever need


Being able to connect to a server somewhere out in the wild or in the neighbourhood of your local network is certainly something that has been going on for decades.
The most common activities that one would want to perform on a remote server are:
  • Issue commands
  • Transfer files
Commands needs User Interfaces which can either be:
  • Text based aka terminals
  • Graphical User Interface aka GUI
All of this have to be complimented with a number of protocols that allow the act of remoting from a client to a server.

Let's see what happens in the most frequent cases.

SSH

Issuing commands to a remote server is mostly done by using the SSH protocol. The Raspbian OS comes with an SSH server enabled by default so all we need to do is to get the right client for the platform from which we want to connect from.

On Windows the best know is PuTTY which in its basic incarnation looks like this


and it is an incredibly great tool to issue commands in a very versatile terminal window.
Somebody else built on top of PuTTY and tried to get to grips with the clatter caused by the need of having to deal with many sessions all opened at once.
The tool is MTPuTTY which is what it says on the tin: Multi-Tabbed PuTTY !


Fantastic, but if you are really hard core and you live in an era where virtual machines had not been invented, you can still use the never ageing Cygwin (although you might actually have good reasons to use it in favour of a VM)

SFTP and SCP

Of course one of the most important things to do on an operating system which revolves all around files is to be able to move them back and forth, around and about via SFTP or SCP whenever this last one might be preferred.
SFTP on Raspbian come as part of the SSH server and also in this case there is nothing to be done on the Pi.
My favourite tools are Filezilla and WinSCP although the humble PSFTP installed with PuTTY can still do a great job if nothing else is available.
A great thing of WinSCP is that it will be able to import all your PuTTY sessions as you install it and it supports SCP  along with SFTP. In many instances I have seen people preferring WinSCP to Filezilla.


Filezilla though has my preference as it still supports FTP which is still somewhat handy for the likes of uploading content to websites.


There is of course more to see and discuss about these two great clients but it is time to move on to the next set of tools.

VNC

Text based terminals are great but we live in an extremely visual world and Graphical User Interfaces are preferred by many with good cause. One of the obvious desires then is to be able to interact directly with the Raspbian desktop and this can be achieved using some form of Virtual Network Computing based software.


There are quite a few incarnations of VNC servers and clients and although Rasbian doesn't come with a specific one the Raspberry Pi foundation seems to point to TightVNC which can be installed fairly easily following their simple guide.


As for the client side ... well there are quite a few but I use RealVNC which covers quite a few platforms and does the job excellently. Remember that your display will be display 1 and that to indicate to the VNC client that you are not connecting to the default screen 0 you will have to write <IP Address>:1 e.g. 10.42.0.53:1


X and the rest

If you feel more adventurous you can try the ways of the X server. The X Window System is based on the X11 protocol and has been on the scene for many years.



The advantage of this approach is the possibility to run programs that need a graphical interface from you terminal session. If for example you would need to quickly run the Pi's browser whilst working via PuTTY, you  can simply invoke epiphany and an X windows displaying the browser will come up on your screen.


Counterintuitively the X server will have to be installed on your "from" location.
I have always used Xming as it installs really easily and integrates perfectly with PuTTY.
Just remember to enable X forwarding in your PuTTY session before connecting.


As you run Xming nothing will seem to happen but the program's icon will be displayed in the notification area.


Running a command from PuTTY that will open up in X will result in an X icon being shown in your taskbar and that is for all matters and purposes a window within your client system.


Of course the best way to go to a Linux box is with a Linux box and this can be achieved in a number of ways. All of the above can be done from an Ubuntu machine whether it is your default operating system or you are running an instance as a virtual machine of your Windows host. The software to use will be rather different for the majority but the mechanisms described are the same.
One strange beast to mention in this realm is Cygwin which, as they say on its website,

"is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows"

and that in fact will allow to work on your Windows box in a "Linuxy" way. One thing we could obviously do is to connect to a Pi from a Cygwin terminal. We can type in xinit and the following whitish window will pop up to indicate that an X server is available! Fantastic


Let's type in a few lines to connect to our Pi and in my case the command is:

ssh -X pi@10.42.0.53

This means that I am using the SSH client in Cygwin on which I am enabling X forwarding (-X) to my Cygwin X server and connect as the user pi to 10.42.0.53
Once I give the password I am in my Pi as shown by the green prompt. From there I can launch lxtask  and get my graphical task manager displayed via Cygwin. Isn't that the most useless thing? :)


Jokes apart though this shows probably one of the many coolest ways to connect to a remote Linux box and it is as close as native Linux as you can get on a Windows computer.

That's all folks

These tools covered most of the use cases that you will ever encounter but bare in mind that what I have listed here are only some of the tools that are available. Also the majority of what I described applies only to Windows. There is of course much more, there is also Apple stuff and one and a million way to do things in Linux.

Note that some of these softwares are also distributed as executable instead of full install. This is great when you want to carry your tools around on a USB key or when the administrators of the systems on which you need to work aren't too lenient on you installing new software. So when downloading check which type you are getting hold of.

Mostly if you can spare some money for those projects that accept donations you can play an important role in promoting what's good out there, right?

This closes "all the tools you'll ever need to remote into your Pi".
Have fun

Tuesday, December 1

Remoting into the Pi

In this video playlist I am going through the steps needed to connect remotely to a Raspberry Pi terminal session.
In a nutshell the videos will show the following:

  • Retrieve the IP address
  • Install Putty
  • Connect to the Pi
  • Customise the Putty sessions
Remoting into the Pi - Part 1

Remoting into the Pi - Part 2

Monday, November 23

Installing Rasbpian with Noobs



You bought yourself a shiny new Raspberry Pi, maybe the brand new Pi Zero and now you are really fidgety about doing something exciting with it but ... there are a few things that need to be done first.

I have provided three complementary videos that you can watch to go through the entire process or if you prefer you can go through the following brief instructions

This is in a nutshell what needs to happen:


  • Get an SD card
  • Format the SD card
  • Transfer NOOOBS onto the card
  • Boot your Raspberry Pi with NOOBS
  • Select and install the Operating System

The first thing you need to do is to get yourself an SD card with a suitable Operating System installed on it so that the Raspberry Pi can run all the basic software that is needed for it to do anything.

At this point NOOBS is your friend!

NOOBS is a piece of software that will help you installing the Operating System onto the SD card.

This can go either of two ways:


  1. Buy a card with a preloaded NOOBS on it
  2. Reuse one you already own and prepare it with NOOBS yourself.

The preferred Operating System for the Pi is Raspbian and its latest incarnation is called Jessie. The names of the versions of this OS are coming from Toys Story, the previous one in fact was called Wheezy!

Now Wheezy's character was a bit chubby and Jessie's was quite slim in the cartoon but despite this you will need a bigger SD card to store Jessie than you would have with Wheezy as the OS Jessie is a bit bigger than its predecessor. With this in mind make sure you use at least an 8 GB SD card for your Pi.


  • Follow this section only if you are reusing you card


If you are going to reuse your card you have to first format it or in other words prepare it to be able to transfer NOOBS onto it, to do so you can use a software called SDFormatter. It is a really easy install to perform and you can use the videos provided if in doubt.



Make sure to backup the contents of your SD card before proceeding as the tool will delete all files in it

Select the right drive letter corresponding to your SD card and click on Format. You will have to accept a couple of alert messages and you card will be ready shortly after.

Once the card is formatted you will need to transfer NOOBS on it. First of all let's get hold of NOOBS.



Once downloaded (it will take a while) it will have to be unpacked in a temporary folder of your choice.

With the content unpacked you will now have to select all the files and copy/paste them onto the SD card you have just formatted (that also will take a while).



The card is now ready to be ejected from the card reader and plugged into the Raspberry Pi.


  • Whether you have used your own card or purchased one with NOOBS pre-installed this is what needs to happen next


Make all the necessary connections to the video, the network, the mouse and keyboard and finally plug the power supply in.

After a short while you should lend onto this page



Select install near to Raspbian and ... after a while and a few rather useful information displayed during the installation, the process will terminate and prompt you for restarting into Rasbpian for the very first time.

Great! You made it, your Raspberry Pi is now ready for many adventures to come

Here are the embedded videos mentioned above

HW preparations to get started

Prepare the SD card, get hold of Noobs and transfer it onto the card

Connecting all up and install Raspian