3

I have successfully installed centos on a virtual machine via Hyper-V on Windows Server 2008 R2. This server has one NIC.

I have created a virtual NIC, and virtual subnet, and within the virtual machine (via console) I can ping the gateway. But not google. Is there certain steps I am missing, I feel like I'm one setting away.

Im not sure what other information would be useful.

Here is the ipconfig of the host:

Ethernet adapter vNIC losangeles1_1:

Connection-specific DNS Suffix .. :
IPv4 Address. . . . . . . . . . . : 10.10.0.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :


Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix .. :
IPv4 Address. . . . . . . . . . . : 72.51.43.43
Subnet Mask . . . . . . . . . . . : 255.255.255.192
Default Gateway . . . . . . . . . : 72.51.43.1 

Here is the Virtual Network Manager of the host:

enter image description here

Cameron Aziz
  • 275
  • 1
  • 4
  • 13

2 Answers2

4

When you created your virtual network, you probably chose an 'Internal' type. This does not allow traffic out of the machine (unless you monkey around installing a loopback adapter on your host and route the traffic through that).

You need to create an External virtual network.

Chris McKeown
  • 7,168
  • 1
  • 18
  • 26
  • can an internal be changed, or do I have to delete and start over? – Cameron Aziz Jul 04 '12 at 21:28
  • Just create a new External network, and change the VM's NIC to use that network. You don't even need to reboot the VM. EDIT: And most importantly, make sure you enable the network to be shared by the Host otherwise you'll cut your host machine off the network if it only has a single NIC! – Chris McKeown Jul 04 '12 at 21:32
  • just to make sure I don't make a mistake, mind stating how to "enable the network to be shared by the host" Thanks so far! – Cameron Aziz Jul 04 '12 at 22:28
  • It's the "Allow management operating system to share this network adapter" option. That needs to be enabled. – Chris McKeown Jul 04 '12 at 22:39
  • @CameronAziz Change the network type in the HV manager: Virtual Network Manager, select the existing network and change on RHS. *And* ensure you allow the "management operating system" to share the NIC. – Richard Jul 05 '12 at 07:00
  • I cant seem to find this option, I have attached my virtual network manager. I might have to do the "monkey around installing a loopback adapter" – Cameron Aziz Jul 06 '12 at 09:14
  • You're not running 2008 R2 then - that option only appears in R2. Creating an external network in Server 2008 will automatically share it with the host OS. – Chris McKeown Jul 06 '12 at 09:31
0

you said you can ping the gateway, is that a router or something on your network? Or do mean the host PC that is running Hyper-V? If you could post the output of an ipconfig /all from your hyper-v host and the output of an ifconfig eth0 from your centos VM that would give us a better insight.

As Chris points out you've most likely chosen the 'internal' connection type option when configuring your virtual NIC.

Go to hyper-V manager, select your host and then on the right side of the screen click 'Virtual Network Manager'. In the window you get now, select you virtual network from the 'virtual networks' list (normally you should only see one in your situation). Now select 'External' under the 'Connection Type' pane, select your physical NIC that you want to use, and make sure you check 'Allow Managerment OS to share this network adapter'

That should do the trick

Alex
  • 261
  • 1
  • 3
  • 8
  • I can ping the gateway, meaning from the virtual, I can ping the virtual nic (10.10.0.1) while the virtual has the ip of 10.10.0.2. – Cameron Aziz Jul 04 '12 at 21:22