NavigationContentFooter
Jump toSuggest an edit

Troubleshooting remote desktop connections to Mac mini servers

Reviewed on 12 June 2024Published on 07 April 2023

This documentation provides a structured approach to diagnose and resolve issues when you cannot establish a remote desktop connection to your Mac mini.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • A Mac mini

1. Verify the server status

Execute the following ping command in a terminal on your local machine:

ping -c 5 <server_ip>

Expected output:

PING X.X.X.X (X.X.X.X): 56 data bytes
64 bytes from X.X.X.X: icmp_seq=0 ttl=64 time=0.182 ms
64 bytes from X.X.X.X: icmp_seq=1 ttl=64 time=0.261 ms
64 bytes from X.X.X.X: icmp_seq=2 ttl=64 time=0.191 ms
64 bytes from X.X.X.X: icmp_seq=3 ttl=64 time=0.200 ms
64 bytes from X.X.X.X: icmp_seq=4 ttl=64 time=0.201 ms
--- X.X.X.X ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.182/0.207/0.261/0.028 ms
  • If ping fails, try rebooting the server.
  • If rebooting fails or if the server was forced to shut down, wait 24 hours for automatic restart. See How to shutdown a Mac mini for more information.

2. Verify the VNC connection

Execute the following command in a terminal on your local machine:

nc -zv <server_ip> 5900

Expected output:

Connection to <server_ip> port 5900 [tcp/rfb] succeeded!
  • If the connection fails, try rebooting the server.
  • If necessary, restart screen sharing via SSH. See Restarting screen sharing via SSH.

3. Verify the SSH server response

Execute the following command:

nc -zv <server_ip> 22

Expected output:

Connection to <server_ip> port 22 [tcp/ssh] succeeded!
  • If the connection fails, try rebooting the server.

4. Check for connection blacklisting

If VNC connection attempts repeatedly fail, the connection might be blacklisted, or the Apple screen sharing service might be unresponsive.

  • Reboot the server to clear the fail2ban table.

5. Verify your connection credentials

Remote desktop (VNC) credentials

  • Ensure the correct username and password are used. These can be verified in the console.
  • For errors like “Authentication failed,” verify credentials and retry.

SSH keys

  • Ensure the SSH key is correctly formatted and configured before installing the Mac.
  • SSH keys provided post-installation are not considered.

6. Verify remote connection client compatibility

Ensure your remote connection client is compatible with macOS. Incompatible remote desktop (VNC) clients can cause failed connection attempts. For recommended VNC clients, see How to access to the remote desktop of a Mac mini.

7. Reinstall the Mac mini

If the previous attempts to resolve connection issues to your Mac mini have been unsuccessful, you may need to reinstall your server from the Scaleway console.

Follow these steps to reinstall macOS on your Mac mini:

  1. Log in to your Scaleway console.
  2. Navigate to your Mac mini server.
  3. Select the option to reinstall a version of macOS.

For detailed instructions, refer to How to reinstall a Mac mini.

Important

Reinstalling your Mac mini will erase all data on the disk and reset all configurations to default settings. Ensure you have a backup of your data before proceeding.

Security and configuration

Enable and configure pf (Packet Filter)

To restrict macOS Screen Sharing to specific IPs:

  1. Connect to your Mac mini via SSH:
    ssh@<your_mac_mini_ip>
  2. Backup the pf.conf file:
    sudo cp /etc/pf.conf /etc/pf.conf.backup
  3. Edit the pf.conf file:
    sudo nano /etc/pf.conf
  4. Add rules to restrict access:
    ## Add these lines to block connections to port 5900 except from your static IP
    block in on en0 proto tcp from any to any port 5900
    pass in on en0 proto tcp from <static IP> to any port 5900
    Replace en0 with your network interface and <static IP> with the allowed IP address.
  5. Save and close the file.
  6. Apply the new configuration:
    sudo pfctl -f /etc/pf.conf
  7. Test the screen sharing connection from the allowed IP and verify it is blocked from other IPs.
Tip

For advanced configuration and further information consult our fail2ban tutorial.

Restarting screen sharing via SSH

If screen sharing is unresponsive, restart it via SSH:

  1. Connect to your Mac mini via SSH:
    ssh your_mac_mini_username@<your_mac_mini_ip>
    • Replace <your_mac_mini_username> with your Mac mini username.
    • Replace <your_mac_mini_ip> with the actual IP address of your Mac mini.
  2. Restart the screen sharing daemon:
    sudo killall screensharingd
    The service will restart automatically upon the next connection attempt.

Troubleshooting and support

For further assistance, visit our #apple-silicon channel in the Slack Community.

Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway