# Access Xcode GUI Over VNC on a Remote Mac

Canonical: https://figment.so/blog/mac-vnc-xcode-gui-remote

Use your plan's encrypted remote desktop for the Xcode GUI. If you prefer your own VNC client, enable macOS Screen Sharing and connect only through an SSH tunnel, never straight to port 5900.

**To use the Xcode GUI on a remote Mac, open the encrypted remote desktop that comes with your plan. If you would rather use your own VNC client, enable macOS Screen Sharing on the Mac and reach it only through an SSH tunnel.** Never expose port 5900 to the public internet. Figment has not published its own remote desktop client or protocol, so this guide covers the macOS Screen Sharing route that you set up and control yourself.

## Which Xcode features need the GUI?

`xcodebuild` handles most CI work, but a few Xcode features have no command-line equivalent. Check whether your work is genuinely graphical before you set up a VNC client:

| Feature | CLI equivalent | Needs GUI |
|--------|---------------|-----------|
| Build & run unit tests | `xcodebuild test` | No |
| Archive and export | `xcodebuild archive` + `xcodebuild -exportArchive` | No |
| Code coverage report | `xcrun llvm-cov` / Slather | No for reports; yes for interactive browser |
| Instruments: Time Profiler | `xctrace record` (record only) | Yes for the trace UI |
| Memory Graph Debugger | None | Yes |
| SwiftUI Previews | None | Yes |
| Devices & Simulators window | `xcrun simctl` | No for management; yes for visual launch |
| Scheme editor | None | Yes |
| TestFlight / App Store upload | `xcrun altool`, Transporter, Fastlane `pilot` | No |
| Notarization | `xcrun notarytool` | No |
| Core Data model editor | None | Yes |

If your work is entirely in the "No" column, SSH is faster and lighter than a VNC pipe.

## How do I enable Screen Sharing from a shell?

Run the following with administrator privileges on the Mac. `kickstart` lives inside `ARDAgent.app` and is Apple's long-standing command-line entry point for Remote Management. See the [Apple Remote Desktop guide](https://support.apple.com/guide/remote-desktop/welcome/mac) for the UI equivalent.

```bash
# Enable macOS Remote Management (which exposes Screen Sharing on TCP 5900)
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
  -activate \
  -configure \
  -access -on \
  -clientopts -setvnclegacy -vnclegacy yes \
  -clientopts -setvncpw -vncpw "CHANGEME1" \
  -restart -agent \
  -privs -all
```

The `setvnclegacy yes` option enables the legacy VNC authentication path that third-party clients use. The protocol caps that password at 8 characters, which is why you must not leave port 5900 reachable from the internet and should use the SSH tunnel below. Prefer ARD authentication (a local macOS user) wherever your client supports it.

Verify the service:

```bash
sudo launchctl list | grep -i screen
# Expected row: com.apple.screensharing
```

Disable it when you are done:

```bash
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
  -deactivate -configure -access -off
```

If `kickstart` returns an error on a newer macOS build, enable Screen Sharing once from System Settings → General → Sharing → Screen Sharing, then keep automating with `launchctl`.

## How do I connect through an SSH tunnel?

Forward a local port to the Mac's port 5900 over SSH, then point your VNC viewer at the local port. The tunnel encrypts the session and keeps VNC authentication off the open internet.

```bash
# Local machine: tunnel local 5901 to the Mac's 5900 over SSH
ssh -L 5901:localhost:5900 user@<remote-mac-ip> -N
```

Keep this command running while you work. Every viewer below connects to `localhost:5901`.

