从零开始安装Asterinas NixOS操作系统

近日,星绽(Asterinas)开源社区发布星绽 NixOS,成为业界首个搭载纯 Rust 操作系统(OS)内核的发行版。星绽 NixOS 成功整合了纯 Rust 内核(星绽)与 Linux 的成熟软件包生态(NixOS),使星绽从"内核项目"迈向"可用系统",加速 OS 行业向原生"内存安全"的转型升级。

Asterinas NixOS 是一款兼容 Linux 的开源通用 OS 内核,其技术路线是基于新兴的 Rust 语言,相比于传统 OS 内核,具备兼顾高性能和高安全的优势。Asterinas NixOS 是首个基于 Asterinas 内核构建的发行版。它以 NixOS 为基础,利用其强大的配置模型和丰富的软件包生态系统。

1. 下载

下载地址:https://github.com/asterinas/asterinas/releases/tag/v0.17.0

asterinas-nixos-0.17.0-x86_64.iso

2. qemu 启动命令

复制代码
# qemu-img creat -f qocw2 test/build/disk.qcow2 50G
# /usr/libexec/qemu-kvm \
    -cpu Icelake-Server,+x2apic -smp 1 -m 4G -nographic \
    -display vnc=0.0.0.0:42 -serial chardev:mux -monitor chardev:mux \
    -machine q35,kernel-irqchip=split -accel kvm \
    -drive file=ovmf/asterinas-nixos-0.17.0-x86_64.iso,format=raw,index=2,media=cdrom \
    -device isa-debug-exit,iobase=0xf4,iosize=0x04 \
    -chardev stdio,id=mux,mux=on,signal=off,logfile=ovmf/qemu.log \
    -netdev user,id=net01,hostfwd=tcp::15409-:22,hostfwd=tcp::41866-:8080,hostfwd=tcp::7235-:6379,hostfwd=tcp::14969-:5201,hostfwd=tcp::54665-:31234,hostfwd=tcp::5455-:31236,hostfwd=tcp::13272-:11211 \
    -device virtio-net-pci,netdev=net01,disable-legacy=on,disable-modern=off,mrg_rxbuf=off,ctrl_rx=off,ctrl_rx_extra=off,ctrl_vlan=off,ctrl_vq=off,ctrl_guest_offloads=off,ctrl_mac_addr=off,event_idx=off,queue_reset=off,guest_announce=off,indirect_desc=off \
    -device virtio-serial-pci,disable-legacy=on,disable-modern=off \
    -device virtconsole,chardev=mux \
    -device virtio-blk-pci,bus=pcie.0,addr=0x6,drive=x0,serial=vext2,disable-legacy=on,disable-modern=off,queue-size=64,num-queues=1,request-merging=off,backend_defaults=off,discard=off,write-zeroes=off,event_idx=off,indirect_desc=off,queue_reset=off \
    -drive if=none,format=qcow2,id=x0,file=./test/build/disk.qcow2 \
    -drive if=pflash,format=raw,unit=0,readonly=on,file=/home/github/asterinas/ovmf/release/OVMF_CODE.fd \
    -drive if=pflash,format=raw,unit=1,file=/home/github/asterinas/ovmf/release/OVMF_VARS.fd

3. lsblk 查看分区

复制代码
[root@nixos:~]# lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0   7:0    0  1.2G  1 loop /nix/.ro-store
sr0    11:0    1  1.3G  0 rom  /iso
vda   253:0    0   50G  0 disk 

4. 执行安装命令

使用以下命令安装:

复制代码
// 创建链接 aster_nixos_installer
[root@nixos:~]# ln -s /nix/store/c1n057w08h4sk23xrp21pchaw7l7wwld-aster_nixos_installer aster_nixos_installer

// 进入 aster_nixos_installer 目录
[root@nixos:~]# cd aster_nixos_installer

// 执行安装命令
[root@nixos:~/aster_nixos_installer]# ./bin/install_aster_nixos.sh --config  ./etc_nixos/configuration.nix --disk /dev/vda --force-format-disk

5. 安装完成后重启


参考文档:

https://cloud.tencent.com/developer/article/2567579

https://asterinas.github.io/2025/12/19/announcing-asterinas-0.17.0.html

相关推荐
doiito1 小时前
【Agent Harness】Gliding Horse L2 作战地图深度优化:给多 Agent 上下文装上“精准导航”
ai·rust·架构设计·系统设计·ai agent
花褪残红青杏小8 小时前
Rust图像处理第8节-暗角 & 复古胶片特效:四周衰减中心高亮
rust·webassembly·图形学
小宇子2B17 小时前
四、x86-64 的简化:段机制基本退场,FS/GS 为什么留下
操作系统
小宇子2B19 小时前
二、保护模式的段:选择子、GDT,与那张 64 位的段描述符
操作系统
独孤留白1 天前
从C到Rust:Rust 的 Trait 不是Interface,那是什么?
rust
花褪残红青杏小1 天前
Rust图像处理第7节-马赛克像素化:分块取平均色实现打码风格
rust·webassembly·图形学
doiito2 天前
【Agent Harness】Gliding Horse 设计细节 -- 不跟风开发自己的AI Agent
架构·rust·agent
doiito2 天前
【Agent Harness】Gliding Horse 核心设计理念,不跟风开发自己的AI Agent
ai·rust·架构设计·系统设计·ai agent
花褪残红青杏小2 天前
Rust图像处理第6节- 均值模糊 & 中值模糊:3×3 邻域的两种经典玩法
rust·webassembly·图形学
子兮曰3 天前
前端工具链的「Rust 化」:一场没有赢家的军备竞赛?
前端·后端·rust