nos_
ENRU

x86-64 · arm64 · C++20 · Rust

A hypervisor that runs on bare metal

nos is installed straight onto a server and runs virtual machines on it. The network stack, storage, hypervisor and management API are all its own, so there is no other OS underneath. It's written in Rust and C++20 and runs on x86-64 and arm64. Linux and Windows Server VMs run on x86-64 hosts only, for now.

$ ./scripts/qemu-arm64.sh
…
rust_test: passed
SoftIrq: initialized
part: 0 partitions on 1 disks
MountRootFs: mounted ramfs on / (rw)
MountRootFs: mounted procfs on /proc (ro)
tcp: initialized, up to 64 connections
udpshell: started on port 9000
boot: complete

  _   _  ___  ____
 | \ | |/ _ \/ ___|
 |  \| | | | \___ \
 | |\  | |_| |___) |
 |_| \_|\___/|____/

DHCP auto on eth0...
DHCP ip: 10.0.2.15
DNS resolver started, server: 10.0.2.3
$ █
The last lines of a real arm64 boot in QEMU.

Install it on a server

nos takes a whole disk of an x86-64 server: a 10 GiB root for the system, and the rest of the disk left empty for virtual machines and storage. Pick the way your hosting provider gives you.

Rescue system

One command

Boot the server into your provider's rescue system, log in over SSH as root and run:

curl -fsSL https://nos-os.tech/install.sh | sh

A dialog asks which disk to use, how big the root should be and which SSH keys may log in. It offers the server's own network, as the rescue system has it, and the keys root logs in with there. Then it downloads the newest release, checks it against the release's checksums, makes the disk bootable under BIOS and UEFI, and puts nos first in the UEFI boot order, right after network boot. nos's SSH server takes ed25519 keys only.

The same without questions:

curl -fsSL https://nos-os.tech/install.sh | sh -s -- disk /dev/sdX --wipe --network-here --ssh-key /root/.ssh/authorized_keys

If the provider's panel still has the server booting into rescue, switch that back. Then reboot, and about a minute later ssh root@your-server gets you into nos.

ISO

The installer ISO

For servers installed from an ISO: mount it as virtual media through IPMI, iDRAC or iLO, or give its link to your provider's install-from-ISO. The same dialog runs on the server's console.

Download the ISO

nos-installer-x86_64.iso

Not sure the server suits nos? The menu entry Try nos boots nos straight from the ISO and writes nothing. The screen then shows which disks and network cards nos found.

Your computer

Try it without a server

Run nos in QEMU on a laptop in a few minutes, or watch the demo first.

Step by step, with the commands for doing it by hand and for putting nos on a spare partition next to the system already installed: Install nos on a server

Why our own kernel

Systems software written in older languages like C gets new vulnerabilities all the time, and most of them are memory bugs. To keep that out of nos as far as we can, we chose modern tools from the start.

73% of the code is Rust

Mostly Rust

Drivers, the network stack, filesystems and the hypervisor are written in Rust. In safe Rust you can't write past the end of an array, use memory after it has been freed, or cause a data race.

0.8% of Rust lines are unsafe

Little unsafe code

Code marked unsafe, which the compiler can't fully check, is needed only where nos talks to the hardware or to its C++ part. That's under one percent of the Rust, and the hypervisor's logic has just 4 such places in 22,000 lines.

fuzzers and sanitizers

Checked on every change

Fuzzers run the kernel's own code on random data, and CI boots both architectures with undefined-behaviour checks on every change. When something breaks, the kernel stops and says where, instead of hanging silently.

What's inside

Where it runs

We develop in QEMU, run in the cloud and test on real servers. Five of them we can reach only over the network.

Virtual

  • QEMU / KVMx86-64, BIOS and UEFI
  • QEMU virtarm64
  • Google CloudKVM, virtio
  • Yandex CloudKVM, virtio

Bare metal

  • Dell Latitude 5480a laptop: UEFI, screen console, USB keyboard
  • Hetzner EX44Intel, an RTL8125 NIC, VMs on VT-x
  • Hetzner AX41AMD Ryzen, an Intel I210 NIC, VMs on AMD-V
  • ASUS RS500-E6-PS4two Xeons, BIOS, SATA in IDE mode
  • Supermicro X11SSD-Fa Xeon, UEFI, SATA through AHCI, Intel I350
  • MSI PRO B760M-PRaptor Lake, an RTX A2000 given to a VM
  • Supermicro X10DRitwo sockets, two NUMA nodes, 256 GiB

Roadmap

We're building a cloud server where nos runs right on the hardware, hosts virtual machines and updates itself without stopping them.

  1. 00Done

    Bare metal

    nos boots on real servers, and they can be managed remotely.

  2. 01Ongoing

    Rust

    New code is written in Rust, with as little unsafe as possible.

  3. 02Done

    HAL and arm64

    A thin layer between the code and the CPU, and the arm64 port. Both were done before the hypervisor.

  4. 03In progress

    Hypervisor

    A Rust hypervisor for VMs on Intel VT-x and AMD-V.

  5. 04In progress

    Management

    An HTTP API and a web panel to create and delete VMs and reach their consoles.

  6. 05Planned

    Live update

    Update the server's kernel in under 100 ms without stopping its VMs.

From the blog

All posts
21 min read

A real NVIDIA card inside a nos VM

A Linux VM on nos's hypervisor now drives a real NVIDIA GPU with NVIDIA's own driver and runs CUDA at full speed. How it works, what broke on the way, and what's missing.

HypervisorHardwareDriversSafetyTestingx86-64

Learn more