Installing ESXi and OPNsense: A Complete Guide
A step-by-step walkthrough for setting up VMware ESXi on a NUC and deploying OPNsense as your virtualized firewall solution.
Table of contents
Open Table of contents
Part 1: Downloading and Preparing ESXi
Downloading ESXi from Broadcom
- Navigate to the Broadcom website and create an account (or log in if you already have one)
- Click on the My Downloads tab
- Select the Free Downloads button located in the middle of the interface
- Click on VMware vSphere Hypervisor
- Choose the latest version and download the ISO
Creating a Bootable USB Drive (macOS)
Find Your USB Drive
diskutil list
Identify your USB drive from the list. In this example, we’ll use disk4.
Format the Drive
diskutil eraseDisk MS-DOS "ESXI" MBR disk4
Unmount the Drive
diskutil unmountDisk /dev/disk4
Configure the Boot Partition
Enter fdisk interactive mode:
sudo fdisk -e /dev/disk4
Make the first partition active and exit:
f 1
quit
Copy ESXi Files
- Mount the ESXi ISO file (double-click in Finder)
- Copy all contents from the mounted ISO to your USB drive (you can use Finder for this)
Modify the Boot Configuration
Navigate to the USB drive:
cd /Volumes/ESXI
Edit the boot configuration file using your preferred text editor:
vi ISOLINUX.CFG
Find the line that reads:
APPEND -c boot.cfg
Modify it to:
APPEND -c boot.cfg -p 1
Rename the configuration file:
mv ISOLINUX.CFG SYSLINUX.CFG
Return to the root directory and unmount the drive:
cd /
diskutil unmountDisk /dev/disk4
Part 2: Installing ESXi on Your NUC
BIOS Configuration
- Insert the USB drive into your NUC
- Power on the NUC and enter the BIOS (typically by pressing F2 or DEL during startup)
- Navigate to the boot order settings
- Set the USB drive as the first boot priority
- Save and reboot
ESXi Installation
- The NUC will boot from the USB drive and launch the ESXi installer
- Follow the on-screen prompts to complete the installation
- Once installation is complete, remove the USB drive
- Reboot the system
Your ESXi host should now be up and running. Access the web interface using the IP address displayed on the console.
Part 3: Installing OPNsense
Prepare the Network Configuration
In the ESXi web interface, create port groups for your network segmentation:
- Create a port group for WAN (external network)
- Create a port group for LAN (internal network)
Download OPNsense
- Visit the OPNsense website
- Download the DVD ISO file
Upload to ESXi Datastore
- In the ESXi web interface, navigate to Storage
- Select your datastore
- Upload the OPNsense ISO file
Create the OPNsense Virtual Machine
Create a new VM with the following specifications:
General Settings:
- Guest OS Family: Other
- Guest OS Version: FreeBSD 14 or later
Hardware:
- CPU: 2 cores
- RAM: 4 GB
- Hard Disk: 20 GB
- SCSI Controller: LSI Logic Parallel
Network:
- Add two network adapters:
- Network Adapter 1: Connected to LAN port group
- Network Adapter 2: Connected to WAN port group
Installation Media:
- Add the OPNsense ISO to the CD/DVD drive
Start the Installation
- Power on the VM
- The OPNsense installer will boot from the ISO
- Follow the installation wizard to complete the setup
Next Steps
After installation, you’ll want to:
- Configure OPNsense network interfaces (assign WAN and LAN)
- Set up firewall rules
- Configure DHCP and DNS services
- Enable additional features as needed
Your virtualized network infrastructure is now ready to go!