nexboot README

项目的 README,来自 github.com/waterlemon0108/nexboot。合并为一个 markdown 文件:README.md。

NexBoot: diskless boot server for Windows and Linux

Boot a whole internet cafe, LAN center or computer lab from one master image. PXE + iSCSI + ZFS in a single Go binary, with a web console and an optional HA cluster.

English · 简体中文

Star

License Go Platform CI

NexBoot demo: from the web console to a client booting into Windows

Online demo

Open the demo · Username: demo · Password: demo

Explore menus, searches and detail views with simulated business data. Buttons for modifying data remain visible, but their actions are disabled. The demo runs independently of the real storage and diskless boot services.

Login logs contain real visitor IP addresses, login times and client information, and are visible to all demo visitors. Do not enter personal or production passwords.

Why NexBoot

Keeping 50 or 500 PCs on the same Windows build is a chore. Every game patch, driver update or bad install means walking from seat to seat.

With NexBoot the PCs have no system disk of their own. They boot over the network, and each one gets its own writable copy of a master image. You update the image once. Every PC picks it up on the next reboot, and a reboot always brings a PC back to a clean state.

Without NexBoot With NexBoot
Patch every PC by hand Patch one image, reboot the room
A broken PC needs a reinstall A reboot restores it
Disks fail, PCs go down No local system disk to fail
No easy way back after a bad update Apply an earlier restore point in one click

Quick start

On an Ubuntu 22.04 / 24.04 server with a spare disk for the ZFS pool:

sudo apt install ./ndiskless_<version>_amd64.deb
sudo ndiskless-configure --bootstrap-password '<admin password>'

Then open http://<server-ip>:8080, sign in as admin and follow the setup wizard:

  1. Pick the network card that faces the clients.
  2. Create a storage pool on the spare disk.
  3. Import a Windows or Ubuntu image (.vmdk, .vhdx, .qcow2, .raw or an exported .zfs stream).
  4. Create a group (IP range + image) and register the clients by MAC address.
  5. Set the clients to boot from the network. Done.

No internet at the site? Use the offline bundle: sudo ./install.sh from nexboot-offline-ubuntu24.04-amd64.tar.gz. See Install for all options.

How it works

 client PC                 NexBoot server (one Go binary)
 ─────────                 ──────────────────────────────────────────────
 PXE ROM ──DHCP/TFTP────▶  dnsmasq (managed)  ──▶ iPXE
 iPXE ────HTTP /boot────▶  boot script for this MAC (which image, which disk)
 iPXE ────iSCSI─────────▶  LIO target ──▶ ZFS clone of the restore point
 Windows / Linux boots     ▲
 from the network disk     └─ image ─▶ config ─▶ restore point ─▶ per-PC clone

Features

Area What you get
Delivery One static binary with the web UI built in; .deb package and an offline bundle for sites without internet
Client OS Windows (BIOS and UEFI) and Ubuntu, including Ubuntu Server's default LVM layout
Image import .vmdk / .vhd(x) / .qcow2 / .raw / .zfs streams; Windows and Linux images are adapted for iSCSI boot automatically
Image management Configs, restore points, one-click apply, save as new image, export, overwrite base image, health check
Groups and clients Fixed IP per MAC via DHCP, data disks per group, client status matrix, cross-subnet groups via DHCP relay
Hardware models Discovers the NIC. When the image has no configuration for a Windows NIC, the server writes that PC's boot configuration from the image's already-installed NIC and a matching driver (built into the image, or an uploaded x64 pack), so there is no per-model adaptation step. The models page shows each model's actual boot result (OK, boot failed, waiting for first boot) and offers a full WinPE adaptation only after a failed boot
Storage ZFS pools with mirrors, cache and spare disks, managed from the UI; scheduled backups to a second pool
High availability keepalived VIP, catalogue replication with resume, epoch fencing, planned switchover; grow from one node to a cluster online
Operations Alarms (nodes, pools, replication, boot failures, image health), audit log, task center

Screenshots

Overview
Overview: nodes, clients, groups and storage at a glance
Images
Images: system disks, data disks, and create from ISO
Restore points
Restore points: apply, save as image, export
Groups
Groups: IP range, system disk and data disks
Clients
Client matrix
Storage pools
Storage pools per node
Create cluster
Create a cluster with just a VIP
Add node
Add nodes found on the network
Windows client
Windows 11 client booted over the network
Ubuntu client
Ubuntu 24.04 client booted over the network
Hardware models
Hardware models: OK, boot failed, or waiting for first boot
Driver packs
Driver packs: signed x64 NIC drivers, enabled or disabled

More screenshots are in the Chinese README.

Requirements

Each server

