Building a Remote Testing Device Farm Out of Two Spare Laptops

Anyone who has run an Android emulator, a UI test suite and a browser full of tabs on one laptop knows how that ends. A spinning beach ball, flaky tests and a fan that sounds like a jet engine. So I turned two spare laptops lying around into a small device farm. I can reach it anywhere in the world using my MacBook. And yes, it prints too!

The Impetus

My main MacBook was doing way too much. Android emulator, Maestro test runs, Playwright, an IDE, Chrome and an AI coding agent, all fighting for the same RAM. Long test runs made everything crawl, and tests started failing on timeouts that had nothing to do with the app. Mind you, a test that fails because of your machine is worse than no test at all.

Meanwhile, two machines were just sitting there: a Windows 11 laptop (Intel i5, 8 GB RAM) and a 2017 MacBook Pro (Intel i5, 8 GB RAM). Not exactly powerhouses, but good enough to take the heavy lifting off my main machine.

Then there was the printer. My old HP DeskJet is USB-only, and my MacBook simply would not detect it through any of the USB-C dongles I tried. Plug it into the Windows laptop, and it works right away. So the printer became part of the same project.

The Setup

Here is how the work is split now:

  • Windows laptop: hosts the Android emulator for Maestro UI tests, and the USB printer.
  • 2017 MacBook Pro: runs Playwright web tests.
  • My MacBook: only orchestrates. It ships the test code over, kicks off the runs, pulls back the reports, and prints.

All three machines sit on one private Tailscale network. So it works the same whether I am at home, in the office or on a phone hotspot.

Hurdles Along the Way

Reaching the machines from anywhere

I did not want to open ports on my router or expose SSH to the internet. Please don’t. Instead, Tailscale puts all the machines on one private network, and setting it up was a cake walk. On Windows it runs as a service in unattended mode, so it stays connected even when nobody is logged in. SSH on both hosts is key-only, with password login disabled.

Running tests without the lag

The obvious approach was to forward adb from the remote emulator and run Maestro on my MacBook. Turns out that is a bad idea. Every tap and every assertion would cross the network, and network lag would show up as false failures.

So we flipped it. Maestro runs on the host, right next to the emulator. My MacBook copies the working tree over, starts the run detached on the host and keeps polling for progress. If my connection drops midway, the run carries on, and I can reattach later to fetch the reports. A simple lock file makes sure two runs never fight over the same emulator (or the same test data).

Fitting an emulator into 8 GB

Out of the box, the emulator was close to unusable on these machines. A few tweaks made all the difference:

  1. On Windows, enable Windows Hypervisor Platform so the emulator gets hardware acceleration.
  2. On the older Mac, force 4 virtual CPUs. The emulator quietly drops to 1 on hosts with fewer than 6 cores.
  3. Disable the Google apps inside the emulator that keep burning CPU while idle.
  4. Turn off animations, and boot from a saved snapshot (about 20 seconds).

On the 2017 MacBook Pro, idle emulator CPU dropped from about 250% to under 12%. On the Windows laptop, a full user flow took just 4.5% longer than on my main machine. Not bad at all for a budget laptop!

Windows over SSH

Windows has its own set of surprises when you drive it over SSH. A few that cost me real time:

  • Processes started in an SSH session die when it closes. Long jobs are launched through WMI so they outlive the session.
  • Binary data piped through SSH gets corrupted. Files move with scp instead.
  • GUI apps never show up over SSH. Installers need a real screen.
  • A sleeping laptop looks like a dead one: the connection opens, then SSH times out. Sleep is now switched off.
  • Quoting a command through the Mac shell, SSH and PowerShell breaks silently. Anything more than a one-liner goes into a script file.

The printer that wouldn’t show up

This was the most stubborn part. Plain Windows printer sharing does not work for this model. The Windows driver only accepts documents rendered on Windows itself, and it rejected every job my MacBook sent. HP has no macOS driver for it either, since on Macs it relies on AirPrint, which a USB printer behind a Windows PC cannot offer.

So we wrote a tiny print server: a single Python file on the Windows laptop. It speaks IPP, the same protocol Macs and iPhones use to talk to network printers. It takes the PDF the Mac sends and prints it using the free SumatraPDF reader and the Windows driver that already worked. On my MacBook, it shows up as a regular printer in every app.

It also announces itself on the home Wi-Fi as an AirPrint printer, and understands Apple’s raster image format. So now even my iPhone can print to it. And yes, it starts on its own after a reboot!

Security Considerations

Turning spare laptops into always-on servers does change the risk. Here is what is in place, and what still needs tightening:

  • Everything stays behind Tailscale with zero public ports exposed, and both hosts enforce key-only SSH (verified by fingerprint, password login disabled).
  • Firewall rules restrict the new ports strictly to private networks.
  • Since the orchestrator copies the full working tree, including local .env files with test credentials., disk encryption is turned on and there are no shared accounts on either host.
  • Where it is still loose: Tailscale key expiry is disabled so the hosts don’t drop off unattended, and the Python print server currently runs with admin rights without print auth. That’s fine on my home Wi-Fi, though moving the print server to a low-privilege account and tightening Tailscale ACLs are next on my list.

Limitations

Not everything is rosy, mind you:

  • 8 GB RAM is the hard ceiling. Once the emulator boots on Windows, paging kicks in and assertions slow down, so each host strictly runs one emulator and nothing else. The 2017 MacBook Pro chokes on our app’s heavier screens in the emulator, so it’s relegated to web tests only.
  • Reboot friction. On the 2017 Mac, Tailscale doesn’t connect until a user logs in at the keyboard. A Windows Update restart or a Wi-Fi blip also takes a host out of rotation until it recovers.
  • AirPrint is local-only. My MacBook can print over Tailscale from anywhere, but iPhone discovery doesn’t cross the tailnet, so phone printing only works on home Wi-Fi. The server also marks a job done the moment Windows queues it, no paper-jam or low-ink feedback is present right now.

What’s Next

A few things on the roadmap:

  1. Bump the Windows laptop to 16 GB RAM: the single biggest bottleneck right now.
  2. Lock down permissions: Add Tailscale ACLs to restrict port access per machine, move the print server to a low-privilege account, and add TLS + basic auth.
  3. Add health checks and Wake-on-LAN so I get pinged if a host drops offline and can wake it remotely.
  4. Expand capacity: Spin up a second emulator once the RAM is upgraded, or hook up physical Android phones over wireless adb.
  5. Expose the scanner on the DeskJet through the same Python service, plus a lightweight status page showing which host is free and what’s currently running.

Conclusion

None of this needed new hardware. Two old laptops, Tailscale, SSH and a few hundred lines of scripts turned into a small device farm that I can use from anywhere, and my MacBook finally has room to breathe. The biggest lesson? Run the work where the device is, and send only the results across the network.

In further posts, we will dig deeper into similar blockades being removed. Stay tuned. Adios!


For more, head over to our blogs section.

Share your love
Punit Goswami
Punit Goswami
Articles: 10

Leave a Reply

Your email address will not be published. Required fields are marked *