TerraformPilot

DevOps

Terraform for NetBSD VMs and Cross-Platform Labs

Provision NetBSD VMs with Terraform on Proxmox, KVM, and Xen for cross-platform testing, embedded simulation, and portability research.

LLuca Berton1 min read

NetBSD is the most portable Unix in the world — it runs on more architectures than any other OS. Cloud providers don't ship official NetBSD images, so Terraform usually targets self-hosted hypervisors (Proxmox, KVM via libvirt). Use case in 2026: cross-platform CI, pkgsrc package validation, and embedded board emulation.

Proxmox VM from ISO

#
resource "proxmox_virtual_environment_vm" "netbsd" {
  name      = "netbsd-10"
  node_name = "pve1"
 
  cpu { cores = 2; type = "host" }
  memory { dedicated = 1024 }
 
  cdrom {
    enabled = true
    file_id = "local:iso/NetBSD-10.1-amd64.iso"
  }
 
  disk {
    datastore_id = "local-lvm"
    interface    = "virtio0"
    size         = 16
  }
 
  network_device {
    bridge = "vmbr0"
    model  = "virtio"
  }
 
  serial_device {}
}

libvirt (KVM) Alternative

#
terraform {
  required_providers {
    libvirt = { source = "dmacvicar/libvirt", version = "~> 0.7" }
  }
}
 
resource "libvirt_volume" "netbsd" {
  name   = "netbsd.qcow2"
  pool   = "default"
  source = "/var/lib/libvirt/images/NetBSD-10.1-amd64-cloud.img"
  format = "qcow2"
}
 
resource "libvirt_domain" "netbsd" {
  name   = "netbsd-10"
  memory = "1024"
  vcpu   = 2
 
  disk { volume_id = libvirt_volume.netbsd.id }
  network_interface { network_name = "default" }
  console { type = "pty"; target_type = "serial"; target_port = "0" }
}

Best Practices

#
  • No major cloud provider supports NetBSD natively — plan for self-hosted.
  • Use pkgsrc for predictable package builds across NetBSD versions.
  • Pin the ISO checksum in your Terraform — releases roll without warning.
  • For embedded simulation, pair NetBSD with QEMU rather than provisioning real hardware.
#
#Terraform#NetBSD#BSD#Proxmox#Cross-Platform

Share this article