Skip to main content

unkernel-rs for Python

Embeddable Linux 7.x micro-VM sandbox running inside WebAssembly (wasmtime) — zero Docker, zero KVM, zero root, zero Node.js.

Powered by unkernel-rs and pithings/unkernel.

Install

pip install unkernel-rs

On first boot, unkernel-rs downloads and SHA-256-verifies the pinned unkernel.wasm + alpine.erofs (~26 MB) into your local cache and AOT-compiles a .cwasm image for ~1s warm boots.

Quickstart

1. Disposable Air-Gapped Linux VM

import unkernel_rs

with unkernel_rs.Vm() as vm:
    res = vm.exec(["uname", "-a"])
    print(res.stdout_text)
    print(vm.active_processes())  # Level-3 SharedMemory VMI

2. Port Forwarding & SSH Into Your Wasm Linux VM

Forward any host TCP port into the guest with port_forwards=["127.0.0.1:2222:22"] — preview web servers (http://localhost:8000) or SSH straight into the Wasm Linux VM with real OpenSSH:

import unkernel_rs

with unkernel_rs.Vm(net=True, port_forwards=["127.0.0.1:2222:22"]) as vm:
    vm.shell("apk add --no-cache dropbear && mkdir -p /etc/dropbear && dropbear -R -p 22", user="root")
    input("SSH ready on 127.0.0.1:2222 — press Enter to stop...")

See examples/ssh_into_vm.py for a complete runnable script with automatic ED25519 key setup (~345 ms SSH round-trip, ~33 ms HTTP round-trip).

3. Copy-on-Write Workspace & Counterfactual Branching

import unkernel_rs

with unkernel_rs.Vm(mounts=["./repo:/work:cow"]) as vm:
    vm.shell("echo base > /work/state.txt")
    snap = vm.snapshot()

    with snap.branch() as branch_a, snap.branch() as branch_b:
        branch_a.shell("echo fix_a >> /work/state.txt")
        branch_b.shell("echo fix_b >> /work/state.txt")

        print(branch_a.workspace_diff("/work"))
        branch_a.commit_workspace("/work")  # commit winner, discard loser

4. Zero-MITM Level-3 VMI TLS Inspection & Audit Stream

import unkernel_rs

events = []
with unkernel_rs.Vm(
    net=True,
    allow_hosts=["example.com"],
    vmi_tls=True,
    on_audit=events.append,
) as vm:
    res = vm.shell("wget -qO- https://example.com | head -n 1")
    print(res.stdout_text)

for ev in events:
    if ev["event"] == "net.tls_decrypted":
        print(ev["direction"], ev.get("http_summary"), ev["proc"])

5. Freeze-on-Ask Policy Callback

import unkernel_rs

def approve(req: dict) -> str:
    # Entire guest kernel + monotonic clock are frozen while this runs!
    return "allow_once" if "example.com" in req["target"] else "deny_once"

with unkernel_rs.Vm(
    net=True,
    allow_hosts=["example.com"],
    ask_net=True,
    freeze_on_ask=True,
    on_approval=approve,
) as vm:
    res = vm.shell("wget -qO- https://example.com | head -n 1")

License

Dual-licensed under MIT OR Apache-2.0. Upstream unkernel Linux kernel images (GPL-2.0-only) are fetched at runtime and never bundled in this wheel.

Metadata

Release files for unkernel-rs 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for unkernel-rs 0.6.0
File Actions
unkernel_rs-0.6.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for unkernel_rs-0.6.0-cp39-abi3-win_amd64.whl
unkernel_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for unkernel_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
unkernel_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for unkernel_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
unkernel_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for unkernel_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 22.0 MB

Release files / unkernel_rs-0.6.0-cp39-abi3-win_amd64.whl

Download URL unkernel_rs-0.6.0-cp39-abi3-win_amd64.whl
Size 5.9 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
dbd11cede6a319b5ded6ff7159dd71bbd59dc87e3ea5d1add5fde7e2d0f55062
BLAKE2b-256 checksum
How to use checksums
47158f1d19e4c5fc142b9306db1bf0bdcfa3ca2a936f990a214cae7cff15c605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / unkernel_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL unkernel_rs-0.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 6.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bd11afadb8f6661f28b46535df2cb9eb982bcb3f4c929a1dec97db4ebcc520aa
BLAKE2b-256 checksum
How to use checksums
5c99fb0cdc9657cfed482a47852bff7e9e416fa7e52830e40fa5229c349ff105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / unkernel_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL unkernel_rs-0.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.2 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
948fdcc607047d4eeae9b9b55f1707d9d6ca5626b091f0597065d374a60bd39b
BLAKE2b-256 checksum
How to use checksums
cbe711a724484d80417c0913848f3e13f5d4ffa3d80384f0e33e2c180834d433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / unkernel_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL unkernel_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
Size 5.0 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f666cb9595a0ce8b7e48a61a7dba03d3dba86593804e3e5c568d80d41390e09f
BLAKE2b-256 checksum
How to use checksums
88d2f6c5e490b38a23c798dc41aae0a99aa7f87197877cc957997eb437530a5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for unkernel-rs 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for unkernel_rs-0.6.0-cp39-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page