The Complete Guide to Installing pfSense on VirtualBox


The Complete Guide to Installing pfSense on VirtualBox

pfSense, a free and open source firewall/router computer software distribution based on FreeBSD, is the best way to protect your network from intruders. In this blog post we will go through the steps of installing pfSense on VirtualBox so you can have a powerful machine running at all times!

How to Install pfSense on Virtualbox

VirtualBox is an open source virtualization application for x86 systems. It can be used to run operating systems in a virtual environment. The advantage of this type of system is that it will not affect the performance or stability of your computer, since you are running two different machines simultaneously! VirtualBox creates “virtual computers” within your physical device, which is very useful if you want to test different operating systems without affecting your main machine.

The installation of pfSense is very easy, but before starting make sure you have downloaded the latest pfSense virtual machine image . As for VirtualBox it can be easily installed through its website , which provides binaries for most popular operating systems (including Windows, Linux and Mac OS).

Requirements:

  • VirtualBox
  • pfSense image file.

VirtualBox can be easily installed through its website , which provides binaries for most popular operating systems (including Windows, Linux and Mac OS).

Installation of pfSense on Virtualbox:

Once VirtualBox is installed, you will need to create a new virtual machine.

  • Open the “Oracle VM VirtualBox Manager” and click on “New”.
  • Name your virtual machine (We’ll use pfsensevbox) select OS type: BSD , Version: FreeBSD (64-bit). Click next.
  • Now select the amount of RAM to be allocated (I recommend you set it as at least 1024 MB, but 2048 is even better).
  • Next step will require you to create a virtual hard disk for your pfsense installation. Make sure you uncheck “Start-up Disk” in order to not boot from an existing system when starting up your VM. Click on Create and Next .
  • Select VDI (VirtualBox Disk Image) , Dynamically Allocated , then click next. And finally choose how much space pfsense should take on your physical device: I’d recommend 40GB minimum! On this screen also make sure that Enable EFI is checked if available otherwise leave unchecked – we won’t need it in our case since we’ll be using an already pre-created pfsense virtual machine image. Click next and finish .

Open your pfSense virtual disk by clicking on it under the “VirtualBox Manager” window (You may need to refresh). Now you will see a new entry called “pfsensevbox” or whatever name you chose for your virtual machine.

Right click on it and choose settings.

  • Under General , make sure Enable EFI (if available) is checked if not leave unchecked – we won’t need it since our VM was already created with this option set as enabled.
  • Under System , change Boot Order so CD/DVD comes first then network otherwise Virtual Box will try to boot off the network and fail.
  • Under Processor , assign one CPU (two is better but not necessary).
  • Under Network : Since our VM will be using the network, it is best to leave this section as default.
  • Storage : Empty – Click on the small CD icon with a plus sign, then choose your pfSense iso file from Virtual Box’s files menu. Now click on storage , select IDE Controller at top left of the window that appeared, then add CD/DVD Drive by clicking Add Hard Disk just below the General tab which will mount our selected iso file as a CD/DVD drive in the virtual machine. Click OK .

Start up your pfsense vm by right clicking on it then clicking Start , or just reboot if it’s already running and click resume under VirtualBox Manager window to boot into pfSense installer.

  • Upon first boot up, you will get a menu with two options: Live CD or Install. Choose install by pressing enter .
  • The installer will now run and ask you a few questions: Language , select by pressing spacebar. Choose your keymap, by default it should be US . Hostname , it’s up to you what name to give your pfsense machine. Root password – Make sure it’s secure! I use a random password generator for this part. Add user – I normally just add myself with the same password as my root account, but it is up to you if you want to add a separate user. Configure Network: I normally just configure it for DHCP by pressing enter and selecting yes . Set Time Zone – press spacebar. And finally Quit/Exit – Just press q and then enter when asked to reboot.
  • The installer will now finish its installation process, you can then access your newly installed pfsense machine by opening VirtualBox Manager and clicking on “pfsensevbox” (or whatever name you chose)
  • You can now install pfsense and configure it to your liking! (i.e: setting up a wireless network, changing the hostname, etc).

Troubleshooting any issues that arise during installation or configuration process:

  • If you get stuck on the “Starting pfsense” line during bootup – it may be because your Virtual Machine can’t use EFI, so uncheck Enable EFI in System > Boot Order and try again.
  • If you get the error “Only one processor is supported by this virtual machine type” when configuring CPU – It may be that your system supports more than one cpu but VirtualBox isn’t recognizing it, so open up command prompt and enter: wmic computersystem get numberofprocessors . This will output how many CPUs are recognized on your physical device.
  • If the installer hangs on a line during bootup – enter safe mode by pressing spacebar at the dashes and entering “safe” as your root password then press ctrl+c to cancel installation. Then remove any CD/DVD from Boot Order in System > Storage . Try again after rebooting pfsensevbox several times until you get a successful install of pfsense! If that fails too, there’s probably something wrong with your virtual machine image file so just download another one from this guide if needed.
  • If you get an error saying “An I/O Error occured” when booting from the iso file – Try opening up VirtualBox and go to Devices > Optical Drives , select your ISO, click on Settings which will open a new window. Under Attributes check both Connected at Power On and Live CD/DVD then try restarting pfsense installation process by clicking Resume in VirtualBox Manager .

Recent Posts