Turn Your Linux Machine into a Second Display for Your Mac Using UxPlay AirPlay Client

Madhawa Monarawila
3 min readOct 25, 2023

--

Hey there! If you’ve ever used AirPlay on your Mac to stream content to other Apple devices, you might have wondered if there’s a way to extend that functionality to your Linux box. Well, good news! There’s a fantastic tool called “UxPlay,” which is an AirPlay client designed specifically for Linux. In this blog post, I’ll guide you through the process of using UxPlay to turn your Linux box into a second display for your Mac.

Prerequisites

  • A Mac device running macOS 10.8 or later.
  • A Linux box with a graphical desktop environment installed.
  • Both your Mac and Linux boxes should be connected to the same local network.

Step 1: Installing Dependencies

Before we can get started with UxPlay, we need to make sure our Linux system has the necessary dependencies. Don’t worry, it’s not as complicated as it sounds. Open a terminal on your Linux box and enter the following commands based on your distribution:

For Debian/Ubuntu-based distributions:

sudo apt update
sudo apt install build-essential cmake libavahi-client-dev libcairo2-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xfixes0-dev libssl-dev libplist-dev libavahi-compat-libdnssd-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

For Fedora/RHEL-based distributions:

sudo dnf install gcc-c++ cmake avahi-compat-libdns_sd-devel cairo-devel libxcb-devel openssl-devel libplist-devel gstreamer1-devel gstreamer1-plugins-base-devel

Step 2: Getting UxPlay

We’ll need to grab the UxPlay source code from GitHub. In your terminal, enter the following commands:

git clone git@github.com:antimof/UxPlay.git
cd UxPlay

Step 3: Building and Installing UxPlay

Once we have the source code, it’s time to build and install UxPlay. Run these commands in the terminal:

mkdir build
cd build
cmake ..
make
sudo make install

Step 4: Setting Up AirPlay on Your Mac

Alright, now it’s time to configure AirPlay on your Mac. On your Mac device, find the AirPlay icon in the menu bar. It looks like a rectangle with a triangle at the bottom. Click on it, and from the dropdown menu, select “UxPlay” as the destination for your AirPlay content.

Step 5: Connecting Mac to Linux

With AirPlay enabled on your Mac, you should now see your Linux box listed as an available destination. Select your Linux box from the AirPlay menu on your Mac, and voilà! Your Mac’s screen should now be mirrored/ extended on your Linux desktop.

Changing Resolution (Optional)

By default, UxPlay uses a resolution of 1080p, which might not match the native resolution of your Linux box’s display. But don’t worry! You can easily change the resolution using the `-s` flag when launching UxPlay.

For example, if you want a resolution of 1366x768, use the following command:

uxplay -s 1366x768

Full-Screen Mode (My Experience)

Now, here’s a cool feature! In my experience, I found that UxPlay, when installed from the source, supports full-screen mode. Unlike the version you might get from `apt`, which lacks this feature, you can enter full-screen mode by simply pressing the `F11` key on your keyboard. It’ll expand the UxPlay window to fill your entire screen, giving you a more immersive viewing experience.

Disconnecting AirPlay

When you’re done with AirPlay, it’s easy to disconnect your Mac from the Linux box. Just click on the AirPlay icon on your Mac and select “Turn Off AirPlay.”

Conclusion

There you have it! With UxPlay, you can seamlessly use your Linux box as a second display for your Mac. It’s a fantastic tool for screen mirroring and streaming content between devices. I’ve personally tested it on Debian and Ubuntu (versions 23.04 and 22.04), and it works like a charm. So, if you’ve ever wanted to extend your Mac’s screen to your Linux setup, UxPlay is the way to go.

With that, it’s time to exit this digital rabbit hole. Thank you for reading. Until our paths cross in the outer reaches of cyberspace, keep your spacesuit on and stay curious!

--

--

Madhawa Monarawila

Software Engineer | Third year undergraduate at ITUM Sri Lanka.