KRAFT-RUN(1)
π kraft-run β run a unikernel, bestie
okay so real talk, this page lives in the KraftKit CLI manual (that's the manual-name flex, section 1 energy), and it's about one single command: kraft-run. buckle up π
β¨ NAME β¨
kraft-run β run a unikernel π¦
πΈ SYNOPSIS πΈ
kraft run [FLAGS] PROJECT|PACKAGE|BINARY -- [APP ARGS]
literally the whole vibe in one line, no cap π
π DESCRIPTION π
Run a unikernel virtual machine. that's it, that's the tea π«β¨
π OPTIONS π
okay this is the long part, but every single flag is here, i promise, i would never do you like that π
-m,--arch=""β set the architecture, bestie. which CPU family are we blessing today π§--as=""β force a specific runner. like, you're not asking, you're telling π-d,--detach[=false]β run the unikernel in the background, main character energy, it doesn't need you watching π-W,--disable-acceleration[=false]β disable acceleration of CPU (usually enables TCG). lowkey slower but sometimes you gotta π’-e,--env=[]β set environment variables, in the formatkey[=value]. so likekeyalone works,key=valuealso works, we're flexible π-h,--help[=false]β help forrun. the classic "help me help you" moment π--ip=""β assign the provided IP address, so it actually knows where it lives π‘-a,--kernel-arg=[]β set additional kernel arguments. little whispers to the kernel, iykyk π€«-K,--kraftfile=""β set an alternative path of the Kraftfile. for when your Kraftfile isn't where everyone expects it to be, we don't judge π--mac=""β assign the provided MAC address, so your instance has a whole identity β¨-M,--memory="64Mi"β assign memory to the unikernel. units areK/Ki,M/Mi,G/Gi. the default is literally64Mi, tiny icon π-n,--name=""β name of the instance. give it a name, it deserves one π--network=[]β attach instance to the provided network, in the format<network>[:ip[/mask][:gw[:dns0[:dns1[:hostname[:domain]]]]]], e.g.kraft0:172.100.0.2. yes the format is that long. yes it's giving nested brackets. we love her anyway π--no-start[=false]β do not start the machine. it exists, it's just β¨restingβ¨--plat="auto"β set the platform virtual machine monitor driver. default isauto, let the machine decide, she's confident π-p,--port=[]β publish a machine's port(s) to the host, so the outside world can say hi π--prefix=""β prefix each log line with the given string. aesthetic logging π--prefix-name[=false]β prefix each log line with the machine name. same energy but it does the naming for you π--rm[=false]β automatically remove the unikernel when it shuts down. clean girl aesthetic, no leftovers π§Ή--rootfs=""β specify a path to use as root file system (can be volume or initramfs) ποΈ--rootfs-type="cpio"β set the type of the format of the rootfs (cpio/erofs). default'scpioπ-r,--runtime=""β set an alternative unikernel runtime π¦--symbolic[=false]β use the debuggable (symbolic) unikernel. for when you need to see everything π-t,--target=""β explicitly use the defined project target. multi-target projects, come get your girl π―-v,--volume=[]β bind a volume to the instance π¦
π₯ EXAMPLES π₯
this is the part where it all clicks, fr fr π‘
π« the basics
Run a built target in the current working directory project:
$ kraft run
Run a specific target from a multi-target project at the provided project directory:
$ kraft run -t TARGET path/to/project
π§ kernel binaries
Run a specific kernel binary:
$ kraft run --arch x86_64 --plat qemu path/to/kernel-x86_64-qemu
Run a specific kernel binary with 1000 megabytes of memory:
$ kraft run --arch x86_64 --plat qemu --memory 1G path/to/kernel-x86_64-qemu
Run a specific kernel binary with 1024 megabytes of memory:
$ kraft run --arch x86_64 --plat qemu --memory 1Gi path/to/kernel-x86_64-qemu
not me pointing out that1Gand1Giare different numbers of megabytes. iykyk π
π OCI + networking
Run an OCI-compatible unikernel, mapping port 8080 on the host to port 80 in the unikernel:
$ kraft run -p 8080:80 unikraft.org/nginx:latest
Attach the unikernel to an existing network kraft0:
$ kraft run --network kraft0
π«Ά binary compatibility
Run a Linux userspace binary in POSIX-/binary-compatibility mode:
$ kraft run a.out
π rootfs things
Supply an initramfs CPIO archive file to the unikernel for its rootfs:
$ kraft run --rootfs ./initramfs.cpio
Supply a path which is dynamically serialized into an initramfs CPIO archive:
$ kraft run --rootfs ./path/to/rootfs
π volumes
Mount a bi-directional path from on the host to the unikernel mapped to /dir:
$ kraft run -v ./path/to/dir:/dir
Supply a read-only root file system at / via initramfs CPIO archive and mount a bi-directional volume at /dir:
$ kraft run --rootfs ./initramfs.cpio --volume ./path/to/dir:/dir
β the full flex
Customize the default content directory of the official Unikraft NGINX OCI-compatible unikernel and map port 8080 to localhost:
$ kraft run -v ./path/to/html:/nginx/html -p 8080:80 unikraft.org/nginx:latest
π SEE ALSO π
kraft(1) β go say hi to the parent command, she misses you π
π¦ HISTORY π¦
1-Jan-1980 β Auto generated by KraftKit. iconic date, no notes πβ¨
and that's the whole page!! π«Ά this lil doc came from the KraftKit Documentation, dated Jan 1980, and it's all sitting pretty in the KraftKit CLI(1) manual. go run some unikernels, bestie, you're gonna slay π πβ¨
π¦ where this page comes from
- nixpkgs unstable: kraft 0.12.16
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms