If you didn’t read the previous article (Building the Ultimate VirtualBox Lab – 1 – Configure VBox), I suggest you check it out since it has a couple key configuration changes in VBox that will save you some headaches later.
So, part of building the ultimate virtualbox lab means we should setup a firewall within the lab. Not so much for safety, but for learning. This is a really cool way to practice dealing with firewalls without learning “on the job”.
Install pfSense in VirtualBox
Before we get started I would like to explain the reason I have decided to use pfSense within our virtual lab for learning. When setting up a virtual server test lab, I like to try and mimmic an actual business environment as closely as possible. Because we want to use virtualization for this task, what pfSense will do is act as our virtual test lab’s router (to allow the virtual machines access to the internet). This will keep my host’s machine safe as well as any computers/devices on my host’s network. I guess you can look at it as my host’s network is acting as an ISP for my virtual environment.
Another reason why I wanted to use pfSense is so I can produce some tutorials on some key features of pfSense in the future when things settle down here at the house (remodeling/selling/buying another new house, etc.)
This article is part 3 of 6 in the series:
- Part 1: Building the Ultimate VirtualBox Lab – Intro
- Part 2: Building the Ultimate VirtualBox Lab – Configure Vbox
- Part 3: Building the Ultimate VirtualBox Lab – Install pfSense
- Part 4: Building the Ultimate VirtualBox Lab – Install Windows 2012 Base
- Part 5: Building the Ultimate VirtualBox Lab – Prep for .vdi Compacting
- Part 6: Building the Ultimate VirtualBox Lab – Linked Clones
- Bonus: Building the Ultimate VirtualBox Lab – RDP to Virtual Machines
Let’s Get Started
We need to setup pfSense first so that during the other VM setups we can get out to the internet to install updates.
You can find the download links on this page.
Normally I like to include a lot of screenshots within these tutorials, but I think since the below instructions are pretty straight forward (and there is an associated video), I think I will hold off on the screenshots. If you feel they would help with this tutorial, please let me know in the comments section below and I will happily add them.
Create a new VM with minimum specs (pfSense doesn’t need to be run on a powerful machine).
- Name: pfSense
- Type: Linux
- Version: Other Linux
- 256MB of RAM
- 8GB for the Dynamically allocated vdi (hard drive) should work out fine. You don’t need this one to be stored on an SSD but if you have the space, go for it.
- 1 CPU
- 2 NICs
- Adapter 1: Enable Network Adapter
- Attached to: Bridged (This will be our WAN port in pfSense)
- Adapter 2: Enable Network Adapter
- Attached to: Internal (This will be our LAN port in pfSense)
- Adapter 1: Enable Network Adapter
- Attach the pfSense ISO to the CDRom drive so we can boot off of the CD
- Floppy drive
- Enable absolute pointing device
- USB Controller
- If using an SSD, tell VBox that the VM is stored on an SSD
- Select the vdi under the SATA Controller
- Put a check in the Solid-state drive option under Attributes (This tells the guest OS that it’s drive is an SSD so it can take appropriate actions to deal with an SSD such as Windows disabling defrag, etc..)
Power on the VM and begin the setup
- Select option 1 to boot pfSense
- Pay attention during the install, you will see an option to select “I” to install, otherwise it will auto continue with running the live CD. Select “I”
- Follow the prompts to install pfSense (I selected the Quick/Easy install)
- During the first boot off of the hard drive, we need to configure a few things
- Do you want to set up VLANs now: N
- Enter the WAN interface name: em0
- Enter the LAN interface name: em1
- Optional 1 Interface: (leave blank and press Enter)
- Let’s configure our WAN port to be static
- Select number 2 (Set interface(s) IP address
- Select number 1 (WAN)
- Configure WAN interface via DHCP?: N
- Type in the IP you want to give it (has to be on your host’s subnet) (I’m setting mine to 10.2.0.199)
- Type in the Subnet mask (more than likely you will be using 24)
- Revert to HTTP….: N
At this point we are done setting up pfSense. Once we setup our first Windows VM we will web into pfSense to finish a couple small configuration changes to allow our VMs access to the internet.
Pretty painless wouldn’t you say? Please leave your comments and/or questions below. I’m always open to suggestions as well.