Raspberry PI RDP Thin Client

Updated 14/04/2021
Thin Clients, are computers which are optimized to establish a remote connection to a server and run using the remote resources. Usually those systems are not meant to be used for intensive tasks or gaming and they are mostly found in office environments. In the following guide you will find out how to use a Raspberry PI to connect to a local Windows Computer using Microsoft’s RDP Protocol.
Every version of Microsoft Windows following the release of Windows XP includes a Remote Desktop Connection (RDC) client (mstsc.exe). The Remote Desktop Connection is accomplished through the Client using the Remote Desktop Protocol a proprietary Microsoft Protocol which provides a graphical interface to connect to another computer.

Requirements

1) A computer running Microsoft Windows XP or later.
2) A Raspberry PI Device. (Prefer a Raspberry PI 3 or 4 for performance reasons)
3) Network connectivity between the two devices. (If the devices are not in the same local network, port forwarding must be enabled at the router of the Computer’s network.)

Preparation

Enable Remote Connections on Microsoft Windows 10

1) Open Control Panel

ControlPanel

2) Click on System and Security

System and Security

3) At the "System" section, click Allow remote access

Allow Remote Access

4) A new window will pop up. Select the Remote tab.
5) Under the "Remote Desktop" section:

  • check the Allow remote connections to this computer option
  • check the Allow connections only from computers running Remote Desktop with Network Level Authentication option.

Remote

  1. Click OK and close the window.

Allow only Specific Users to login remotely. [Optional]

1) From the Remote Tab, click the Select Users… button

Remote-Add User

2) In the popup window click on Add button

Add User

2) Type the preferred username(s) using commas to separate them

Remote User!

3) Click the Check Names button, to validate username(s). If username(s) is/are valid username(s) on the current computer then the computer’s name will be prepended to the username(s).

User validation

Raspberry PI Setup

  1. Prepare a new sd-card with RaspiOS Lite (Version Used for this tutorial: January 11th 2021)
  2. In the boot partition of the sd-card create an empty file, name it "ssh" and make sure it has no extension.
  3. Insert the SD card in your Raspi, connect it to your local network and power it up.
  4. Establish an SSH connection to the raspi using the default credentials (pi/raspberry). Use the official guides for Windows or Linux or Mac if you haven’t use SSH before.
  5. After connecting using SSH, update and upgrade your distribution
    sudo apt update
    sudo apt upgrade -y
  6. Install OpenBox Windows Manager and x11 Windowing System by running the following command.
    sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox xdg-utils -y

  1. Next, Install Remmina, an opensource Remote Desktop client with RDP support.
    sudo apt install remmina -y

    Remmina on Raspberry

8.Make a configuration file at your home directory "/home/pi" and name it "windows.remmina".

Make a new file

  1. Add the following contents to the configuration file (use: sudo nano /home/pi/windows.remmina): Change server from xxx.xxx.xxx.xxx to your computer’s IP address and username to the computer’s login username. The password will be requested when remmina run.

    [remmina]
    sound=off
    sharefolder=
    resolution_mode=2
    serialdriver=
    cert_ignore=0
    console=0
    name=Windows
    serialname=
    exec=
    clientname=
    shareserial=0
    shareparallel=0
    ssh_enabled=0
    serialpath=
    colordepth=66
    loadbalanceinfo=
    disable_fastpath=0
    ssh_auth=0
    postcommand=
    group=
    ssh_charset=
    resolution_height=0
    server=xxx.xxx.xxx.xxx
    ssh_loopback=0
    enableproxy=0
    username=username_here
    ssh_password=
    ssh_username=
    gateway_server=
    gateway_password=
    sharesmartcard=0
    quality=0
    password=
    resolution_width=0
    printername=
    microphone=0
    gateway_username=
    serialpermissive=0
    smartcardname=
    disablepasswordstoring=0
    security=
    disableautoreconnect=0
    execpath=
    gateway_usage=0
    parallelname=
    precommand=
    glyph-cache=0
    relax-order-checks=0
    domain=
    parallelpath=
    ssh_server=
    protocol=RDP
    shareprinter=0
    printerdriver=
    gateway_domain=
    disableclipboard=0
    ssh_privatekey=
    gwtransp=http
    viewmode=1
    window_maximize=1
    window_width=1920
    window_height=1080
  2. Next, edit the file /home/pi/.profile (use: nano /home/pi/.profile) and append the following line at the end of the file.

    [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx

    Edit .profile

  3. Configure xinitrc by editing /etc/X11/xinit/xinitrc (use: sudo nano /etc/X11/xinit/xinitrc) :
    Comment out the following line:

    . /etc/X11/xsession

    and add the following line:

    exec openbox-session

    xinitrc file

  4. Lastly, edit openbox configuration file (use: sudo nano /etc/xdg/openbox/autostart) and type the following commands at the end of the file to disable any form of Screen Saver, Screen Blanking and Power Management and set Remmina to launch when launching openbox :

    xset s off
    xset s noblank
    xset -dpms
    remmina -c /home/pi/windows.remmina &

    Openbox Autostart

  5. Configure console autologin
    Run Raspberry PI configuration by typing:

    sudo raspi-config

    sudo raspi-config

Select "System Options"

Raspi Config Menu

At the next screen select "S5 Boot / Auto Login"

System Options

And finally, select "B2 Console Autologin"

Boot / Auto Login Menu

Use the Arrow Keys (Right arrow twice) to move to the Finish Button

Raspi Configuration Menu

Before Reboot confirmation connect your Raspberry to an external screen and attach a Mouse and a Keyboard in order to be ready for the next step.

Raspi Reboot Confirm

Establishing an RDP Connection

  1. At this point everything is ready, your Raspberry will boot to OpenBox and Remmina will open asking to Accept the Certificate for the connection. Click on YES
    Remmina Windows 10 Certificate

  2. Now Remmina will ask for the password:
    Remmina Enter Password

  3. Finally, connection established, toggle fullscreen and you are ready to go!
    Remmina Full Screen

Extra Functionality

Shutdown Hardware Button

You can also add a Power On / Off button to your Raspberry PI using the information from the Raspberry PI Drone post

Show Desktop’s Background instead of Black Screen

Added 14/04/2021
By changing "quality" property in the windows.remmina file from 0 to 9 your backround will be visible

Full Screen connection

Added 14/04/2021
By changing "viewmode" property in the windows.remmina file from 1 to 4 the connection will start in full screen.

5 2 votes
Article Rating
Subscribe
Notify of
guest

4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jeff at home

Seems like a LOT of work for a remote desktop connection. I just install xrdp and use rdp to the pi.

Fabiano

You didn’t understand anything! What is exposed here is the reverse path to what xrdp does.

John

Hi thanks for above
I have one small issue when signing our of RDP session I can not get login screen again till reboot my PI4
I am using the above to the tee
How to I enable the login screen to automatically reappear once signed out

Ted

I would also like to know how you restart the remmina session if the user signs out of the Windows rdp session.