Item Requirement
OS Ubuntu 22.04 / 24.04 (other systemd + ZFS distributions should work)
Disks At least one disk besides the system disk, for the ZFS pool
Memory 8 GB minimum, 32 GB or more recommended (enough ZFS ARC for your hot images)
Network Same layer-2 segment as the clients; cluster nodes share it too (VRRP runs there)
IP address Every server needs a static IP, not DHCP
Packages dnsmasq, dnsmasq-utils, qemu-utils, targetcli-fb, zfsutils-linux, keepalived, curl, libhivex-bin, libwin-hivex-perl (pulled in by the .deb, bundled in the offline package)

Network

Client images

Create an image from an ISO: the ISO wizard supports Windows 10/11 and Server 2016+, Ubuntu 24.04, and Anaconda-based CentOS / RHEL / Rocky Linux / AlmaLinux 7/8/9 full DVDs (x86_64, UEFI). Linux installation uses packages on the ISO and exposes the ISO as a read-only iSCSI installation medium; boot/netinstall media missing required offline packages are rejected with a specific reason. RHEL-family installs use Kickstart and dracut/iBFT, with separate preparation and Anaconda logs. The CentOS 7 DVD is covered by media checks and automated regression tests; actual installation, reboot, and another client's diskless boot still require hardware acceptance. This does not add automatic adaptation of arbitrary imported RHEL disk images. See ISO acceptance steps.

OS Status Before you capture the image
Windows Supported Set the network card to obtain an IP automatically. Windows 11 24H2 / 25H2 builds 26100.7705 / 26200.7705 or later are recommended (KB5074105 fixes a possible iSCSI boot failure). Earlier or unknown revisions show an advisory and can still be installed; compatibility requires an actual diskless boot test
Ubuntu Supported sudo apt install open-iscsi. Plain partitions and linear LVM volumes both work
CentOS / RHEL / Rocky / AlmaLinux Full-DVD ISO installation implemented; hardware acceptance pending Automatic adaptation of imported disk images is not extended; see the Chinese README for manual dracut setup

Don't set a static IP inside the image. Every PC boots the same image, so a fixed address would be claimed by all of them at once. NexBoot gives each MAC its own address over DHCP. Ubuntu images are switched to DHCP automatically on import.

Turn off automatic updates, automatic restarts, sleep and hibernation in Windows images. Every boot starts from a clean copy, so each PC downloads the same updates again, restarts on its own and can end up powered off halfway through, because the iSCSI system disk is already disconnected during the restart. Install updates on a super machine and save them as a restore point instead.

Install

Every server runs the same install and starts as a standalone node. Whether it joins a cluster is decided later in the web UI.

# .deb package (recommended)
sudo apt install ./ndiskless_<version>_amd64.deb
sudo ndiskless-configure --bootstrap-password '<admin password>'

# offline bundle, for sites without internet
mkdir nexboot && tar -xzf nexboot-offline-ubuntu24.04-amd64.tar.gz -C nexboot && cd nexboot
sudo ./install.sh
sudo ndiskless-configure --bootstrap-password '<admin password>'

# from source (see Development for build prerequisites)
make build-static
sudo bash scripts/install-go.sh --install-deps --binary ./bin/ndiskless-linux-amd64 \
  --bootstrap-password '<admin password>'

Check it is up:

systemctl is-active ndiskless            # active
curl -s http://127.0.0.1:8080/healthz    # {"status":"ok"}

Upgrading a .deb does not restart the service. Run sudo systemctl restart ndiskless; in a cluster, upgrade the standbys first and the active node last.

High availability

Single node Two nodes Three or more
Who accepts changes This node Active node Active node
Who serves client disks This node Both, balanced (or pinned per group) All nodes, balanced (or pinned per group)
One node fails All clients down Only its clients reboot once Only its clients reboot once

Failover is automatic and takes seconds to minutes, not zero. Clients running on a failed node blue-screen and reboot once, then come back on another node. The VIP moves in about a second.

To build a cluster:

  1. On the first node: System → Parameters → High availability → Create cluster, and enter a free VIP.
  2. Servers → Cluster nodes → Add node. NexBoot scans the client network for installed but unconfigured servers.
  3. Create a storage pool on every node.
  4. Wait for the first replication to finish (shown under High availability).

A single node that already has images and clients can be turned into a cluster in place. Nothing is reinstalled or migrated.

Project structure

cmd/ndiskless/   entry point, wiring, HA role selection
internal/
  api/           HTTP routes, auth, /boot
  boot/          iPXE scripts and embedded TFTP assets
  control/       images, configs, restore points, groups, clients, drivers, alarms, backup, cluster ops
  dhcp/          dnsmasq config generation
  ha/            role state machine, epoch fencing, replication endpoints
  storage/       ZFS, iSCSI (LIO), image import and adaptation
  store/         SQLite repositories and goose migrations
web/             React web console, embedded into the binary
deploy/          systemd unit, keepalived template, health scripts
packaging/       .deb and offline bundle builders
tools/e2e/       end-to-end test matrices run against real servers
docs/images/     screenshots, demo GIF and project artwork

