HTTP-controlled NBD-export multiplexer for a small lab (boot Linux images over the network with overlayfs+tmpfs writes)
Project description
nbdmux
HTTP-controlled NBD-export multiplexer for a small lab. Register local
disk-image files as named NBD exports over an HTTP control plane; nbdmux
keeps an nbd-server subprocess alive that serves all registered
exports on a single TCP port. Targets nbd-client against that port
from an initramfs and boot the image with overlayfs over tmpfs for
writes (see bty's ramboot boot mode for the canonical consumer).
Designed as a peer to withcache: small lab, single sidecar container, no third-party Python deps. Operationally:
[ bty-web ] --HTTP--> [ nbdmux ] --supervises--> [ nbd-server ]
| |
| TCP 10809
| |
v v
SQLite state [ target's
(exports table) nbd-client ]
Components
| Path | What it is |
|---|---|
src/nbdmux/server.py |
The daemon. HTTP control plane + nbd-server subprocess management + operator UI |
src/nbdmux/client.py |
Stdlib-only Python client library for other tools |
deploy/Containerfile |
Single-image deploy (Python + nbd-server) |
deploy/compose.yml |
Reference compose stack |
System dependency
nbdmux runs nbd-server (from the classical nbd project) as a
subprocess. Install at the OS level:
# Debian / Ubuntu
sudo apt install nbd-server
# Fedora
sudo dnf install nbd
The container deploy bundles it. Also make sure the nbd kernel
module + nbd-client are available on the consuming Linux box (the
target you're booting); they're in the same nbd package.
Install
pipx install nbdmux # or: uv tool install nbdmux
Run the daemon (development; the container deploy is the recommended production path):
nbdmux-server --data-dir ./data --port 4040 --nbd-port 10809
Register an image:
curl -X POST http://localhost:4040/exports \
-H 'Content-Type: application/json' \
-d '{"name": "debian-sysdev", "file": "/path/to/debian-sysdev.img", "readonly": true}'
Then on a target Linux box:
modprobe nbd
nbd-client <nbdmux-host> 10809 -name debian-sysdev /dev/nbd0
fdisk -l /dev/nbd0 # the .img's partition table
HTTP control plane
| Method | Path | Body | Returns |
|---|---|---|---|
| GET | /exports |
- | array of exports |
| POST | /exports |
{name, file, readonly?: bool} |
the new export |
| DELETE | /exports/{name} |
- | 204 |
| GET | /healthz |
- | ok |
| GET | / |
- | operator dashboard |
Auth
Single-tenant, server-signed cookie -- same pattern as withcache. Set
NBDMUX_ADMIN_PASSWORD to gate the operator UI + the HTTP control
plane. Unset = open with a startup warning.
The NBD port itself is unauthenticated (nbd-server's classical model); LAN-only assumption, firewall is the operator's responsibility.
License
BSD-3-Clause.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbdmux-0.2.0.tar.gz.
File metadata
- Download URL: nbdmux-0.2.0.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f241f8293588a49577e30a3b52833334671b6524be0c9b41e46be754299c158
|
|
| MD5 |
e60f6eb86a8758aca23b7aa3b23e217c
|
|
| BLAKE2b-256 |
1e18cb3cef0e4f3c85997ca7d4d6f7908c03f18e9235988de8990382816ac779
|
Provenance
The following attestation bundles were made for nbdmux-0.2.0.tar.gz:
Publisher:
ci-cd.yml on safl/nbdmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbdmux-0.2.0.tar.gz -
Subject digest:
5f241f8293588a49577e30a3b52833334671b6524be0c9b41e46be754299c158 - Sigstore transparency entry: 2021941957
- Sigstore integration time:
-
Permalink:
safl/nbdmux@ea90fe05e32bc9b7ed15cf240c67eebb8e2ec264 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/safl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@ea90fe05e32bc9b7ed15cf240c67eebb8e2ec264 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nbdmux-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nbdmux-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
280132dbd161673d51468b02564147fd102ebcf3c6f4fe9dc16047ee56b74300
|
|
| MD5 |
10d442463c35ecb4f97ba28ccee96a11
|
|
| BLAKE2b-256 |
fbda4d094fc1d15f2fc2565990fb387aeccbf543987748fdcdd3b2aba9cb47b7
|
Provenance
The following attestation bundles were made for nbdmux-0.2.0-py3-none-any.whl:
Publisher:
ci-cd.yml on safl/nbdmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbdmux-0.2.0-py3-none-any.whl -
Subject digest:
280132dbd161673d51468b02564147fd102ebcf3c6f4fe9dc16047ee56b74300 - Sigstore transparency entry: 2021942195
- Sigstore integration time:
-
Permalink:
safl/nbdmux@ea90fe05e32bc9b7ed15cf240c67eebb8e2ec264 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/safl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@ea90fe05e32bc9b7ed15cf240c67eebb8e2ec264 -
Trigger Event:
push
-
Statement type: