avyos: An Experimental Linux-based OS Built Purely in Go

avyos: An Experimental Linux-based OS Built Purely in Go

Summary

avyos is an experimental, Linux-based operating system with its entire system layer, including init, services, and core tools, written purely in Go. It distinguishes itself with an immutable system core, clear separation of state for apps and user data, and service-driven capabilities. This innovative approach aims to rethink traditional OS design using modern Go principles, without external packages, CGO, or POSIX compatibility.

Repository Info

Updated on May 9, 2026
View on GitHub

Tags

Click on any tag to explore related repositories

Introduction

avyos is an innovative operating system project that leverages the Linux kernel for hardware support and booting, while completely reimagining the “system layer” in pure Go. This includes components like init, services, core tools, and the UI stack. A key design principle is the absence of external packages, CGO, or POSIX compatibility in its core, offering a truly Go-native system.

What makes avyos stand out?

  • Immutable System Core: The OS core is mounted at /avyos and treated as read-only during runtime, enhancing security and stability.
  • Clear Separation of State: Applications, configuration, user data, and runtime files reside in distinct, writable locations such as /apps, /config, /users, and /cache.
  • Service-Driven Capabilities: Instead of direct low-level system resource access, privileged operations are exposed via services and accessed through authenticated IPC.
  • Optional Linux Compatibility Layer: A standard Linux root filesystem can be provided at /linux and run in a restricted container, allowing for compatibility and reuse of existing Linux userland resources.

For a detailed system breakdown and code map, refer to the official ARCHITECTURE.md document.

Installation

You can easily try avyos in QEMU using prebuilt release images, without needing to compile from source.

Option A: One-command runner (recommended)

This convenient tool automatically downloads the correct release ZIP for your architecture and launches QEMU.

go run avyos.dev/tools/runimage@latest

Requirements: Go and QEMU must be installed on your machine.

Option B: Download a release ZIP and run QEMU manually

Release assets are published on the GitHub Releases page. Each release provides architecture-specific ZIP files, for example, avyos-<release>-amd64.zip or avyos-<release>-arm64.zip.

Each ZIP contains disk.img, firmware, and variables. Unzip the file, then navigate to that directory and run QEMU manually.

amd64

qemu-system-x86_64    \
  -smp 2 -m 2G        \
  -serial mon:stdio   \
  -nic user,model=virtio-net-pci,hostfwd=tcp:127.0.0.1:5037-:5037   \
  -vga none           \
  -device virtio-gpu-pci \
  -device virtio-keyboard-pci \
  -device virtio-mouse-pci   \
  -drive if=pflash,file=firmware,readonly=on,format=raw \
  -drive if=pflash,file=variables,format=raw \
  -drive file=disk.img,format=raw

arm64

qemu-system-aarch64   \
  -M virt -cpu cortex-a57   \
  -smp 2 -m 2G        \
  -serial mon:stdio   \
  -nic user,model=virtio-net-pci,hostfwd=tcp:127.0.0.1:5037-:5037   \
  -vga none           \
  -device virtio-gpu-pci \
  -device virtio-keyboard-pci \
  -device virtio-mouse-pci   \
  -drive if=pflash,file=firmware,readonly=on,format=raw \
  -drive if=pflash,file=variables,format=raw \
  -drive file=disk.img,format=raw

Examples

The go run avyos.dev/tools/runimage@latest command supports several flags for customization:

  • --arch <arch>: Target architecture (default: your host GOARCH, e.g., amd64, arm64)
  • --branch <name>: Release tag/branch to download (default: main)
  • --cpu <n>: CPU cores for QEMU (default: 2)
  • --memory <size>: RAM for QEMU (default: 2G)
  • --vnc <display>: Start VNC server (example :0)
  • --dbg-port <port>: Forward host:port to guest:5037 (default: 5037, 0 disables)

Any additional arguments after the flags are passed directly to QEMU.

Here are some examples:

# Run with VNC on :0
go run avyos.dev/tools/runimage@latest --vnc :0

# Use 4 cores and 4G RAM
go run avyos.dev/tools/runimage@latest --cpu 4 --memory 4G

# Disable dbgd port forwarding
go run avyos.dev/tools/runimage@latest --dbg-port 0

Why Use avyos?

avyos offers a fresh perspective on operating system design, providing several compelling reasons to explore it:

  • Modern Language Foundation: By building the system core purely in Go, avyos benefits from Go's performance, concurrency features, and strong type safety, potentially leading to a more robust and maintainable system.
  • Enhanced Security and Stability: The immutable system core and clear separation of concerns reduce the attack surface and prevent unintended modifications to critical system components.
  • Simplified Development: For Go developers, avyos provides a familiar environment for system-level programming, potentially lowering the barrier to entry for OS development.
  • Innovative Architecture: Its service-driven approach and optional Linux compatibility layer offer flexibility and a forward-thinking design for future operating systems.
  • Experimental and Educational: As an experimental project, avyos serves as an excellent platform for learning about modern OS design principles and the practical application of Go in system programming.

Links