Development

Use the Go version specified in go.mod and Node.js 22 (at least 22.22.2) or 24 (at least 24.15.0), with npm. Build and verification targets install frontend dependencies with npm ci, build web/dist and embed it before compiling Go. Generated files are not committed.

make dev          # dev binary at bin/ndiskless-dev
make verify       # gofmt, vet, go test, static build
make verify-web   # vitest, vite build
make verify-all   # all checks; shares the frontend build
make deb          # .deb package (on Linux)
make offline      # offline bundle (on the target Ubuntu version)

End-to-end matrices need real ZFS, LIO and keepalived, so they are not part of CI. See tools/e2e/README.md.

Contributing

Issues and pull requests are welcome. Read CONTRIBUTING.md first.

License

AGPL-3.0. You can use, study and modify NexBoot for free, including running it in your own internet cafe or school. If you distribute a modified version, or offer a modified version to others over a network, you must publish its full source under the AGPL.

The NexBoot name and logo are not covered by the license. Bundled third-party components (iPXE, wimboot) keep their own licenses; see THIRD_PARTY_NOTICES.md.


Built by waterlemon0108. If NexBoot saves you a walk around the room, a star helps others find it.

Star

nexboot (waterlemon0108/nexboot)

正在搜索数据库…

这是什么?NexBoot 是一个用 Go 编写的自托管无盘启动平台,结合了 PXE 网络启动、iSCSI 和 ZFS 存储,让整个网吧、局域网机房或电脑教室的众多电脑都能从同一个母版镜像启动,并通过网页控制台统一管理。
这是要装在中央服务器上,还是每台电脑都要单独安装?这是一个服务端平台:你只需在 Linux 服务器上安装一个 Go 二进制程序,客户端电脑完全通过网络启动,无需在本地安装操作系统,每次启动时都会获得一个母版镜像的可写 ZFS 克隆。
我该怎么把它跑起来?在配有备用磁盘(用于 ZFS 存储池)的 Ubuntu 22.04/24.04 服务器上安装,然后打开网页控制台,以 admin 身份登录并运行设置向导:选择面向客户端的网卡,创建存储池,导入 Windows/Ubuntu 镜像(.vmdk/.vhdx/.qcow2/.raw/.zfs),创建分组,并通过 MAC 地址注册客户端。
开始之前,服务器需要什么?一台独立的 Linux(Ubuntu)服务器,配置静态 IP,除系统盘外至少还要有一块备用磁盘用于 ZFS 存储池,8GB 及以上内存,并需要 dnsmasq、qemu-utils、targetcli-fb、zfsutils-linux 和 keepalived 这些软件包,它们已打包在 .deb 安装包和离线安装包中。
它支持任何客户端操作系统吗?官方仅支持 Windows(BIOS 和 UEFI 均可,其中 Windows 11 24H2/25H2 需要 build 26100.7705+ 版本,以修复已知的 iSCSI 启动问题)和 Ubuntu;CentOS/RHEL/Rocky 未经测试。客户端镜像还必须使用 DHCP,因为如果在镜像中固化静态 IP,所有电脑会同时占用该地址。
我需要一组服务器集群,还是一台服务器就够用?单个节点即可独立运行全部功能;之后你可以直接在界面中把它扩展为多节点集群,无需重装。故障转移时虚拟 IP 会在约一秒内迁移,受影响的客户端只需重启一次,即可连接到另一个节点。
AGPL 许可证有什么要注意的?可以免费使用、研究和修改,包括在你自己的网吧或学校里用于商业用途;但如果你分发修改后的版本,或将其作为网络服务提供给他人使用,就必须以 AGPL 协议公开修改后的完整源代码。NexBoot 名称和标志,以及捆绑的第三方组件,则遵循各自的条款。
电脑出故障后,如何不重装就修复?每台电脑都从某个还原点的写时复制 ZFS 克隆启动,因此普通重启会清除所有本地更改,让机器恢复到干净的已保存状态;你也可以一键回滚到更早的还原点。
NexBoot 能在无法访问互联网的场所部署吗?可以,提供了离线包(例如 nexboot-offline-ubuntu24.04-amd64.tar.gz),其中打包了所有必需的依赖,因此可以在无需联网的情况下运行 sudo ./install.sh。
“超级机器”功能是什么?它允许你以可编辑模式启动一台客户端,在其中安装更新或驱动程序,然后关机,并将结果保存为一个新的还原点,供该配置下的其他电脑应用。
客户端流量会经过中央服务器代理吗?不会,每台电脑的 DHCP、启动文件和 iSCSI 流量都由承载它的节点直接提供;即使以集群方式运行,流量也不会经过任何中央控制器转发。
有哪些类似的项目?ceph, thanos, netboot.xyz, consul, automq, node_exporter, nezha, nodelume
大小
6.8 MB
星标
110
时长
1个月
提交 · 90 天