Skip to main content

Module machine

Module machine 

Source
Expand description

isb machine: incus runs only on Linux, so on macOS isb manages a Lima VM that runs it, the way podman machine does.

The VM is plain Lima (limactl, installed separately) driven by a YAML file isb generates into ~/.isb/machine/<name>/lima.yaml:

  • Ubuntu 24.04 with incus from Zabbly’s stable channel. incus’s socket is owned by the Lima user (a SocketUser drop-in), because Lima forwards it over an ssh connection that was opened before any group change.
  • $HOME mounted writable at the same path (virtiofs), so a bind source like ./app resolves to the same absolute path on the Mac and in the VM. Apple’s virtiofs reports every file as owned by whoever asks and writes as the Mac user, so any container uid can write a bind mount and idmap: auto maps nothing (ISB_BIND_CALLER_OWNED tells the daemon).
  • The incus socket and isb serve’s socket forwarded to ~/.isb/machine/<name>/{incus,serve}.sock, and loopback listeners (incus proxy devices, the stack balancer, the daemon’s 8092) forwarded to the Mac’s 127.0.0.1 by Lima.
  • isb serve runs in the VM as a system unit, as the Linux binary, next to the bridges its balancer must reach.

Structs§

InitOptions
LaunchAgentInstall
LimaConfig
What the generated Lima YAML depends on.
Status
What isb machine status reports.

Constants§

DEFAULT_NAME
The machine every command uses unless told otherwise, and the one whose sockets Client::default_socket and the serve socket fall back to.
LAUNCH_AGENT_LABEL
launchd label of the agent isb serve install writes on macOS.
SERVE_LISTEN
The daemon’s HTTP listener in the VM, forwarded to the same address on the Mac.

Functions§

dir
~/.isb/machine/<name>: the Lima YAML, the staged guest binary and the forwarded sockets.
guest_user
The guest user name: the Mac user’s when it is a valid Linux name, else lima, as Lima itself would choose.
incus_socket
init
Create and start the machine, install incus and the guest’s isb serve. log receives one progress line per step.
install_launch_agent
Write the LaunchAgent, load it (which starts the machine), and wait for the daemon in the machine to answer.
release_asset
The release asset name for a version and architecture.
remove
Delete the VM, its files and a LaunchAgent that starts it.
render_guest_unit
The isb serve unit in the guest. @HOME@ is filled in there.
render_launch_agent
The LaunchAgent: run isb machine start NAME at login. path is the PATH it runs with, which must find limactl.
render_lima_yaml
The Lima instance definition isb machine init starts.
serve_socket
shell_command
limactl shell NAME [argv], for the caller to exec.
start
Start a stopped machine (a no-op when it is running) and wait for its sockets.
status
stop
uninstall_launch_agent
Unload and delete the LaunchAgent (a no-op without one).
validate_name
A machine name doubles as the Lima instance name.