Inspiration

We felt this problem ourselves while building for this hackathon. Our developers work on Macs, and QNX's release notes state that QNX SDP "isn't supported on macOS anymore" and "isn't supported on host systems that use ARM processors". Even on a supported Linux host, getting from "I wrote code" to "it ran on the target and I have the exit code" meant building an image, booting QEMU, then setting up a network and ssh or opening the IDE, every time. On November 2, 2026 we searched GitHub for a GitHub Action or a test runner for QNX 8.0 and found only setup containers. A missing inner loop is the first thing a newcomer to QNX hits, and the missing CI runner is the first thing a team hits. We wanted the experience Rust developers take for granted with cargo run.

What it does

qnxrun run hello.c 7 compiles the file with the SDP's qcc, starts a QNX 8.0 target in QEMU if one is not already up, sends the binary over the serial console, runs it with its arguments, streams stdout and stderr to the host terminal as they are produced, and exits with the program's own exit code. A program killed by a signal returns 128 plus the signal number, as a shell would.

--timeout kills the process and everything it spawned on the target and returns 124. A binary whose bytes do not match on arrival is refused with 123 and never executes. A result damaged in transit is not trusted: 125.

qnxrun test is the CI mode: a clean boot, every binary in turn, JUnit XML, the console log as an artifact, and a non-zero exit code if anything failed.

qnxrun doctor checks Docker, QEMU, the SDP volume and the license with a real qcc compile, and every failure prints the exact command that fixes it. qnxrun install performs a headless SDP install into a Docker volume with credentials taken only from the environment and masked in all output. qnxrun build runs qcc -Vgcc_ntox86_64 or make in the container with the current directory mounted. qnxrun up, down, status and shell manage a persistent target and its console; shell -c runs a target command and returns its exit code.

qnxrun is Python 3 using only the standard library, plus one C file for the target. It runs on macOS and Linux x86_64.

How we built it

The SDP runs in a Linux x86_64 Docker container on a named volume, mounted read-only. qcc takes a lock in the license directory, so qnxrun copies the license files into the throwaway container home; the SDP and the license on the volume are never written.

The target image is built once per qnxrun version with mkqnximage --type=qemu --arch=x86_64, and our agent, qnxrun-agent.c compiled with qcc, is added through a system_files.custom snippet. The image is cached per user, and every boot uses QEMU -snapshot, no network and the serial console on a Unix socket. There is no ssh and there are no keys.

The agent turns the console into a small framed protocol. Transfers are base64 lines acknowledged one at a time, so the serial input buffer cannot overflow. The file is written with mode 0600 and becomes executable only if a SHA-256 computed on QNX matches the host's. Arguments are base64 too, so no shell parses them. The child gets a QNX pty from posix_openpt for stdout, so its stdio stays line-buffered and output really streams. It also gets a pipe for stderr and its own session, so --timeout can SIGKILL the whole process group and reap it. All output travels base64-encoded inside frames tagged with a per-session nonce, so a program cannot forge a result by printing one. The final frame carries a SHA-256 over every output byte and the result, which the host recomputes before it trusts the exit code.

Challenges we ran into

Streaming was the first trap. Through a pipe, a C program's printf is fully buffered and nothing appears until it exits. We give the child a pty instead, and our end-to-end test runs a program that prints one line and never exits. The line has to reach the host while the program is still running.

A serial console is also a shared, stateful channel. A previous session may have left an agent running or a half-typed line. Each session first sends Ctrl-C, which makes a stale agent kill its child and exit, and then proves the shell is listening by echoing a fresh token. The token is quoted so the echoed command line can never match its output.

Our first license check failed because qcc needs to write a lock file and we had mounted the SDP read-only. Making the volume writable was the easy fix, but it would have let a tool touch someone's Named User license. We copy the few license files into the container instead.

Testing without an SDP was the last challenge. Our continuous integration cannot have QNX. We compile the same agent natively and run it behind a real pty in a QEMU stand-in, and a man-in-the-middle proxy damages the traffic. The protocol, hashing, timeout and signal paths under test are the production code. The real QNX suite then repeats the essential cases on the target.

Accomplishments that we're proud of

On QNX 8.0.0 x86_64 in QEMU, a program built by qcc exits 7 and the host shell receives 7. Arguments containing spaces, quotes and $(...) arrive byte for byte. A line reaches the host while the program is still running. A program that ignores SIGTERM and forks is killed by --timeout, and no process of it remains on the target. A binary corrupted in transit by a proxy is refused, never runs and leaves nothing behind.

Every check was seen failing before it passed. Three deliberate mutants were each caught; we recorded the exit codes in docs/verification.md: an exit code forced to 0, the target-side hash comparison removed, and the timeout ignored.

What we learned

A test runner is only as trustworthy as its least trusted byte. Running the program was the easy part. Most of the design went into not believing results we cannot verify: a hash checked where the code will execute, a nonce the program cannot see in its own output, and a hash over the result itself. We also learned to respect the SDP license as part of the product: the tool publishes no timing at all, and it never writes to the SDP.

What's next for qnxrun

We want to prove a GitHub Actions workflow on a self-hosted runner that already holds an SDP, then add an aarch64 target, KVM acceleration on Linux hosts, stdin and environment forwarding, and a faster transfer for large binaries. Running on real hardware over a serial cable is the natural next target, because the protocol needs nothing but a console.

Built With

  • asciinema
  • base64
  • c11
  • docker
  • github-actions
  • junit-xml
  • mkqnximage
  • posix
  • python
  • qcc
  • qemu-x86-64
  • qnx-os-8.0.0
  • qnx-sdp-8.0
  • sha-256
Share this project:

Updates

Submission history