Remote Desktop – Connect from Linux to Mac (RDP Style)

remote desktopscreen-sharingunix

I have Linux computer with two screens and (going to have) MacBook laptop with one screen. Both on the same LAN. I'd like to connect from the Linux computer to the Mac and work on the Mac using my two displays, mouse, and keyboard connected to the Linux computer. I don't need (and prefer not to) the MacBook's screen to display anything, I'd like to keep the laptop closed and use it basically as a headless server.

I've searched many questions here and on other portals, all come down to screen sharing (VNC) which is not the functionality I'm looking for: the Mac has a different resolution and different number of displays, obviously.

I'm looking for a functionality similar to Microsoft Remote Desktop (RDP) which I use to connect from the Linux machine to the Windows machine I currently have:

#! /bin/bash
PCPASS=$(zenity --entry --hide-text --title="PC Password" --text="Enter the Password")
xfreerdp \
/v:192.168.64.38 \
/u:myname \
/p:$PCPASS \
/d:server-s.domain.com \
/f /monitors:0,1 \
/multimon \
+fonts +window-drag +clipboard \
/audio-mode:1

I am aware similar questions have been asked many times, I've tried using TigerVNC and KRDC but all do the same thing – just mirror what I see on the Mac's display to the window of the VNC client I'm running on my Linux machine. Is there anything I can use to basically forward the graphical interface of the Mac to my Linux machine, the same way RDP does it with Windows servers (computers)?

Best Answer

I'm assuming you want the question answered for "standard" macOS applications, and not only for a very specific subset such as only X11-based software:

Built-in Support

The only remote control server built-in to macOS is based on the VNC protocol - essentially transferring a graphical image to the client (i.e. as opposed to for example X11, where it is possible to transfer mere "descriptions" instead of their bitmapped outcomes).

However, the built-in server is not limited to "mirroring" as you seem to indicate. For example, with the Apple Remote Desktop client, you can enable something named "Curtain Mode". Essentially this lets the display on the server only show a message stating that the computer is locked, while the remote client is able to interact with the user interface.

The built-in server does support a dual monitor setup, so it is possible to remote control built monitors on a Mac with two monitors. However, I do not believe it is possible to configure such a setup "virtually" (i.e. with hardware).

One way of solving your use case of a head-less Mac server with dual-displays is to buy dummy HDMI dongles that mimic a connected display. Add two of these to the laptop so that you see 3 displays in your System Preferences. Connect the laptop to a charger, so that it doesn't go to sleep, and you should be able to close it up and have it still be running with 2 "virtual" displays while the internal display is turned off. Connecting to it remotely via VNC will allow you to control applications on those two "displays".

Third Party Solutions

If you look at third party solutions, it is indeed possible to run an RDP server on macOS:

An open source solution like Xrdp is probably not what you want, as it doesn't allow for remotely controlling ordinary macOS applications.

An alternative is available from NuoRDS with their NuoRDS Terminal server which add an RDP server to macOS. They support macOS 10.12 and later (including macOS 12 Monterey), and allow a non-mirrored mode. For example they allow multiple users to connect to the same remote Mac at the same time while working with different applications. However, as far as I see, they do not describe in their documentation whether you can have 2 virtual displays on the remote Mac.

Another alternative is to look at products from Aqua Connect. Their Ignision Server adds an RDP server to macOS. They also have a Terminal Server product that works for macOS 10.9 and older (i.e. recent versions of macOS are not supported). Unfortunately it looks like there hasn't been any real development on the software for a number of years, so it might not work at all on recent macOS. They do list being able to work in a non-mirrored mode, but they do not specifically address being able to use more displays than the remote computer has.

I do not use the NuoRDS or Aqua Connect solutions myself, so I cannot check whether the specific function of having 2 virtual displays on the remote Mac is supported. I would advise contacting their customer support for clarification before buying a license.