Overview
Connecting to a macOS machine from a Linux workstation using VNC (Virtual Network Computing) should theoretically be seamless. However, macOS includes proprietary extensions on top of the standard Remote Frame Buffer (RFB) protocol. This often leads to immediate disconnects, authentication failures, or black screens when using open-source clients like Remmina.
This guide covers the end-to-end setup to establish a reliable VNC connection from Linux to macOS, explains the two-stage authentication model, and details the critical setting needed to prevent Apple’s proprietary security handshake from dropping your session.
Prerequisites
- A Linux desktop running Remmina with the VNC plugin installed (
remmina-plugin-vnc). - A target Mac connected to the same local network (or accessible via VPN).
- Administrative privileges on the Mac to enable Screen Sharing.
1. Configure macOS Screen Sharing
By default, macOS Screen Sharing prioritizes Apple’s native Remote Desktop protocol. To allow standard VNC clients to connect, you must explicitly enable password-based VNC access.
- On the Mac, open System Settings and navigate to General → Sharing.
- Toggle Screen Sharing (or Remote Management) to ON.
- Click the Info (
i) or Computer Settings button next to Screen Sharing. - Check the box: “VNC viewers may control screen with password”.
- Set a dedicated VNC password.
Traditional VNC authentication uses DES challenge-response encryption, which enforces a strict limit of 8 characters. Keep your VNC password between 6 and 8 characters to avoid silent truncation or authentication mismatches.
- Under Allow access for, ensure your macOS user account is permitted to access the screen.
- Identify the Mac’s IP address by running the following in Terminal on the Mac:
ipconfig getifaddr en0
(If connected via Wi-Fi, replace en0 with en1). Example IP: 192.168.1.100.
2. Understanding Two-Stage Authentication
A common point of confusion when accessing macOS over VNC is the requirement for two separate credentials at distinct layers of the connection:
- Stage 1 — The VNC Handshake Password:
The password defined in macOS under “VNC viewers may control screen with password”. Remmina uses this password during the initial protocol handshake on TCP port5900to establish the display stream. - Stage 2 — The macOS User Account Credentials:
Once the display stream connects, macOS presents the graphical lock screen / login window. You enter your standard macOS username and account password into the remote display to unlock the desktop session.
3. Verify Network Connectivity
From your Linux terminal, verify that TCP port 5900 on the Mac is open and reachable:
nc -zv 192.168.1.100 5900
Expected output:
Connection to 192.168.1.100 5900 port [tcp/rfb] succeeded!
4. Configure Remmina Connection Profile
- Open Remmina on your Linux machine.
- Click New Connection Profile (
+icon). - Under the Basic tab, configure the following:
| Field | Value | Notes |
|---|---|---|
| Name | Mac Remote | Friendly profile name |
| Protocol | VNC - VNC Plugin | Ensure the VNC plugin is selected |
| Server | 192.168.1.100:5900 | Replace with your Mac’s IP address |
| Username | your_mac_username | Your short macOS username |
| Password | your_vnc_password | The VNC password set in Step 1 (max 8 chars) |
| Color depth | True color (32 bpp) | Prevents display artifacts and blank windows |
| Quality | Good or Best | Adjust based on your local network speed |
5. The Critical Fix: Disable Encryption
When Remmina negotiates security schemes with macOS, the Mac offers several options:
- Security Type 30 / 33: Apple Remote Desktop (ARD) Diffie-Hellman encryption.
- Security Type 2: Standard VNC Authentication.
By default, Remmina attempts to negotiate Apple’s proprietary Type 30, which open-source libvncclient cannot complete, causing an immediate disconnect or timeout.
To resolve immediate dropouts, force Remmina to negotiate standard Security Type 2 by checking Disable encryption.
To apply the fix in Remmina:
- In the Remmina profile editor, click the Advanced tab.
- Check the option: Disable encryption.
- Click Save and Connect.
6. Configuration File Reference (.remmina)
If you prefer managing Remmina profiles programmatically or via text configuration, connection files are stored in ~/.local/share/remmina/:
[remmina]
name=Mac Remote
protocol=VNC
server=192.168.1.100:5900
colordepth=32
quality=9
viewonly=0
disableclipboard=0
disableserverinput=0
disableencryption=1
username=your_mac_username
password=.
(Note: password=. indicates the password is stored securely in your system keyring via glibsecret).
7. Connect and Log In
Following the steps below completes the end-to-end handshake and opens your remote macOS session.
- Launch the connection in Remmina.
- Remmina will complete the VNC handshake using the VNC password.
- The remote desktop window will open displaying the macOS lock screen.
- Click into the window and enter your macOS account password to unlock your desktop.
8. Troubleshooting Checklist
- Authentication Failed / Immediate Disconnect:
Verify Disable encryption is checked in the Advanced tab. If disabled, Remmina falls into an unsupported Apple ARD handshake. - Password Rejected on Handshake:
Verify the VNC password set on the Mac does not exceed 8 characters. - Black Screen:
Ensure Color depth is set to32 bpp(orClient default) rather than lower color modes. - Debug Protocol Negotiation:
Run Remmina in debug mode from terminal to view the handshake:
G_MESSAGES_DEBUG=remmina remmina -c ~/.local/share/remmina/<profile_name>.remmina
A successful connection will confirm:
Selecting security type 2
Selected Security Scheme 2
VNC authentication succeeded