Microsoft Remote Desktop Raspberry Pi

broken image


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.)

For more detail: Remote desktop from Windows to Raspberry Pi Low cost PCB at PCBWay - only $5 for 10 PCBs and FREE first order for new members PCB Assembly service starts from $30 with Free shipping all around world + Free stencil. The Remote Desktop Protocol (RDP) is Microsoft's proprietary protocol that makes use of a low bandwidth connection to provide access to your desktop. To allow usage of RDP on the Raspberry Pi, we will be making use of a piece of software called xrdp. Now open the remote desktop connection program and write your IP address where it's written 'computer' and press on Connect. Insert your username (usually pi) and your password and then press ok. If all went well you should be connected remotely to the desktop of the Raspberry Pi.

Preparation

Enable Remote Connections on Microsoft Windows 10

1) Open Control Panel

2) Click on System and Security

3) At the 'System' section, click 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.
  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

2) In the popup window click on Add button

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

!

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).

Raspberry PI Setup

Raspberry
  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
  6. Install OpenBox Windows Manager and x11 Windowing System by running the following command.
Remote
Raspberry
  1. Next, Install Remmina, an opensource Remote Desktop client with RDP support.

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

  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.

  2. Next, edit the file /home/pi/.profile (use: nano /home/pi/.profile) and append the following line at the end of the file.

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

    and add the following line:

  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 :

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

Select 'System Options'

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

Raspberry Pi Microsoft Remote Desktop

And finally, select 'B2 Console Autologin'

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

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.

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

  2. Now Remmina will ask for the password:

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

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.

WTware for Raspberry Pi

Assistant

WTware for Raspberry Pi can boot from local SD-card or by network. Since Pi 3B+ you need microSD card only for local boot, network boot is performed automatically.

  1. Download and install WTware for Raspberry Pi on server.
  2. Run on server WTware graphic configurator, press button and create SD card for local boot (or for versions before 3B+ for network boot) using WTware wizard:
  3. Insert if needed card into Raspberry Pi.
  4. If you don't use WTware DHCP service and want to boot by network, specify in DHCP 067 parameter: 6.0.46kernel7.img
  5. Turn Raspberry Pi on.

Configuration files structure is the same as in WTware for all devices. You can use graphic configurator, just remember, that half of parameters are not supported yet.

Desktop
  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
  6. Install OpenBox Windows Manager and x11 Windowing System by running the following command.
  1. Next, Install Remmina, an opensource Remote Desktop client with RDP support.

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

  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.

  2. Next, edit the file /home/pi/.profile (use: nano /home/pi/.profile) and append the following line at the end of the file.

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

    and add the following line:

  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 :

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

Select 'System Options'

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

Raspberry Pi Microsoft Remote Desktop

And finally, select 'B2 Console Autologin'

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

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.

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

  2. Now Remmina will ask for the password:

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

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.

WTware for Raspberry Pi

WTware for Raspberry Pi can boot from local SD-card or by network. Since Pi 3B+ you need microSD card only for local boot, network boot is performed automatically.

  1. Download and install WTware for Raspberry Pi on server.
  2. Run on server WTware graphic configurator, press button and create SD card for local boot (or for versions before 3B+ for network boot) using WTware wizard:
  3. Insert if needed card into Raspberry Pi.
  4. If you don't use WTware DHCP service and want to boot by network, specify in DHCP 067 parameter: 6.0.46kernel7.img
  5. Turn Raspberry Pi on.

Configuration files structure is the same as in WTware for all devices. You can use graphic configurator, just remember, that half of parameters are not supported yet.

Monitor resolution for Pi is stored in config.txt file on SD card, not in WTware configuration files. On Raspberry Pi manufacturer site you can find all settings for config.txt file. By default Raspberry Pi sets 1920x1080 resolution.

Raspberry Pi was tested with old cheap 18.5' Philips 191V monitor connected by HDMI-DVI cable in it's standart resolution 1366x768. If Pi works with such device in such resolution, then it should work with most other digital (HDMI and DVI) monitors in other resolutions. For 1366x768 resolution by HDMI-DVI cable these two lines must be specified:

Raspberry Pi Enable Remote Desktop

hdmi_group=2
hdmi_mode=81

Sound, FAT32/exFAT/NTFS disks, printers, scanners, USB-COM ports redirection work now.

Raspberry Pi Remote Desktop Client

WTware for Raspberry Pi performance is sufficient for performing office tasks.





broken image