Skip to content

Accessing Sonoma 14.5 mac EC2 instance through GUI/Screen Sharing

0

In the past, we have been using the knowledge found at https://repost.aws/knowledge-center/ec2-mac-instance-gui-access to access our mac instances at times when a GUI is needed vs just terminal access.

We are in the process of upgrading our machines to Sonoma 14.5, the old method seems to no longer allow access as we are bounced when trying to log in. Is there any updated guidance on how to allow screensharing through terminal commands on these new mac instances?

asked a year ago407 views
1 Answer
0

Hello, Greetings of the day!! Thank you for contacting AWS.

I understand that after updating the MacOs to Sonoma 14.5, the GUI access to mac instance using VNC is not working and you seek our assistance to verify if there are any terminal commands to allow screen-sharing on Sonoma 14.5 instances.

Before moving forward with the following steps, please ensure that you have taken a backup of your data. To take backup of data, please refer the following:

AMI - https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/tkv-create-ami-from-instance.html

Snapshot - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-snapshot.html#ebs-create-snapshot

In order to connect to your instance using ARD client or VNC client:

MacOS:

  1. Verify that your local computer has an ARD client or a VNC client that supports ARD installed. On macOS, you can leverage the built-in Screen Sharing application.

  2. From your local computer, connect to your instance using SSH.

  3. Set up a password for the ec2-user account using the passwd command as follows.

sudo passwd ec2-user
  1. Install and start macOS Screen Sharing using the following command.
sudo launchctl enable system/com.apple.screensharing
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist

4a. In case if the above command results in error "Load failed: 5: Input/output error", simply unload and reload:

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.screensharing.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
  1. Disconnect from the MacOS instance by typing exit and pressing Enter.

For more details, please refer: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-mac-instance.html#mac-instance-vnc


Troubleshooting GUI connectivity issues for Sonoma 14.5 instances:

  1. Try to restart and disable both the apple remote desktop and screen sharing services, then re-enable the screen sharing service:
  • Restart and Disable the Apple Remote Desktop (ARD)
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -activate -access -on -privs -all -allowaccessfor -allusers -restart -agent
	
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
  • Stop and Disable the Screen Sharing services
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
sudo launchctl disable system/com.apple.screensharing
  • Enable the macOS Screen Sharing service
sudo launchctl enable system/com.apple.screensharing
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
  • Check the service e.g. listening on port 5900, etc:

You should see tcp4 0 0 *.5900

sudo netstat -p tcp -van | grep LISTEN
sudo lsof -nP -iTCP:5900 -sTCP:LISTEN

In case if the issue persists, we would require details that are non-public information. Thus, I would request you to kindly open a support case with AWS using the following link - https://console.aws.amazon.com/support/home#/case/create

Thank you and have a nice day!

AWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.