Skip to content

Instantly share code, notes, and snippets.

@subrezon
Last active January 1, 2024 12:40
Show Gist options
  • Save subrezon/0fdd6244fb38a495d8ee762a4f93704f to your computer and use it in GitHub Desktop.
Save subrezon/0fdd6244fb38a495d8ee762a4f93704f to your computer and use it in GitHub Desktop.
Proxmox OPNsense serial install

This is a step-by-step guide to install an OPNsense VM using serial instead of VGA output. It's more resource efficient and allows you to connect to the serial console from Proxmox terminal, allowing things like copying / pasting text.

  1. Go to the OPNsense download page and select the correct image:
Architecture: amd64
Image type: serial
Mirror location: something in or close to where you live

Instead of downloading, right-click the download button and copy the download link.

Log in into Proxmox, download the image to /root and unpack the .bz2 archive it comes in.

wget https://mirror.dns-root.de/opnsense/releases/22.7/OPNsense-22.7-OpenSSL-serial-amd64.img.bz2
bzip2 -d OPNsense-22.7-OpenSSL-serial-amd64.img.bz2
  1. Create a new virtual machine with the following settings:
  • OS: Do not use any media (we will mount the image later)
  • System:
    • Graphic card: Serial 0
    • Machine: i440fx (Q35 also works)
    • BIOS: SeaBIOS (the serial image only does BIOS boot, no UEFI, thus you can't use OVMF)
    • SCSI Controller: VirtIO SCSI single
    • Qemu Agent: yes (don't forget to install os-qemu-guest-agent plugin later)
    • Add TPM: no
  • Disks:
    • Bus/Device: VirtIO Block
    • Disk size: at least 8 GiB
    • Cache: No cache
    • Discard: yes
    • IO thread: yes
  • CPU:
    • Sockets: 1
    • Cores: at least 2
    • Enable AES instructions (useful for VPNs)
  • Memory: at least 2048 MiB
  • Network: VirtIO (only create if you need virtual network devices)

Do not start the VM yet!

  1. Attach the OPNsense image to the VM:
qm importdisk VM_ID OPNsense-22.7-OpenSSL-serial-amd64.img STORAGE_ID

Wait patiently, it takes a long time even after the progress reaches 100%.

After that, go to the VM -> Hardware, double-click the newly added drive (shows up as "Unused Drive") and click OK.

After that, go to Options -> Boot Order and tick the box next to the new drive (shows up as "virtio1").

  1. If you want to pass through NICs, do that now (Hardware -> Add -> PCI Device). Make sure you've enabled PCIe passthrough (TODO add link to PCIe passthrough tutorial).

  2. Start the VM and boot to virtio1. Complete the OPNsense installation normally.

  3. After completing the install and rebooting, shut down the VM. First, go to Options -> Boot Order, disable virtio1 and enable virtio0. Then, go to Hardware and remove virtio1. While you're at it, also disable the tablet pointing device.

  4. Congrats! You're done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment