OPNsense Forum

Archive => 18.7 Legacy Series => Topic started by: seware on January 15, 2019, 11:00:10 pm

Title: 18.7 on HyperV Gen2 Success!
Post by: seware on January 15, 2019, 11:00:10 pm
Wanted to take a moment to share some of my trials with 18.7, UEFI and HyperV Gen2; especially how I got it to work...

My setup: PowerEdge R710 running Hyper V Core 2016. 1 NIC sits on the WAN and 1 sits on the LAN. My plan was to setup an external Vswitch for each NIC and do my routing and VPN through an OpnSense guest.

Initially, I could never install OpnSense on a Gen2 VM. It would hang in various places and no amount of font resizing or console mode changes, helped. :( So I installed on a Gen1 and it went without a hitch. This was my first time with OpnSense and my first time with HyperV so I was very happy with this initial success. :)

I realized the other day when I was attempting to add some storage that my bios was set to bios mode and not to UEFI. That will not do as every homelab needs > 2TB. :o So I exported the VM and reinstalled HyperV on the host in UEFI mode. (by the way, MBR2GPT doesn't work on poweredge servers... due to raid???) This part went without a hitch.

I then restored my OpnSense VM to the fresh host and fired it up expecting it to work immediately. Ummm. not so much. The Vswitches were built the same, everything else was configured the same, but OpnSense could not see the WAN. It saw the VNIC interfaces; hn0 and hn1 were present but no WAN connection. :'( Screwed with it for >12 hours until I finally hit upon something. On a desperate whim, I set my VNIC MAC to static and copied in the MAC of the physical NIC; it magically started working. ???

Finding #1: At least on my PowerEdge in UEFI mode, dynamic MACs and arbitrary static MACs won't work on the WAN side. (I hope someone can explain this) (Recall this worked in MBR\BIOS mode... just not UEFI)

So now I have my Gen1 VM working again. Great. Kids are happy that Netflix and PS4 are working. ::) Feeling like the hero, I decided to see if this would help with the similar issues I've read about on the Gen2.  So I created a Gen2 VM and booted from the installer CD using the same MAC clone workaround. Immediately got a WAN and LAN response. YEA!   But when I tried to install I hit the same freezeup at the "guided install". So, after a few trials, I booted again from the CD, but once it reached the login, I closed the console and opened up SSH. I performed the rest of the install from SSH without a hitch. Following the standard post-install reboot I had a Gen2 VM working. I pulled my config over from the Gen1 and now the Gen2 is up and running with all my setup. ;D

Finding #2: Don't try to complete the install from the console on a Gen2 VM in HyperV (Neither EFI nor VGA modes worked for me). Run the first phase (up to the initial login) on the console and then complete it over SSH.

My configuration:

Sorry for the saga... too many reboots and not enough sleep. 8)

Hope this helps someone and I really hope someone can explain any of it.
 

 
Title: Re: 18.7 on HyperV Gen2 Success!
Post by: bimmerdriver on January 16, 2019, 05:20:02 am
I'm running Windows 2012R2 Hyper-V and I have OPNsense 18.7 running, as well as 19.1b, in generation 2 VMs.

My hardware is Xeon X5504. There are two Intel NICs, one for the WAN and one for the LAN. Both are connected to virtual switches.

To create the VM, I use almost all default settings. Secure boot is disabled. Both NICs are dynamic. They get set when the the system is started. I could change them to static afterwards, but they don't change, so I leave them alone. I create one hard drive and a DVD with the ISO mounted.

I boot off the ISO, then when the login prompt appears, I log in as installer and go through the setup.

I've never touched the integration services.

That's it.
Title: Re: 18.7 on HyperV Gen2 Success!
Post by: seware on January 16, 2019, 08:37:23 pm
@bimmerdriver

Be thankful yours worked so easily!

I wonder if its hardware, host OS or something different that has caused issues for myself and others.

I have E5620s  ,Broadcom(Qlogic) NICS and am on HyperV 2016 Core.

I'm not certain that disabling integration services had anything to do with success. I may test more on that later, but after many frustrating hours of no WAN connection, I reverted to as simple as a setup as possible to get my Gen1 VM to work. Then I just repeated that on the Gen 2 VM.

Now that I have a setup that is working again, I would like to try to install with integration service and SRVIO.

Still wondering why I had to clone the WAN-side physical NIC MAC after the host rebuild (UEFI\GPT) when it didn't need it previously (BIOS\MBR). I reset my cable modem several times and tried forcing a lease renewal on the physical NIC during the whole ordeal so I'm pretty sure it wasn't a lease issue.

Dunno... hopefully someone cannot benefit from my struggles.
Title: Re: 18.7 on HyperV Gen2 Success!
Post by: bimmerdriver on January 17, 2019, 07:24:08 am
Are you trying to connect opnsense directly to the NICs or to virtual switches? If it's the former, that might explain what you are seeing. I don't think SRVIO works with freebsd.