Skip Ribbon Commands
Skip to main content
SharePoint

Install pfSense on Windows 2008 Hyper-V server

Last modified at 11/2/2013 11:47 AM by Koen Zomers
It is possible to install and use pfSense as a virtualized server running under Hyper-V server. Using the legacy network cards in Hyper-V you can communicate with the FreeBSD installation which is the base of a pfSense server. Do note though that the legacy network interfaces of Hyper-V suffer under poor performance. During my tests I managed to pull at its best 22 megabits per second traffic through these interfaces. If these speeds are acceptable for your situation, it works really stable on Hyper-V. If these speeds are not acceptable for your situation, consider either installing directly on hardware or use VMware virtualization.

Follow the steps below to install pfSense as a virtualized server on the Microsoft Hyper-V platform. This step by step guide assumes you have already installed the Hyper-V role on your server.
  1. First download the pfSense ISO you wish to use to install pfSense. You may also choose to download one of the v2.1 development IPv6 ready ISOs from my mirror (I advice for the x64 ISO):

    v2.1 development x64 (112 MB) - 20 september 2012 build
    v2.1 development x86 (98 MB) - 20 september 2012 build
    v2.1 development x64 (125 MB) - 26 november 2011 build
    v2.1 development x86 (111 MB) - 25 november 2011 build
  2. Open Hyper-V Manager
  3. On the right under the Actions menu, click on New and in the popup menu that appears, click on Virtual Machine
    pfSense-Install-on-HyperV-NewVirtualServer.png
  4. On the New Virtual Machine Wizard welcome screen, click Next
    pfSense-Install-on-HyperV-NewVirtualServer-2.png
  5. On the next screen, enter any name you would like to assign to your virtual machine and select the location where you want to store the virtual harddisk on which the server will be hosted. Once done click Next at the bottom.
    pfSense-Install-on-HyperV-NewVirtualServer-3.png
  6. Enter the amount of memory you want to assign to the virtual server. For pfSense, about 200 MB should be sufficient already. Assign a bit more if you can spare it, but it's not necessary. Click Next.
    pfSense-Install-on-HyperV-NewVirtualServer-4.png
  7. Select Not Connected at the Connection selection field. We need to change the network adapters to the legacy adapters lateron in the process anyway, so there's no use to assign a network adapter already here. Click Next to continue.

    pfSense-Install-on-HyperV-NewVirtualServer-5.png
  8. Make sure the Create a virtual hard disk option is selected and fill out the location where you want the virtual harddisk (VHD) to be created. A size of 5 GB is more than enough for pfSense. If you're really scarse on available diskspace, you could already settle with 1 GB of diskspace. Click Next to continue.

    pfSense-Install-on-HyperV-NewVirtualServer-6.png
  9. On the next step, select the option Install an operating system from a boot CD/DVD-ROM and browse to the location where you stored the pfSense ISO you downloaded at step 1 of this tutorial. Click Next to continue.

    pfSense-Install-on-HyperV-NewVirtualServer-7.png
  10. At the last step, confirm the settings by clicking on Finish.
  11. You will now see that a new virtual machine has been created in the Hyper-V Manager.
    pfSense-Install-on-HyperV-NewVirtualServer-8.png
  12. Right click on the row with your new virtual machine and in the popup menu that appears, click on Settings.
    pfSense-Install-on-HyperV-NewVirtualServer-9.png
  13. In the left column, click on Network Adapter and at the right click on Remove to remove it.
    pfSense-Install-on-HyperV-NewVirtualServer-10.png
  14. In the left column, click on Add Hardware, at the right click on Legace Network Adapter and click on Add.
    pfSense-Install-on-HyperV-NewVirtualServer-11.png
  15. At the left, click on the new Legacy Network Adapter that has been added to the left menu and configure it according to your needs at the right.
    pfSense-Install-on-HyperV-NewVirtualServer-12.png
  16. Repeast steps 14 and 15 for additional network adapters you want to add to your pfSense installation.
  17. Once done, click OK at the bottom to save the settings.
  18. Right click on the new virtual machine again and click on Connect

    pfSense-Install-on-HyperV-NewVirtualServer-13.png
  19. In the window that appears, click on Action followed by a click on Start.
    pfSense-Install-on-HyperV-NewVirtualServer-14.png
  20. You should now see the virtual machine booting from the pfSense ISO:

    pfSense-Install-on-HyperV-NewVirtualServer-15.png

    pfSense-Install-on-HyperV-NewVirtualServer-16.png
  21. Just let it boot, but keep a close eye on the boot process till you see the following screen on which you must press I on your keyboard within 9 seconds:

    pfSense-Install-on-HyperV-NewVirtualServer-17.png

    If you're too late and the boot process has continued, no worries. Just go to Action and click on Reset to restart the boot process.
  22. If you're on time with hitting I, you should see the blue installer screen. Use the arrow keys to navigate to Accept these Settings and press enter.

    pfSense-Install-on-HyperV-NewVirtualServer-18.png
  23. On the next screen keep the selection at Quick/Easy Install and press enter.

    pfSense-Install-on-HyperV-NewVirtualServer-19.png
  24. Confirm the warning screen by just pressing enter.
    pfSense-Install-on-HyperV-NewVirtualServer-20.png
  25. After a few minutes of installing the files you should get the following screen asking the type of kernel to install. Just leave Symmetric multiprocessing kernel selected and press enter to continue.
    With the more recent versions of the pfSense installation, the screen below will not be shown, but instead you'll see the screen on the screenshot below this. Choose Standard Kernel and press enter to continue.

    pfSense-Install-on-HyperV-NewVirtualServer-21.png
    pfSense-InstallOnHyperV-KernelOption.png
  26. Once done, press enter to let the virtual machine reboot.
    pfSense-Install-on-HyperV-NewVirtualServer-22.png
  27. Do note the default username and password which are set on the new pfSense installation. These are always user: admin, password: pfsense.

    pfSense-Install-on-HyperV-NewVirtualServer-23.png
  28. When rebooting, remove the mounted pfSense installation ISO by going to Media, DVD Drive, Eject

    pfSense-Install-on-HyperV-NewVirtualServer-24.png

    If this fails because it's in use, just try again. If it already shows the installation menu again, just remove the mounted ISO and go to Action, Reset to let it boot again without the ISO being mounted.
  29. In case you end up with the mountroot prompt, just use Action, Reset to reboot the image. It should normally boot to the configuration prompt.

    pfSense-Install-on-HyperV-NewVirtualServer-25.png
  30. Once you see the configuration questions, just answer them for your specific installation. You can always change these settings again later, so no worries if you don't know what to answer now.
    pfSense-Install-on-HyperV-NewVirtualServer-26.png
  31. Once you've gone through the setup questions, it will start up pfSense and eventually show you the pfSense menu.

    pfSense-Install-on-HyperV-NewVirtualServer-27.png
  32. A known issue with running pfSense (or any Linux distro for that matter) on Hyper-V is that the network adapters will not allow any traffic to go though by default after booting. This can easily be fixed by disabling and enabling the network adapters. Doing this once will get the network traffic going again. Since you would have to do this each time you boot the machine, we create a script so it will be done automatically for us.

    Press 8 in the pfSense menu to go to the shell

    pfSense-runonhyperv-ifconfigscript-shell.png
  33. Run the following command:

    vi /usr/local/etc/rc.d/interfaces.sh

    pfSense-runonhyperv-ifconfigscript-vi.png
  34. Press INSERT and start typing the following (watch out for typos as these are difficult to correct in VI):

    ifconfig de0 down
    ifconfig de0 up
    ifconfig de1 down
    ifconfig de1 up
    dhclient de0

    When done, press INSERT and type:

    :wq

    Followed by pressing ENTER

    pfSense-runonhyperv-ifconfigscript-vi-wq.png
  35. Back on the console prompt type:

    chmod +x /usr/local/etc/rc.d/interfaces.sh

    Followed by pressing ENTER. This will allow the script to run.

    pfSense-runonhyperv-ifconfigscript-chmod.png
  36. To run the script manually for the first time so your network interfaces will be enabled, type:

    /usr/local/etc/rc.d/interfaces.sh

    pfSense-runonhyperv-ifconfigscript-run.png

    Your network interfaces should now be up and running. Type exit to return from the console to the pfSense menu. Next time you reboot, the script will be executed automatically during the boot process so there are no manual steps involved anymore in getting the pfSense instance going.
  37. You can now start configuring your pfSense installation by browsing to the default IP address of the pfSense box being 192.168.1.1 or restore a config file from another pfSense installation to configure it as a whole at once.