Skip to content

Fortios.qcow2

virt-install --name fortigate-prod \
  --ram 8192 --vcpus 4 \
  --disk path=/var/lib/libvirt/images/fortios.qcow2,device=disk,bus=virtio \
  --import \
  --network network=dmz-net,model=virtio \
  --network network=wan-net,model=virtio \
  --network network=lan-net,model=virtio \
  --os-variant generic \
  --console pty,target_type=serial

Use virt-copy-out to copy files/directories:

# Copy entire config directory
sudo virt-copy-out -a fortios.qcow2 /data/config .

Avoid CPU overcommit. Pin dedicated vCPUs to physical cores using virsh vcpupin or the cpuset= option in the domain XML.

The use of FortiOS.qcow2 offers several advantages: fortios.qcow2

sudo guestmount -a fortios.qcow2 -i --ro /mnt/fortios

While KVM is native, fortios.qcow2 also works on: virt-install --name fortigate-prod \ --ram 8192 --vcpus 4

guestunmount /mnt/forti

Warning: Manipulating the raw image bypasses FortiOS integrity checks. Only recommended for lab automation.