Skip to content

crazyathlete220-stack/oldmac-display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oldmac-display

Create a virtual display on macOS — then use an old Mac (or any device) as a second screen for it.

oldmac-display makes a real, arrangeable macOS display that doesn't physically exist, using the private CGVirtualDisplay API. You can then view that display from another machine over screen sharing or a low-latency stream, which turns an old computer that can't be an HDMI monitor — like a 2011 iMac — into an extra display.

⚠️ This relies on a private CoreGraphics API (CGVirtualDisplay). It works today but Apple could change or remove it in a future macOS release.

Why

  • You want a headless / extra macOS display at a custom resolution.
  • You have an old Mac that can't do Target Display Mode and can't take HDMI input.
  • You want a free, scriptable alternative to GUI virtual-display apps.

Requirements

  • Host Mac: a recent macOS (uses ScreenCaptureKit; macOS 13+ recommended).
  • Command line tools: clang (install Xcode Command Line Tools).

Build

make            # builds the host binary
make apps       # also builds the .app bundles

Run

./oldmac-display

By default it creates a 1024x768 virtual display to the right of your main display and quits after 45 seconds as a safety guard (so a misconfigured layout can't strand your screen). Once you've confirmed it behaves, keep it running:

./oldmac-display --keep-alive

While it runs, macOS shows a display named Old Mac Display. Arrange it in System Settings > Displays and move windows onto it like any external monitor.

If a layout ever gets stranded, stop it:

pkill -f oldmac-display

Options

Flag Default Meaning
--keep-alive off don't auto-quit after the safety timeout
--width, --height 1024 / 768 virtual display resolution
--position right where to place it relative to the main display
--stream off start the experimental MJPEG browser receiver

(See main.m for the full list parsed in AppConfig.)

Viewing the virtual display from the old Mac

Option A — Screen Sharing (simplest)

With the host running, connect from the old Mac using macOS Screen Sharing to the vnc://... URL printed in the host log. This works everywhere but has noticeable latency.

Option B — Low-latency stream (Sunshine + Moonlight)

For a smoother experience, stream the virtual display with Sunshine on the host and receive it with Moonlight on the old Mac:

  1. Host: run oldmac-display --keep-alive to create the virtual display.
  2. Host: run Sunshine and point a stream at the Old Mac Display output.
  3. Old Mac: open Moonlight, pair with the host's IP, and pick the stream.

Install Sunshine and Moonlight from their official releases (linked above). On very old macOS (e.g. 10.13), use an older Moonlight build that still supports your OS version.

Option C — Experimental browser receiver

This repo also ships a tiny WebKit-based receiver for the old Mac:

make receiver-app

Copy OldMacReceiver.app to the old Mac, launch it, and enter the sender URL the host prints (e.g. http://<host-ip>:8377/). It goes fullscreen after connecting; press Esc to show the URL bar, Cmd-L to focus it.

Current scope & limitations

  • Works as an extended virtual display while the process runs.
  • Most stable viewing path is Screen Sharing/VNC; the MJPEG receiver is experimental (--stream only).
  • No keyboard/mouse forwarding yet.
  • Depends on a private CoreGraphics API (see warning above).

License

MIT

About

Create a virtual display on macOS (CGVirtualDisplay) and use an old Mac as a second screen via screen sharing or Sunshine/Moonlight

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors