Connecting Hyper-V virtual machine to internet

I have a Windows 2008R2 running Hyper-V. I have created a Windows Server 2012 Essentials virtual machine on my host.
My host has two physical NIC cards. A Intel 1000/100 and a Broadcom On-Board card. The host machine is a small Dell PowerEdge T100.

After I created the virtual machine, I created a virtual switch and set it to External mode. I am connected to the Internet on the host machine however I cannot connect to the Internet on the virtual machine. If I set the NIC on the virtual machine on DHCP I cannot get an IP. If I set it to static, I cannot ping or connect to the firewall.

I am sure my issues something to do with the virtual switch but I have never configured one before. This is my first attempt at Hyper-V. What are the steps to setting up a virtual switch?
Thomas AnthonySecurity AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Which network adapter are you going to dedicate to the virtual machine?  In a typical Hyper-V setup, one network adapter is reserved for the host, and the other is for the virtual machines.

So let's say that you are going to use the Intel as the virtual machine network card.  In the Virtual Switch Manager where you created the external switch, under External Network, choose the Intel network card, and then uncheck the box that says Allow management operating system to share this network adapter.

Virtual Switch Manager
This will separate the network cards properly.  Also, is your Hyper-V host providing the DHCP or is your router doing that?  You might also check to see that your DHCP server has IPs available and that the scope is not full.
Thomas AnthonySecurity AdministratorAuthor Commented:
Thanks for the quick reply. I noticed that you have an "internal" switch as well. Do I need both?
Nope, that Internal switch was for testing and is currently unused.  All my virtual machines are on the external network (HYPERTEAM).  In my setup, I teamed 3 network cards together and the 4th was dedicated for the host.  That's why my screenshot shows multiplexor as the network card.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Thomas AnthonySecurity AdministratorAuthor Commented:
I have set the switch as you have suggested. Could there be something else I am missing? It all sounds pretty cut and dried but still no joy.
Strange, ok what is providing DHCP on your network?
Thomas AnthonySecurity AdministratorAuthor Commented:
Netgear Prosafe firewall but I also tried hard coding it and I couldn't ping my firewall or the host.
Ok check the hardware, is there any link activity on the adapter you chose for the virtual machines?  Is there a link light active on the Netgear where the adapter is plugged in?

Which adapter did you choose for the virtual machine?  Intel or Broadcom?
Thomas AnthonySecurity AdministratorAuthor Commented:
Yes because I have internet on the host machine but not on the virtual
Ok lets try this, go back into the Virtual switch manager and check the box for "Allow management operating system to share this adapter".  This will show both network adapters under Network Properties.

Next on the host, unplug the Intel adapter from the netgear.  Then go to command prompt and do ipconfig /renew
Does the Broadcom get an IP address?

If so, then, then unplug the Broadcom and plug in the Intel.  Do ipconfig /renew again.  Does the Intel get an IP address?
Thomas AnthonySecurity AdministratorAuthor Commented:
When I do the ip confit /renew with the Intel unplugged, I get an error saying the operation cannot be performed while the media is disconnected.

With the Broadcom disconnected, the Intel gets an ip.

One thing to note is that the Broadcom properties only has Hyper-V Extensible Virtual Switch checked. Is this normal?
Ok thanks for checking.  It would only show the Hyper-V virtual switch if it the virtual switch properties still had the box uncheck to allow the host OS to share the adapter.  Did you check that box in virtual switch manager?

It may also require a reboot to allow that to happen.
Thomas AnthonySecurity AdministratorAuthor Commented:
I did not check the box. I redid the test and I get an ip each time on each nic of the host. Still no ip on the virtual machine.
You have to check the box in order for the Broadcom to get an IP under the host.  Or are you saying both adapters got an IP now whereas before the Broadcom did not?
Thomas AnthonySecurity AdministratorAuthor Commented:
I did not check the box before. It is checked now. Both adapters get ip addresses when I do the test as you requested but I still don't get internet access on the virtual machine.
BTW, thanks so much for all of your help.
certainly.  this is quite odd.  Alright lets try with only the intel adapter then.  In virtual switch manager, Leave the box checked for sharing with the OS.  but choose the Intel adapter from the list.   And leave the Broadcom unplugged. Make sure the Intel still has an IP.

This way the host and virtual are using the same adapter.  Now reboot the virtual machine (server 2012) and see if it picks up an IP.

Also, I think the network card needs to be set as static on the host (server 2008) instead of DHCP.
Another thought occurs, Server 2012 might not require it but does it have the integration components installed?  Are you able to move the mouse into the vm console and outside of it seamlessly?

Does the Hyper-V manager indicate for server2012 that the Integration Services are up to date?

integration services
Well scratch my last post, looks like Hyper-V 2008 doesn't show the integration service status like 2012 does.  So in server 2012 console if you go to Action > Insert Integration Service setup disk, does it install?
Thomas AnthonySecurity AdministratorAuthor Commented:
It is looking for media in the DVD drive if I do that.
Yep it is supposed to do that, as it loads the integration services ISO for the DVD drive.  Was Server 2012 setup with an ISO or did you use a physical DVD?  Does the DVD drive show up under Computer on server 2012?  (Start screen > All apps > This PC)

In server 2012, can you go to Device Manager (Start screen, type Device Manager) and then look under Network adapters, does it specifically say:  Microsoft Hyper-V Network Adapter?
Thomas AnthonySecurity AdministratorAuthor Commented:
The server was setup via an ISO.
The DVD drive does show up under device manager. and it does say Microsoft Hyper-V Network Adapter.
When I double click on the DVD drive, it says I have the latest version of integrated services.
Thomas AnthonySecurity AdministratorAuthor Commented:
What is best practices? Should I have setup my virtual switch before the virtual machine?
Thomas AnthonySecurity AdministratorAuthor Commented:
Another question. I don't have a virtual network. Should I have created a virtual network THEN create a virtual switch?
Ok thanks for checking.  So we can confirm the synthetic network driver is installed.  I don't think the order matters on if a virtual switch is made before virtual machine.  A virtual network is not needed for the setup.  I'm not using one.  I just have the virtual switch hooked external the adapter set to not be shared with host.  And it just worked.

It sounds like we have gone through all the troubleshooting steps I am aware of.  You might choose request attention on this question to call in more experts.  Sorry I could not be of more help.
Thomas AnthonySecurity AdministratorAuthor Commented:
I appreciate all of your hard work.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
A default switch is usually created by default ?

Can you upload a screenshot of you virtual switch properties ?
Thomas AnthonySecurity AdministratorAuthor Commented:
Virtual Switch
Thomas AnthonySecurity AdministratorAuthor Commented:
I actually think I got it working by switching the nic card. Don't know why I saw it before but had the Broadcom instead of the Intel checked.
Thanks for all of your help!!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I did wonder if you had the wrong nic selected, hence my reason to ask for a screenshot!

Glad you fixed it!
Thomas AnthonySecurity AdministratorAuthor Commented:
Thank you so much. Every expert I have encountered has been a God-send!
Second here, glad you got it fixed and thanks for the points!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.