And then you probably need the drivers for the nic. I do not have a NanoPi R6C, so have no idea about those files.
A VM image is just what you need for Opnsense. You will modify the VM image a little then copy the image to sdcard, nvme, eMMC.
There is no simple guide to do this.
You start with the download of the Opnsense image:
https://github.com/maurice-w/opnsense-vm-images/releases
grab the ufs | efi | vm | aarch64
Some people may want zfs
For example: OPNsense-25.7-ufs-efi-vm-aarch64.qcow2.bz2
use bunzip2 to unzip
Code:
bunzip2 OPNsense-25.7-ufs-efi-vm-aarch64.qcow2.bz2
Next step requires qemu-image--> you may need to install that package on your image builder system
Code:
qemu-img convert OPNsense-25.7-ufs-efi-vm-aarch64.qcow2 opnsense.raw
become root for rest of operations
make sure you are in correct directory
Code:
mdconfig -a -t vnode -u 10 -f opnsense.raw
ls /dev/md*
/dev/md10 /dev/md10p1 /dev/md10p2 /dev/mdctl
gpart show /dev/md10
=> 34 8921149 md10 GPT (4.3G)
34 532480 1 efi (260M)
532514 8388608 2 freebsd-ufs (4.0G)
8921122 61 - free - (31K)
So... it is index 2 to mount and manipulate
Code:
mount -t ufs /dev/md10p2 /mnt
** check that it really is mounted
Code:
ls /mnt
.cshrc COPYRIGHT media sys
.probe.for.growfs dev mnt tmp
.profile entropy net usr
.snap etc proc var
bin home rescue
boot lib root
conf libexec sbin
add nic driver to--> /mnt/boot/modules
I do not know what your nano Pi uses for nics
For this example I will use Realtek 1.98 driver
Code:
cp ../opnsense/if_re.ko /mnt/boot/modules/
** need to make FreeBSD load this nic driver at boot time
opnsense wants to use-- /boot/loader.conf.local
In order to deploy a custom change to this installation, #
# please use /boot/loader.conf.local as it is not rewritten
Code:
vi /mnt/boot/loader.conf.local
--------------------------
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
hw.re.max_rx_mbuf_sz="2048"
kern.cfg.order="acpi"
console="efi"
Now unmount the efi slice and detach the memory disk
Code:
umount /mnt
mdconfig -d -u 10
Figure out what you will use as your Opnsense disk (sdcard, nvme, whatever)
Plug that device into your Opnsense builder system
insert the sdcard into system
find the device name for the device (for example here is a usb sdcard)
Code:
tail /var/log/messages
kernel: da0: 400.000MB/s transfers
Now you can write your image to that device
Code:
dd if=opnsense.raw of=/dev/da0 bs=1M status=progress
Clean up that device after the dd write
Code:
gpart recover da0
da0 recovered
Check your work (for example using da0)
Code:
# gpart show -l da0
=> 34 62333878 da0 GPT (30G)
34 532480 1 efifs (260M)
532514 6291456 2 rootfs (3.0G)
6823970 55509942 - free - (26G)
These are the basic steps.
I do some extra steps to control the actual sizes of the slices.
If you need to make some changes to your new disk use these commands
Code:
for efi slice --> mount -t msdosfs /dev/da0p1 /mnt
for ufs slice --> mount -t ufs /dev/da0p2 /mnt
When using the EFI to boot make sure and set the firmware to ACPI.
Firmware: ACPI | Device Tree ==> ACPI
Also, set EFI system to correct boot device