Raspberry Pi Basic Setup + Remote Access on Linux Using Xrdp and Remmina

by Big Tuna in Circuits > Raspberry Pi

2273 Views, 1 Favorites, 0 Comments

Raspberry Pi Basic Setup + Remote Access on Linux Using Xrdp and Remmina

IMG_20221022_034106935.jpg

One of the first things you need to set up when getting started with raspberry pi is remote desktop access, no matter what you intend to use the pi for. This is because one of the primary advantages of the pi is that it’s small and convenient, but that upside disappears when you have to plug in a clunky keyboard/mouse/monitor setup to it every time. In this tutorial, I’m going to be going over some basic setup steps, as well as covering how to set up remote desktop access on a linux computer using Xrdp and Remmina. (Note: This instruction set does not include comprehensive security measures, and is best performed using a home wifi network. If you need access to your pi at work or school, you will need to do additional setup to ensure it is secure.)

Supplies

Raspberry Pi with SD card with Raspbian OS installed

USB Keyboard

USB Mouse

HDMI Monitor and cable

Computer running Linux

Keyboard and Mouse

IMG_20221022_033954912.jpg

Connect the USB keyboard and mouse to the USB ports on the end of the Raspberry Pi

Monitor and Power

IMG_20221022_034049551.jpg

Connect your monitor via HDMI cable to the side of the raspberry pi, and plug in the raspberry pi to power next to it. This should cause a red or green light to light up on the pi, and it will boot up.

Setting a Password

Screenshot_from_2022-10-20_19-19-31.png

Click on the terminal icon on the top left of the raspberry pi (shown in the image below), and type “sudo passwd pi” into the window that opens. When you hi enter, this will prompt you to set a password for the pi – set it to something you can remember. The default username is “pi”.

Connecting to Wifi Automatically

Screenshot_from_2022-10-20_19-21-54.png

Now we need to connect the raspberry pi to the internet so that we can update it and set it up. Open the terminal in the top left, and type “sudo nano /etc/wpa_supplicant/wpa_supplicant.conf” this w ill open a file that you can edit to set your raspberry pi to automatically connect to wifi. Edit the file so that it looks like the image.

Network_Name and Network_password should be the name and password of your wifi. The second “network={“ is not necessary, it’s just there to demonstrate that you can put as many networks as you want here, just set them up the same as the first one. If you are outside of the United States, you will need to do something else for the “country” line, so you should look up the correct setting for your region.

Once you’re done editing the file, you can exit by hitting the control key and the X key. A message will appear at the bottom of the window asking for confirmation, hit Y to save your changes, and then hit enter afterwards when the prompt changes.

Now that you’ve edited the file, go back to the terminal and type “sudo reboot” to reboot the pi and have your changes take effect.

Update the Pi

If you successfully completed step 4, your pi should now be connected to the internet, so it’s a good idea to make sure everything is up to date.

To do this, open the terminal up again, and this time type in “sudo apt-get update”. Once that’s done, type in “sudo apt-get upgrade”. Once you’ve done both of those (the time for each of these varies, it depends on how up to date your pi already is, it could take a few seconds, but don’t panic if it takes a few minutes instead) it’s time to reboot the pi again so that the changes can take effect. Type “sudo reboot” into the terminal again.

Installing Xrdp on the Pi

Now that the pi is up to date and connected to the internet, we can finally get it set up for remote desktop access. Some versions of raspbian come with in-built programs for this, but we’re going to replace those with a similar one that uses a different protocol to connect the computers. This process is relatively simple.

First, type “sudo apt-get remove xrdp vnc4server tightvncserver” into the terminal. Once that’s done, type “sudo apt-get install tightvncserver xrdp” and run that. These seem very similar, but it’s important to remove the old files that may be on the pi so that they don’t interfere with the installation of the new ones.

Getting the Pi's Ip

With that set up, we’re almost ready to start accessing the pi from another computer, we just need the IP address of the raspberry pi before then. To get this, type “hostname -I” into the terminal, and it will print your pi’s IP address on the next line. Take a note of this number somewhere, as you’re going to need it again soon.

Download Remmina Onto Your Linux Computer

Now you need to install remmina on your linux device, so that you can access the pi from there. Remmina is an open-source remote desktop application for windows which works with several remote desktop protocols, including RDP, which is what we’re using. You can download remmina a few ways, I recommend either going through the Ubuntu Software application that come standard on Ubuntu (for simplicity) or using Flatpak. A guide on how to install Flatpak on Ubuntu can be found here: https://flatpak.org/setup/Ubuntu and once you’ve downloaded that you can get remmina here: https://flathub.org/apps/details/org.remmina.Remmina

Configuring the Remmina Profile

Screenshot_from_2022-10-22_01-34-55.png
Screenshot_from_2022-10-22_01-35-27.png

Open remmina now that it is installed. Click on the “new” icon in the top left (highlighted in image). This will prompt you to create a new Remote Connection Profile. Fill in the “name” line with anything you want, and the “server” line with the IP address of your raspberry pi, that you found in step 7. Make sure that t he “protocol” dropdown is set to RDP-Remote Desktop Protocol. Click “save”. This will take you back to the original remmina window, but now your profile will appear. Double-click on the profile to connect to your raspberry pi.

Conclusion

Congratulations! You’re now ready to access your raspberry pi from your linux machine at any time, without all that clunky hardware setup. You’ve taken the first step into programming and building with raspberry pi, so go out there and find some cool projects to do!