Connecting to macOS via Remote Access Protocol (RDP)

This article explains how to connect to a macOS system using the RDP protocol. While macOS includes a built-in VNC server for VNC client connections, we'll explore using the standard Microsoft Windows RDP client instead. 

Below are installation and configuration steps tested on MacBook Pro running macOS Big Sur.

 

Prerequisites Installation

  1. Install Xcode Command Line Tools

    xcode-select --install
  2. Install Homebrew Package Manager

     
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Install OpenSSL Library

     
    brew install openssl
    export CPPFLAGS="-I$(brew --prefix openssl)/include"
  4. Install Required Packages

     
    brew install automake libtool pkgconfig nasm
  5. Install XQuartz 2.7.11

Configuration Setup

  1. Create Working Directory

    mkdir /Users/administrator/Documents/xrdp/


Рисунок 1

                                                                                           

Enable macOS Screen Sharing

  • Go to System Preferences → Sharing


                                       

  

  • Enable Screen Sharing

                                                    

  • Click Computer Settings and enable:

    • "Anyone may request permission to control screen"

    • Set VNC password under "VNC viewers may control screen with password"

                                                         

Download the required packages.

We need xRDP and xOrgRDP in source code format.
You can download them from the official site: http://xrdp.org/. First, download xrdp:

  1. Go to the website

  2. Click 'View xrdp releases'"

 

                                                                                          

Find xrdp version 0.9.11 and click

   

Click xrdp

                                                                                 

                                                                                                              Рис. 8

Click Code and copy the link

                                                                                                                 

Navigate to the xrdp folder you created earlier.

Run the following git command to clone the repository:

git clone https://github.com/neutrinolabs/xrdp.git


                                                                           

Downloading the xorgxrdp Package

Go to the xrdp.org homepage.

Click the "View xorgxrdp releases" button.

 

                                                                           Рис. 11

 

Locate version 0.2.11.

                                                                                               Рис. 12

Click xorgxrdp

                                                                                                                                    Рис. 13

 

Click the "CODE" button and copy the repository URL.

 


                                                                                                                           

Navigate to the xrdp folder you created earlier.

Run the following git command to clone the repository:

git clone https://github.com/neutrinolabs/xrdp.git

                                                                                        

xRDP Installation

Clone Repositories

 
cd /Users/administrator/Documents/xrdp/
git clone https://github.com/neutrinolabs/xrdp.git
git clone https://github.com/neutrinolabs/xorgxrdp.git

Build xRDP

 
cd xrdp
./bootstrap
./configure PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig
make
sudo make install

Build xorgxrdp

cd ../xorgxrdp
./bootstrap
./configure PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
make
sudo make install

xRDP Configuration

Edit Configuration File

 
sudo nano /etc/xrdp/xrdp.ini

Enable only the Xvnc section:

 
[Xvnc]
name=Xvnc
lib=libvnc.dylib
username=ask
password=ask
ip=127.0.0.1
port=5900
xserverbpp=24

Comment out other sections

Start Services

sudo /usr/local/sbin/xrdp
sudo /usr/local/sbin/xrdp-sesman

Network Configuration

Configure your edge device with these rules:

Firewall Rules

  • Allow incoming traffic on RDP port (default: 3389)

NAT Rules

 
| Setting          | Value              |
|------------------|--------------------|
| Original IP      | Edge IP address    |
| Original Port    | Custom RDP port    |
| Protocol         | TCP                |
| Translated IP    | Mac IP address     |
| Translated Port  | 3389               |
| Source IP/Port   | Any/Any            |

Connection Test

From Windows:

Open Remote Desktop Connection

Enter Edge_IP:Custom_Port

Use macOS administrator credentials

 

Troubleshooting

Check logs if connection fails:

tail -f /var/log/xrdp.log
tail -f /var/log/xrdp-sesman.log

Have you tried Cloud4U services? Not yet?

Visit Website

Try for free

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Connecting to MAC OS using the VNC remote access protocol

In this article, we will describe how to connect to MAC OS using the VNC remote access protocol....

Android Studio Installation & Emulator Setup on macOS

Prerequisites Enable Hardware Virtualization (vCloud Director): Navigate to your macOS VM...