Networking with CentOS 6 and Microsoft Hyper-V

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:

  1. Open Hyper-V Manager: Click Start, point to Administrative Tools, and then click Hyper-V Manager.
  2. Create a new virtual machine where you will install Linux: In the Actions menu, click New, and then click Virtual Machine.
  3.  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
  1. Right-click the virtual machine that you created, and then click Settings. Select Legacy Network Adapter and click Add.
  2. Configure the new Legacy Network Adapter with a static MAC address. Click OK.
  3. Turn on the virtual machine: Right-click the virtual machine that you created, and then click Connect.
  4. Begin installing Linux.
  5. 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.

  1. Log on to the virtual machine.
  2. 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.
  3. As the root user, mount the CD in the virtual machine by issuing the following command at a shell prompt:

# mount /dev/cdrom /media

  1. 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

  1. Shutdown your virtual machine.
  2. Right-click your virtual machine and then click Settings. Select the Network Adapter.
  3. Make sure the Network that is selected is your External Network.
  4. Change the MAC Address to match the one on your Legacy Network Adapter.
  5. Select the Legacy Network Adapter and click Remove.
  6. Turn on the virtual machine: Right-click the virtual machine and then click Connect.
  7. Log on to the virtual machine.
  8. Change the network config scripts for eth0.

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

NM_CONTROLLED=”no”
ONBOOT=”yes”
BOOTPROTO=”dhcp”

  1. Enable the eth0 interface.

# ifup eth0

  1. 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.
Posted in Ramblings.