**From Windows with TigerVNC.** [TigerVNC](https://tigervnc.org/) is a maintained open-source VNC client. The current stable Windows installer is on the project's [GitHub releases page](https://github.com/TigerVNC/tigervnc/releases) (1.16.2, March 2025, as of this writing; check for a newer tag).

1. Open **TigerVNC Viewer**.
2. In the VNC server field, enter `localhost:5901`.
3. Click **Connect** and enter the password you set with `-setvncpw`.
4. Launch Xcode from the Dock or Spotlight on the remote desktop.

Before connecting, open **Options → Compression**:

- **Encoding:** Tight
- **Color level:** Medium (16-bit). Xcode's chrome is mostly static, so the perceived quality cost is small.
- **JPEG quality:** start at 6, and raise it if code text looks smeary.

**From Linux with Remmina or vncviewer.** On Ubuntu or Debian:

```bash
sudo apt install remmina remmina-plugin-vnc
# or the TigerVNC client
sudo apt install tigervnc-viewer
vncviewer localhost:5901
```

In Remmina, create a VNC connection to `localhost:5901` and choose **Image quality: Medium** to start. Remmina's quality slider maps to bit depth, and 16-bit is a reasonable starting point for Xcode over a 50 Mbit/s or better link.

## How do I set resolution and color depth?

macOS Screen Sharing streams the Mac's actual framebuffer. Headless Macs often start at a low virtual resolution, which you can raise with `displayplacer`:

```bash
# Inspect current displays and modes
system_profiler SPDisplaysDataType

# Install and set a 1440x900 mode
brew install jakehilborn/jakehilborn/displayplacer
displayplacer list
displayplacer "res:1440x900 hz:60 scaling:off origin:(0,0) degree:0"
```

Use this table as a starting point for typical broadband VNC over the public internet, and measure rather than assume:

| Downlink | Resolution | Color depth | Where it hurts |
|---------|-----------|-------------|----------------|
| 10–25 Mbit/s | 1280×800 | 16-bit | Instruments timeline redraw |
| 25–100 Mbit/s | 1440×900 | 16-bit or 24-bit | Still readable during scroll |
| 100+ Mbit/s | 1920×1080 | 24-bit | Lag concentrated in animated views |

A Memory Graph session is mostly click-through interaction and benefits more from bit depth than frame rate. Instruments trace views redraw continuously, so cutting color depth usually helps more than cutting resolution.

## How do I keep the session usable and safe?

**Reconnect behaviour.** TigerVNC Viewer on Windows has **Options → Connection → Reconnect on disconnect** with a configurable retry interval, and Remmina has the same under its connection profile. Neither replaces a real session guard: if the Mac reboots, you will need to reauthenticate. The SSH tunnel also needs restarting after a drop.

**Rotate and shut off.** Change the VNC password per session on shared hosts, and run the `kickstart -deactivate` command when you finish. The legacy VNC password is 8 characters and brute-forceable, so never leave port 5900 reachable from the public internet.

## Which Figment Mac plan fits GUI work?

Every Figment plan includes a built-in browser desktop and SSH. The Intel Mac VM and the Dedicated M4 Pro also include encrypted remote desktop, so you can add your own VNC route there if you want one. For occasional Instruments or Memory Graph sessions, the [Apple Silicon Mac VM](/mac-hosting#apple-silicon-vm) ($39 a month, $6 a day) is a reasonable starting point. We have not measured Instruments, SwiftUI Previews or GPU-heavy simulators inside a VM, so for heavy GUI work choose the [Dedicated M4 Pro 48 GB](/mac-hosting#dedicated-m4-pro) ($349 a month, or $299 a month on a 12-month term) and test your project in the first days. You can cancel month to month at any time. The [Intel Mac VM](/mac-hosting#intel-vm) ($25 a month) runs macOS Sequoia and fits Xcode 26.3 or earlier, which suits CLI-driven work better than GUI profiling. See all [Mac hosting plans](/mac-hosting).

**Related guides:**
- [Use Xcode on Windows via a Remote Mac](/blog/mac-xcode-on-windows-remote-setup)
- [SSH-Based Xcode Workflow on Linux](/blog/mac-xcode-linux-ssh-workflow)
- [Run a GitHub Actions Self-Hosted Runner on a Remote Mac](/blog/mac-github-actions-self-hosted-runner)
