In order to get networking working properly with CentOS 6 on Hyper-V, use the following steps.
On the host, download Linux Integration Services Version v3.2 for Hyper-V
To install Linux Integration Services Version 3.2:
- Open Hyper-V Manager: Click Start, point to Administrative Tools, and then click Hyper-V Manager.
- Create a new virtual machine where you will install Linux: In the Actions menu, click New, and then click Virtual Machine.
- Specify the Linux installation media: Right-click the virtual machine that you created, and then click Settings. In IDE Controller, specify one of the following:
- An image file in ISO format that contains the files required for installation
- A physical CD/DVD drive that contains the installation media
- Right-click the virtual machine that you created, and then click Settings. Select Legacy Network Adapter and click Add.
- Configure the new Legacy Network Adapter with a static MAC address. Click OK.
- Turn on the virtual machine: Right-click the virtual machine that you created, and then click Connect.
- Begin installing Linux.
- When prompted, restart the virtual machine and complete any first-boot configuration tasks.
Note
Unless a legacy network adapter was added during the virtual machine’s initial configuration, the virtual machine will not have any network support.
- Log on to the virtual machine.
- In Hyper-V Manager, configure LinuxIC v32.ISO (located in the directory where you extracted the downloaded files) as a physical CD/DVD drive on the virtual machine.
- As the root user, mount the CD in the virtual machine by issuing the following command at a shell prompt:
# mount /dev/cdrom /media
- As the root user, run the following command to install the synthetic drivers. A reboot is required after installation.
# cd /media
# /media/install.sh
# reboot
- Shutdown your virtual machine.
- Right-click your virtual machine and then click Settings. Select the Network Adapter.
- Make sure the Network that is selected is your External Network.
- Change the MAC Address to match the one on your Legacy Network Adapter.
- Select the Legacy Network Adapter and click Remove.
- Turn on the virtual machine: Right-click the virtual machine and then click Connect.
- Log on to the virtual machine.
- Change the network config scripts for eth0.
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
NM_CONTROLLED=”no”
ONBOOT=”yes”
BOOTPROTO=”dhcp”
- Enable the eth0 interface.
# ifup eth0
- Verify your settings by pinging Google.
# ping 8.8.8.8
The above instructions are based on the ones provided with the Linux Integration Services Version 3.2, but with updates and changes I have found were needed in order to get networking functioning.