Skip to content
mlainezPublic

About

Turn a Retina 5K iMac into a network monitor for your Linux desktop: GNOME extended display, AirPlay, and its speakers, camera, USB and disks lent over the network.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

118 Commits

Folders and files

Repository files navigation

Retinet

Turn a Retina 5K iMac into a network monitor for your Linux or Mac desktop.

Apple dropped Target Display Mode with the Retina iMacs: their beautiful 27-inch panels cannot take a video input. Retinet gives them one over Ethernet. The iMac boots a small Linux system from a USB stick, runs entirely from RAM, and becomes an extra monitor of a GNOME desktop on another computer, with 16–18 ms of end-to-end latency, or of a Mac. Its speakers, microphone, camera, USB ports, SD card and macOS disk are lent to a Linux computer while it streams; its speakers, disks and SD card to a Mac. When no computer is streaming, iPhones, iPads and Macs can mirror their screen to it with AirPlay.

The macOS installation is never modified: remove the stick and restart, and the iMac is a Mac again.

The iMac waiting for a computer

Features

  • Extended desktop: GNOME treats the iMac as a real monitor (3840×2160 at 60 Hz, scale 150 %), or at the panel's full 5120×2880 (scale 200 %, sharper). Drag windows to it, arrange it in Settings.
  • Low latency: zero-copy hardware H.264 encoding on the sender's GPU, decoding sliced across the iMac's four cores, immediate page flips, and a hardware cursor that moves independently of the video.
  • One click: an iMac Display tile in GNOME's Quick Settings finds the iMac on the network by itself, starts and stops everything.
  • Peripherals: the iMac's USB devices (camera, Bluetooth, keyboard, trackpad, anything plugged into its ports) appear on the Linux computer as local USB devices; its speakers and microphone as iMac speakers and iMac microphone; its disks (macOS, Windows, Linux) and SD card in the file manager, writable where Linux can write them safely.
  • Brightness: a slider in the tile sets the iMac's backlight.
  • Macs too: a menu bar app extends a Mac's desktop to the iMac (macOS 15 and newer, Apple silicon and Intel), with its brightness, and mounts the iMac's disks and SD card in Finder.
  • AirPlay: Screen Mirroring from an iPhone, iPad or Mac, with sound, while no computer streams; or music alone, with the cover art and track on screen.
  • Power button: a short press shuts the iMac down cleanly.

What you need

Tested Should work Not supported
iMac 27-inch Retina 5K, late 2014 (iMac15,1) 27-inch Retina 5K, late 2015 (iMac17,1) Later iMacs, non-Retina iMacs (which have real Target Display Mode)
Mac macOS 15 Sequoia on a MacBook Pro 13-inch 2017 (Intel, through OpenCore Legacy Patcher) macOS 15, 26 and 27 on any Mac, Apple silicon or Intel macOS 14 and older
Linux computer GNOME 51 on Wayland (Fedora-based): a desktop with an AMD Radeon RX 7800 XT, and a Framework Laptop 13 with an Intel Core i7-1370P (Iris Xe graphics) GNOME 49–51 with any other GPU that has a VA-API H.264 encoder (AMD, Intel) NVIDIA's proprietary driver (no VA-API encoder), X11 sessions, other desktops
Network Gigabit Ethernet, same LAN A direct cable between the two Wi‑Fi

Plus a USB stick of at least 512 MB.

Quick start

1. Write the stick

Download retinet-imac-<version>.img.xz from the latest release and write it to the stick with GNOME Disks (Restore Disk Image), balenaEtcher, or:

xz -dc retinet-imac-0.1.0.img.xz | sudo dd of=/dev/sdX bs=4M conv=fsync status=progress

Replace /dev/sdX with the stick (check with lsblk): everything on it is erased.

2. Boot the iMac from it

  1. Plug the stick and an Ethernet cable into the iMac.
  2. Power it on while holding ⌥ Option, and pick Retinet (the stick).
  3. After a few seconds the iMac shows No signal and its IP address.

macOS stays the default startup disk: restart without the stick (or without holding Option) to get macOS back.

3. Install the sender on the Linux computer

From a Mac, install Retinet.app instead: see From a Mac.

curl -fL https://github.com/mlainez/retinet/releases/latest/download/retinet-host-x86_64.tar.gz | tar xz
retinet/host/install.sh

The installer sets up the sender, the Quick Settings tile and two small system services, and asks for your password once (on immutable systems such as Silverblue or Bluefin, run it from the host, not from a toolbox). The download contains prebuilt binaries for x86-64 (glibc 2.39 or newer, as on every distribution with GNOME 49).

