We often need to carry out tests or studies regarding new tools and our "main" machine, which is often the work or is used for courses, is not the best environment to perform these activities. We can corrupt or "dirty" the Operating System (OS) with multiple tests and installations of multiple applications.
Ideally, we have a separate study, testing and development environment. An alternative, mainly for studies and tests, is to create a virtual machine using Virtual Box, for example. Another interesting alternative is to use a Raspberry Pi.
Let's install a version of Ubuntu and configure remote access via both RDP and SSH. In this way, we will be able to access our “web server” of tests and studies remotely from our “main” machine.
Objective
To create a linux environment for development, testing or
study using Ubuntu installed on a Raspberry Pi.
What is covered in this tutorial
- Installing Ubuntu on a Raspberry Pi
- Server configuration and access with SSH and RDP
Important informations:
- “Main” machine OS: Linux Mint 19.3 Tricia.
- Raspberry Pi Model: 4 Model B 4GB RAM.
- Memory card used: SanDisk Micro SD 32GB.
- OS installed on Raspberry Pi: Ubuntu Desktop 20.10.
Note: We don't use Ubuntu Server because it doesn't come with a graphical interface. To be more “friendly” we will use Ubuntu Desktop. If the intention is to train linux commands, you can use Ubuntu Server. We chose Desktop as it is more user-friendly for a study environment for those who have not yet mastered the terminal's commands.
1. Download and install the Raspberry Pi OS: with it, you can install the OS on the SD memory card that serves as “hd” on the Raspberry Pi.
Go to Raspberry Pi downloads and download according to your OS version. In this example, we use the Ubuntu version because my OS is Linux Mint.
After the download is complete, just run the file and install the Raspberry Pi Imager. In the case of Mint/Ubuntu we have a .deb file to run:
When accessing the Raspberry Pi Imager we have to choose the OS that will be installed and the Memory Card. Then just click on Write and wait for the work to be done by the application.
Once the Ubuntu image is written to the memory card, simply insert it into the Raspberry Pi and start.
2. Install XRDP for remote access via RDP:
Open the terminal and install XRDP with the following command:
sudo apt install xrdp After restarting the computer, let's install the xorgxrdp package:
sudo apt-get install xorgxrdp 3. Install and configure SSH
sudo apt install openssh-server
Upon completion SSH usually starts automatically. The command to start the service manually is:
sudo service ssh start 4. Install net-tools and check the IP
Both via RDP and via SSH we need the IP of the machine. So, let's install net-tools:
sudo apt install net-toolsTo find the ip just run in the terminal: ifconfig:
5. Remote access via RDP:
From Linux Mint we will use Remmina to perform remote access via RDP. To install it run the terminal:
sudo apt-add-repository ppa:remmina-ppa-team/remmina-next
sudo apt update
sudo apt install remmina remmina-plugin-rdp remmina-plugin-secret
Open Remmina and enter the IP, username and password:
6. Remote access via SSH
For access via SSH we will use the terminal: ssh USUARIO@IP. The user's password will be requested and then access will be granted, as shown in the example below. To disconnect to type exit in terminal: