Protect Windows with pfSense and VirtualBox. Part 4: Installing and configuring pfSense on VirtualBox

Note: if you need help with installing pfSense beyond the instructions included in this tutorial, you can always refer to the project’s official tutorials, wiki, and official forum, or even better, buy the manual available on Amazon.com or Amazon.co.uk (a Kindle edition is also available on each). Buying the book also means contributing financially to this amazing Open Source project.

  1. Now, first thing first: I was saying that we need to run our virtual machine effortlessly, as in having it automatically suspending / resuming when turning off / on the host. It means that for the day-to-day usage we will normally run VirtualBox headless. When doing that, we can get access to our VM through MS Remote Desktop. But to be able to do that we need to enable the VRDP server, which is done on a per-VM basis. The easiest way is to do that in the VirtualBox Manager:

  1. Click on Settings and then Display. Click on the Remote Display tab and check the Enable server box. Type in a number – say, 5010 – for Server Port (later, for convenience, you’ll use Microsoft’s RDP to access the VM from your PC, since VirtualBox will be running headless. Nevertheless, that will only give you access to the console of pfSense. For the complete configuration of the firewall you’ll use a browser anyway). Set Authentication Method to Null:

  1. Click on Storage, then under the storage tree click on the CD icon (red arrow), then click the icon for setting up the virtual CD/DVD drive (green arrow). Click on Choose a virtual CD/DVD disk file and browse to the pfSense .iso file which you have downloaded during part 1:

  1. Now click on Network on the left toolbar. We need to set two NICs. Click on the Adapter 1 tab and in the Attached to drop-down box select Bridged Adapter, whilst making sure that in the Name drop-down box the name of your physical card appears, NOT the Microsoft Loopback adapter  (so this will now become the firewall’s WAN interface, bridged to your physical NIC):

  1. Going further, click on the Adapter 2 tab. Check the box to enable the adapter, in the Attached to drop-down box select Bridged Adapter, whilst making sure that in the Name drop-down box you choose Microsoft Loopback Adapter (so this will be the firewall’s LAN interface, connected to your logical NIC, the Loopback adapter). Then click OK:

  1. Go to VirtualBox Manager, right-click the pfSense virtual machine and click Start. When the VM starts, click inside the window and then in the welcome screen type in 1 in order to boot pfSense:

  1. pfSense will take a few seconds to load the drivers and initialize the devices, after which it gives you the option to launch the installer. You’ve got nine seconds for that. Press i:

  1. In the following window you can customize keymap and font settings or simply choose Accept these settings (the default ones should do for most users):

  1. In the next window choose Quick Install. It will warn you that the installer will not ask any questions and that it will erase the entire HDD. Of course, it is the virtual HDD, so don’t worry. Then enter OK.
  2. Wait for the installer to finish copying files. Then it will ask you to choose the kernel. Go with the uniprocessor kernel:

It should install successfully and then ask you for a reboot. Proceed accordingly. DON’T FORGET TO REMOVE THE ISO IMAGE FROM THE VIRTUAL CD! Done! Time to configure pfSense’s LAN and WAN interfaces.

<<Part 3: Installing VirtualBox and creating a new VM for pfSense

Part 5: Configuring VLANs. Removing Windows’ TCP/IP stacks>>

About Manuel Timita

Passionate about both human and IT systems. More curious than a cat, yet hoping to dodge its proverbial fate for a while.
This entry was posted in Hacks, Tutorials and tagged , . Bookmark the permalink.

5 Responses to Protect Windows with pfSense and VirtualBox. Part 4: Installing and configuring pfSense on VirtualBox

  1. Jass says:

    Thanks for your excellent work… I am preparing my tesis and you have helped me a lot…
    Thanks for sharing you knowledge… SAYNOTOSOPA

  2. Mohammed J.H says:

    Hi,

    I’m trying to setup pfsense on hyper-v, and when reaching to the part quick install and formatting the disk it says:

    execution of the command /sbin/fdisk -v -f /tmp/format.fdisk ad0 “Failed with a return code of 1.

    is pfsense supported on hyper-v ?

    Thanks

    • Manuel Timita says:

      Hi Mohammed,

      I am familiar with VMware and Virtual Box (from my experience, on both pfSense installs seamlessly), but not so much with Hyper-V.

      Still, it looks more like pfSense has an issue with your virtual disk geometry – perhaps Hyper-V sets the number of sectors per track too high on your VHD when it creates it. Apparently fdisk has an issue with that – are you trying to install it on a disk larger than 31GB? Check this page for VHD file format limitations.

      Also you might find this part of the official pfSense installation guide helpful.

      Good luck!
      Manuel

  3. joseluis says:

    this problem is the size from your harddisk, tyr againt with 5 or 10 gb in your harddisk

  4. Albert says:

    Thanks very much for this tutorial, really helped me alot. I will like to ask of your permission to use the information on this guide and make a video on it, I want to share it with my class mate with the intention of promoting the use of open source software. Please let me know if i am granted the permission to do so.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>