Skip to content

Getting Started with PiVirt

QuickstartLinux / KVMGo 1.22+

This guide walks you through installing PiVirt (pvcli), setting up host prerequisites, and launching your first virtual machine in minutes.


Before installing PiVirt, ensure your host environment meets the following requirements:

Linux Kernel & KVM

Linux host running kernel 5.10+ with hardware virtualization (/dev/kvm) enabled in BIOS/UEFI.

System Resources

Minimum 4GB RAM and 20GB free disk space for host services and initial OS images.

Administrative Access

root or sudo access required for KVM device management and network bridge setup.

Build Tools (Optional)

Go 1.22+ is only required if you choose to build pvcli and pivirtd from source code.


Select your preferred installation method below:

Install pivirtd (hypervisor daemon) and pivirtctl (host management CLI) directly from the official PiLab Package Repository (dl.pilab.hu), built via GoReleaser:

Terminal window
# 1. Add PiLab GPG signing key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://dl.pilab.hu/pivirt.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/pilab.gpg
# 2. Add PiLab APT repository
echo "deb [signed-by=/etc/apt/keyrings/pilab.gpg] https://dl.pilab.hu/deb stable main" | sudo tee /etc/apt/sources.list.d/pilab.list
# 3. Update & Install pivirtd (bundles pivirtd + pivirtctl)
sudo apt-get update
sudo apt-get install -y pivirtd
# 4. Enable and start the service
sudo systemctl enable --now pivirtd

Follow these step-by-step instructions to initialize PiVirt, pull an operating system image, and boot a virtual machine instance:

  1. Initialize CLI Configuration

    Generate your user configuration file at ~/.config/pvcli/config.yaml:

    Terminal window
    pvcli config init
  2. Discover and Pull an OS Image

    List available OS images managed by osinfodb and pull Ubuntu 24.04:

    Terminal window
    # List available images
    pvcli image list
    # Download Ubuntu 24.04 image
    pvcli image pull ubuntu-24.04
  3. Create the Virtual Machine Instance

    Specify your VM configuration via CLI flags or launch the interactive configuration wizard:

    Terminal window
    # Create with declarative CLI flags
    pvcli vm create \
    --name web-server \
    --image ubuntu-24.04 \
    --cpus 2 \
    --memory 4G \
    --disk 20G \
    --network bridge=virbr0
    # Or run without flags for the interactive TUI wizard
    pvcli vm create
  4. Start and Access the Virtual Machine

    Power on the VM instance and connect via serial console or VNC:

    Terminal window
    # Power on the virtual machine
    pvcli vm start web-server
    # Inspect runtime details (IP, TAP interface, VNC port)
    pvcli vm info web-server
    # Attach to serial console
    pvcli vm console web-server

If KVM acceleration is missing:

Terminal window
# Verify KVM support
kvm-ok
# Load host kernel modules
sudo modprobe kvm_intel # For Intel CPUs
sudo modprobe kvm_amd # For AMD CPUs
sudo modprobe vhost_net