LXD pfsense VM installation

Hi,
I have tested with the new pfSense-CE-memstick-2.5.1-RELEASE-amd64.img image with lxd vm capability and it works great. Here are the steps as follows.

  1. lxc init pfsense --empty --vm -c limits.cpu=1 -c limits.memory=2GB -c security.secureboot=false -n lxdbr0 # create an empty instance.
  2. lxc config device override pfsense root size=32GB # resize the pfsense disk
  3. echo -n '-machine pc-q35-2.6' | sudo lxc config set pfsense raw.qemu - # change the machine type with qemu parameter.
  4. lxc config device add pfsense install disk source=/home/indiana/Downloads/pfSense-CE-memstick-2.5.1-RELEASE-amd64.img boot.priority=10 # Add boot disk image to the lxd vm
  5. lxc start pfsense && lxc console pfsense --type=vga
  6. Follows the pfsense installation parameters as UEFI and GPT and finished the installation.
  7. lxc stop pfsense --force # stop the lxd vm
  8. lxc config device set pfsense root boot.priority=15 # change the boot order
  9. lxc start pfsense && lxc console pfsense --type=vga # start the instance again

LXD VM configuration of the pfsense.

architecture: x86_64
config:
  limits.cpu: "1"
  limits.memory: 2GB
  raw.qemu: -machine pc-q35-2.6
  security.secureboot: "false"
  volatile.eth0.host_name: tap2d254e0f
  volatile.eth0.hwaddr: 00:16:3e:a0:b8:cc
  volatile.last_state.power: RUNNING
  volatile.uuid: 33b9c90b-e4dc-49e3-a1a1-f8f1d088b041
  volatile.vsock_id: "114"
devices:
  eth0:
    name: eth0
    network: lxdbr0
    type: nic
  install:
    boot.priority: "10"
    source: /home/indiana/Downloads/pfSense-CE-memstick-2.5.1-RELEASE-amd64.img
    type: disk
  root:
    boot.priority: "15"
    path: /
    pool: zpool
    size: 32GB
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""

Not: This configuration has just one network interface to test the pfsense installation please feel free to add another interfaces. And this simple quick documentation is not new just gathering some of the information together. And lastly thanks to the lxd team to make this happen, keep up the good work. Some of the points can be inaccurate. Happy pfsensing. :slight_smile:

3 Likes

Thanks! I’ve moved this to Tutorials.

1 Like

Thanks! Worked fine for me, easy and straightforward.

You are welcome.
Regards.

1 Like