istro

Infrastructure

Machines

Run virtual machines, Incus containers and a small Kubernetes cluster, and pass a GPU to a VM.

The Machines page runs other systems on your server. It has Virtual Machines, Incus and k3s. Turn on the Virtual machines option in Settings to install the packages. See Settings.

#Virtual Machines

VMs use libvirt and KVM. A Linux guest needs far less as a container, so use a VM for Windows, another kernel or a GPU passthrough.

bistro vm status                # libvirt, KVM, VM counts, disk space
bistro vm isos                  # ISO files in /srv/data/iso
bistro vm create win11 --ram 8192 --cpus 4 --disk 80 --iso /srv/data/iso/win11.iso
bistro vm list
bistro vm start win11
bistro vm console win11         # VNC or SPICE address and the SSH tunnel
bistro vm snapshot win11 before-update
bistro vm stop win11            # asks the VM to shut down; --force cuts the power

The ISO must be a file in /srv/data/iso. New VMs listen for the console on 127.0.0.1 only. Without /dev/kvm, create stops. Turn on VT-x or AMD-V in the firmware, or add --emulated for slow software emulation.

#Incus Containers

Incus runs LXC containers and VMs next to your apps. Nothing runs until setup. Setup installs Incus and makes a local storage pool and a bridge.

bistro incus setup
bistro incus create web debian/13
bistro incus create lab alpine/3.21 --vm
bistro incus list
bistro incus console web        # a shell inside the instance
bistro incus stop web           # start and delete also exist; --force on stop and delete

The Apps page lists these as apps of kind lxc. See Apps.

#k3s

k3s is a small Kubernetes. Bistro installs a pinned release by hand and checks its SHA-256. It does not pipe a script into a shell.

bistro k3s steps                # print the install steps, run nothing
bistro k3s install              # a single server
bistro k3s install --ha         # first server, so more can join later
bistro k3s nodes
bistro k3s kubeconfig           # path; add --print for the contents
bistro k3s join-token           # a secret, on a server only
bistro k3s uninstall            # --purge also deletes the cluster state

To join a cluster, pass the server URL and send the token on stdin.

bistro k3s install --agent https://192.168.1.10:6443    # worker
bistro k3s install --server https://192.168.1.10:6443   # one more server, needs --ha first

The kubeconfig and join token are secrets. Bistro's cluster tools can join k3s for you. See Cluster.

#GPU Passthrough

Passthrough hands a PCI device, usually a second GPU, to a VM. The card the machine boots with cannot be passed through. IOMMU must be on.

bistro vfio check               # IOMMU, kernel arguments, what blocks passthrough
bistro vfio status              # GPUs and their IOMMU groups
bistro vfio bind 0000:01:00.0 --dry-run
bistro vfio bind 0000:01:00.0   # takes effect at the next boot
bistro vm gpu-attach win11 0000:01:00.0

Bind writes modprobe, module and GRUB settings. Nothing changes live. Run bistro vfio unbind with the address to give the card back at the next boot. Bistro keeps a copy of the GRUB file.