Skip to content

run, exec, shell, cp

Like docker. But with its own kernel.

Terminal window
kling run -image toolchain -name job -allow-exec -ttl 600 -egress internet
kling run -from golden -name g1 # from a golden, in ms

-allow-exec is a boot-time gate: it travels on the kernel command line, which only the host writes. Without it, exec, shell and cp do not exist inside.

Terminal window
kling exec job -- python3 /tmp/analisis.py
  • Output arrives as it is produced, with stdout and stderr kept apart.
  • It exits with the remote exit code.
  • -i passes stdin; -timeout kills the whole process group.
Terminal window
kling shell job

A real terminal: vim, history, colors. Ctrl-C interrupts what runs inside, not the session. Up to 8 sessions per microVM.

Terminal window
kling cp ./analisis.py job:/tmp/
kling cp job:/tmp/resultado.json .
Terminal window
kling run -image toolchain -mem 512 -mem-max 2048 -name job
kling machine resize job -mem 1536

Measured in the lab: the guest’s available memory went from 399 to 1,398 MiB and back down to 270 MiB, without a reboot.