Then log out and back in once, so GNOME loads the tile.

Each release lists the SHA-256 of its downloads and of the binaries in the package, and GitHub signs a build attestation for the package: gh attestation verify retinet-host-x86_64.tar.gz -R mlainez/retinet checks that it was built by this repository.

Building from source instead
git clone https://github.com/mlainez/retinet
retinet/host/install.sh

From a source tree the installer builds the sender. That needs Rust 1.89 or newer (cargo; use rustup if your distribution's is older), clang, pkg-config and the libva and PipeWire development files:

  • Fedora: sudo dnf install cargo clang pkgconf-pkg-config libva-devel pipewire-devel
  • Debian, Ubuntu: sudo apt install clang pkg-config libva-dev libpipewire-0.3-dev, plus Rust from rustup
  • Immutable systems (Silverblue, Bluefin, …): install them in a distrobox; the installer finds it and builds there.

4. Use it

Open Quick Settings and click iMac Display. Within a few seconds the iMac shows your desktop. Its menu has:

The iMac Display menu in GNOME's Quick Settings

  • Brightness of the iMac's panel.
  • Smooth video: the iMac waits for its panel's refresh before showing a new frame. Off, frames appear about 10 ms sooner, but fast motion can show a horizontal tear line; on for watching video.
  • Full resolution (5K, sharper): the panel's own 5120×2880 at 200 % instead of 3840×2160 at 150 %: the same desktop size, every pixel of the panel. The GPU encodes twice the pixels and the iMac takes about 4 ms more to decode; changing it restarts the stream.
  • Encoder: Automatic or a specific GPU; GPUs that cannot encode are listed with the reason.
  • Share iMac USB devices and disks: lends the iMac's peripherals (see below).

Click the tile again to stop. Arrange the iMac relative to your other monitors in GNOME Settings → Displays, like any monitor.

From a Mac

Retinet.app, a menu bar app for macOS 15 Sequoia and newer (Apple silicon and Intel), extends a Mac's desktop to the iMac and mounts the iMac's disks and SD card in Finder while it streams:

curl -fL https://github.com/mlainez/retinet/releases/latest/download/retinet-mac-universal.tar.gz | tar xz
xattr -dr com.apple.quarantine retinet-mac/Retinet.app
mv retinet-mac/Retinet.app /Applications/
open /Applications/Retinet.app

Then turn on iMac Display in its menu. The app is not notarized by Apple, hence the xattr line. Permissions, the menu, the disks, the command-line sender and what a Mac does not get (the iMac's USB devices and microphone) are in the Mac guide.

AirPlay

While the No signal screen shows, the iMac is an AirPlay receiver named iMac: on an iPhone or iPad, Control Center → Screen Mirroring → iMac; on a Mac, Control Center → Screen Mirroring. The picture is scaled to fill the panel and the sound plays on the iMac's speakers. A computer that starts streaming takes over; AirPlay comes back a few seconds after it stops.

The iMac is also an AirPlay speaker: pick iMac as the output in the Music app, Control Center's audio card or any AirPlay button, and the sound plays on its speakers while the screen shows the cover art, title and artist.

  • The device must be on the same network as the iMac.
  • Protected video (the Apple TV app, Netflix, Disney+, …) is only sent to receivers certified by Apple; those apps mirror their sound only. Watch such services in a browser on the Linux computer and stream that instead.
  • Use Screen Mirroring: the AirPlay button inside video apps is not supported.

Sharing the iMac's peripherals

With Share iMac USB devices and disks on, while it streams:

On the iMac On the Linux computer
USB devices: camera, Bluetooth controller, keyboard, trackpad, anything plugged into its ports Real USB devices (USB/IP)
Internal disks: every partition it can read Network drives in the file manager, named after the volume (Macintosh HD, …)
SD card SD Card network drive (followed by the card's label)
The Retinet stick Retinet network drive, to edit the settings
Speakers iMac speakers sound output
Microphone iMac microphone sound input
Filesystem Shared
FAT, exFAT, NTFS, ext2/3/4 Read-write
NTFS of a hibernated Windows (fast startup included) Read-only: writing would be lost or damage the volume when Windows resumes
APFS (macOS 10.13 and later), Fusion Drives included Read-only: Linux has no reliable APFS write support. A macOS installation shares only its data volume, with your home folder
Mac OS Extended (HFS+) Read-only (Linux cannot write journaled HFS+, the macOS default)
FileVault-encrypted APFS, BitLocker Not shared: Linux cannot unlock them

WRITABLE in the settings changes which filesystems are read-write. Files written to an ext2/3/4 disk belong to root on that disk. EFI and recovery partitions are never shared.

Everything returns to the iMac when the stream stops, and an SD card can come and go at any time. The USB stick Retinet booted from never goes over USB/IP. Only the computer that streams can reach these services. Large file copies share the gigabit link with the video and slow the picture down while they run.

A Mac receives the disks, the SD card and the Retinet drive, mounted in Finder by Retinet.app, and plays its sound on the speakers; not the USB devices or the microphone (see the Mac guide).

Settings

Settings live in retinet.conf on the stick, which lists every setting with its default. Edit it in the Retinet network drive while you stream with sharing on, or plug the stick into any computer and open its RETINET drive. Changes apply at the next connection (AirPlay ones once no computer streams); restarting the iMac applies everything.

Setting Default
AIRPLAY yes no turns AirPlay off
AIRPLAY_NAME iMac Name in the Screen Mirroring list
AIRPLAY_PASSWORD empty Password AirPlay clients must enter
SHARE_USB, SHARE_DISKS, SHARE_AUDIO yes What the iMac lends; SHARE_USB=no keeps its keyboard, trackpad and camera on the iMac, as Macs cannot receive them
SHARE_INTERNAL yes no keeps the internal disks private
SHARE_STICK yes no hides the Retinet drive
WRITABLE vfat exfat ntfs ext2 ext3 ext4 Filesystems shared read-write; hfsplus may be added (non-journaled volumes only)
USB_EXCLUDE empty USB devices (vendor:product) kept on the iMac
SCREEN_SLEEP 10 Minutes with nothing to show before the screen goes off (0: never); a computer, AirPlay or a key press wakes it
BACKGROUND_SECONDS 30 Seconds before the next picture from the stick's backgrounds folder (JPEG; add your own) shows behind the screen's text; 0 keeps one

Sender options (resolution, quality, …) are listed by ~/.local/lib/tdm/tdm-send --help; put them in TDM_ARGS= in ~/.config/tdm/sender.env.

Troubleshooting

Problem What to check
The tile keeps Searching… Both machines on the same network; the iMac broadcasts on UDP 4996, which the installer opens in firewalld. Other firewalls: allow UDP 4996 and 5011 in.
The tile says Failed journalctl --user -u tdm-send
USB devices or disks missing journalctl -u 'tdm-devices@*'; the vhci-hcd kernel module must be available on the Linux computer
The iMac is not in the iPhone's Screen Mirroring list Same network as the iMac; some routers block mDNS between Wi‑Fi and Ethernet, or on guest networks
AirPlay app shows a black picture The app's video is DRM-protected (see AirPlay)

Limits

  • The panel always runs in its two-link 5120×2880 mode (with the kernel patches of Richard Lane's amd-gfx series "drm/amd: Enable 2x1 tiled display support on Apple Intel Retina iMacs"); a 4K stream, AirPlay and other sizes are scaled to it by the iMac's GPU.
  • A 5K stream is two H.264 streams, one per half of the panel: H.264 encoders stop at 4096 pixels wide.
  • One computer at a time.
  • Anyone on the network can stream to the iMac or mirror to it; set an AirPlay password on shared networks.
  • No CPU encoder yet: the sender needs a GPU with a VA-API H.264 encoder.

Documentation

  • Mac guide: Retinet.app, permissions, the iMac's disks on a Mac, troubleshooting.
  • Command-line reference: every option of the senders and the other programs, and what to try when testing.
  • How it works: components, protocol, latency.
  • Building: building the iMac image and the sender, testing in QEMU, updating a stick in place.
  • Changelog

Credits

Retinet is built on Buildroot, the Linux kernel (amdgpu, USB/IP, ksmbd), FFmpeg, Mesa, UxPlay for AirPlay and linux-apfs-rw for the macOS disk.

License

Retinet's own code is under the MIT license. The iMac image also contains third-party software under its own licenses (GPL-2.0 for the kernel, GPL-3.0 for UxPlay, …); make legal-info in a build tree collects their sources and license texts.

iMac, Retina, AirPlay, macOS, iPhone and iPad are trademarks of Apple Inc. Retinet is an independent project, not affiliated with or endorsed by Apple.

About

Turn a Retina 5K iMac into a network monitor for your Linux desktop: GNOME extended display, AirPlay, and its speakers, camera, USB and disks lent over the network.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages