crun(1)
krun π§β¨π
okay bestie, this is the krun page from the crun manual β crun(1), General Commands Manual energy β and it's the mode where crun gets its own isolated KVM moment. No cap, the whole thing is a vibe.
πΈ NAME πΈ
krun β crun based OCI runtime using libkrun to run containerized programs in isolated KVM environments.
β¨ SYNOPSIS β¨
krun [global options] command [command options] [arguments...]
π¦ DESCRIPTION π¦
krun is a sub package of the crun command line program for running Linux containers that follow the Open Container Initiative (OCI) format. The krun command is a symbolic link to the crun executable, that tells crun to run in krun mode.
krun uses the dynamic libkrun library to run processes in an isolated environment using KVM Virtualization.
libkrun integrates a VMM (Virtual Machine Monitor, the userspace side of a Hypervisor) with the minimum amount of emulated devices required for its purpose, abstracting most of the complexity from Virtual Machine management.
because of the additional isolation, sharing content with processes and other containers outside of the krun VM is more difficult. π that's the tradeoff, bestie.
π CONFIGURATION π
The microVM can be configured through OCI annotations or a .krun_vm.json file placed at the root of the container image. When both are present, OCI annotations take precedence.
π OCI Annotations π
OCI annotations can be passed at container creation time. For example, with podman:
podman run --runtime=krun --annotation krun.nested_virt=1 ...
The following annotations are supported:
krun.cpus=NUMβ number of vCPUs for the microVM (maximum 16). If not set, defaults to the number of CPUs available via the process CPU affinity.krun.ram_mib=NUMβ amount of RAM in MiB for the microVM. Values below 128 MiB are ignored. If not set, defaults to the OCI memory limit if present, otherwise 1024 MiB.krun.gpu_flags=FLAGSβ enable virtio-gpu with the specified virgl flags. Requires/dev/drito be available. When FLAGS includesVIRGLRENDERER_RENDER_SERVER,/usr/libexec/virgl_render_servermust also be available.krun.use_passt=NUMβ when set to a value greater than 0, enable passt-based networking in the microVM.krun.nested_virt=NUMβ when set to a value greater than 0, enable nested virtualization in the microVM, exposing hardware virtualization support (VMX on Intel, SVM on AMD) to the guest. This requires nested virtualization to be enabled on the host (e.g./sys/module/kvm_intel/parameters/nestedor/sys/module/kvm_amd/parameters/nestedmust reportYor1). A warning is emitted if the host does not appear to support nested virtualization.krun.variant=VARIANTβ select an alternative libkrun variant. Supported values aresev(AMD SEV confidential workloads) andaws-nitro(AWS Nitro Enclaves).
π VM Configuration File π
A .krun_vm.json file can be placed at the root of the container image to provide default VM settings. The file is a JSON object with the following optional fields:
cpus(integer): same as thekrun.cpusannotation.ram_mib(integer): same as thekrun.ram_mibannotation.gpu_flags(integer): same as thekrun.gpu_flagsannotation.use_passt(integer): same as thekrun.use_passtannotation.nested_virt(integer): same as thekrun.nested_virtannotation.flavor(string): same as thekrun.variantannotation.kernel_path(string): path to an external kernel.kernel_format(integer): kernel format identifier.initrd_path(string): path to an initrd image.kernel_cmdline(string): kernel command line.virtiofs_tag(string): VirtioFS tag (defaults to/dev/root).virtiofs_shm_size(integer): VirtioFS DAX shared memory size in bytes (defaults to 512 MiB).
Example:
{"nested_virt": 1, "cpus": 4, "ram_mib": 2048}
π COMMANDS π
See crun.1 man page for the commands available to krun.
π₯ SEE ALSO π₯
crun.1
sign-off: this is the crun(1) page from the User Commands section, and the original footer doesn't list a date, so I'm not inventing one β just leaving you with the exact vibe π
π«Άβ¨.
π¦ where this page comes from
- arch rolling: krun 1.30.1-1 Β· LGPL-2.1-or-later
- fedora 44: crun-krun 1.30-1.fc44 Β· GPL-2.0-only
- nixpkgs unstable: crun 1.30.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms