Remote control Ubuntu MATE on the Raspberry

The Raspberry is a neat machine to work without any keyboard, mouse and Monitor. But sometimes you need to change things and login.

You can remotely gain access to the command line of a Raspberry Pi from another computer on the same network using ssh.

Note you only have access to the command line, not the full desktop environment. In Ubuntu MATE SSH is turned on by standard. Simply fire u a client and make a connection.

On Ubuntu client you can use remmina to make a connection to the Raspberry PI that runs Ubuntu MATE. Install it using

sudo apt-get install remmina

setup remmina for SSH connection

Fire up Remina and enter your server Address. SSH always uses port :22

Enter your username that you use to login on Ubuntu MATE op the PI and the password that belongs to it.

You should get a SSH shell to a terminal. Leave it open. We're going to need it.

The Desktop remotely controlled

VNC is a graphical desktop sharing system that allows you to remotely control the desktop interface of one computer from another. It transmits the keyboard and mouse events from the controller, and receives updates to the screen over the network from the remote host.

You will see the desktop of the Raspberry Pi inside a window on your computer. You'll be able to control it as though you were working on the Raspberry Pi itself.

    • On your Pi (using a monitor or via SSH), install the TightVNC package:

sudo apt-get install tightvncserver

    • Next, run TightVNC Server which will prompt you to enter an username, a password and an optional view-only password. This last one is not needed.

tightvncserver

    • Start a VNC server from the SSH terminal from you client computer and NOT from the Raspberry PI running Ubuntu MATE.

    • This example starts a session on VNC display zero (:1):

vncserver :1 -geometry 1920x1080 -depth 24

    • Now, on your computer, start the VNC client remmina:

      • remmina

And start enter a new setting:

VNC

Use the username and password you just entered in tightVNCserver and presse ENTER. You should now see the PI's desktop running Ubuntu MATE remotely.

Remember to fire the VNCserver from the SSH terminal and not from the terminal of you PI itself since it won't work.

To make starting and stopping the VNCserver easier I made two scripts that you can put in your home folder for easy access:

In the SSH shell enter these two commands. They make two scripts. ./vnc.sh and ./vnckill.sh

printf 'vncserver :1 -geometry 1200x900 -depth 24 -dpu 96' > ~/vnc.sh

printf 'sudo /usr/bin/vncserver -kill :1' > ~/vnckill.sh

To make the scripts executable enter:

chmod +x vnc.sh

chmod +x vnckill.sh

Whenever you reboot your PI, simply login the SSH shell and execute from the command prompt the script like this:

./vnc.sh

To start the VNC server and eventually

./vnckill.sh

To stop the VNC server.

And now a final tip. You may forget these self made script commands. So we simply add them to the message of the day that shows up every time you start the SSH shell. To do that we have to make it permanently by removing the simlink to /var/run/motd that /etc/motd is. If not it will be removed after restart.

sudo rm /etc/motd

sudo nano /etc/motd

and enter

Use ./vnc.sh to start a VNC server session end ./vnckill.sh to stop the session

Or whatever you would like to enter and exit using CTRL X, Yes and ENTER.