Microsoft has put a lot of work into Linux support over the last few years, including in the Hyper-V product. Linux support is key to Hyper-V becoming the de-facto hypervisor at companies that have a mixed Windows and Linux environment, so Microsoft has gone so far as to create Linux drivers for Hyper-V and contribute to the development of the Linux kernel. Here is a short list of the major distributions that the Hyper-V integration tools officially support:
- CentOS 5.5-5.8
- CentOS 6.0-6.3
- Red Hat Enterprise Linux 5.5-5.8
- Red Hat Enterprise Linux 6.0-6.3
- SUSE Linux Enterprise Server 11 SP1 or SP2
- SUSE Linux Enterprise Server 10 SP4
For this example we'll be using Red Hat 6.3, which is among the more common distributions you might find in the enterprise. The following should also work for CentOS, which is largely a free version of Red Hat, and SUSE due to the fact that all three distributions can use RPM files for installations.
There are a few integration features that Linux gains after you install the integration services beyond driver support, including time synchronization with the Hyper-V host, support for the shut down command from the Hyper-V and SCVMM consoles, heartbeat with the host, Live Migration, and my favorite, mouse support from the Hyper-V console. Clearly the integration tools are a critical part of having a good experience with Linux running on Hyper-V.
The first thing you should do is obviously create your VM. When Hyper-V creates a new VM it typically gives that VM a Network Adapter. Out of the box Linux doesn't play nice with the regular network adapter, so your VM is not going to have a network connection. If your VM needs a network connection before you will have a chance to install the integration components you need to remove the Network Adapter and add a Legacy Network Adapter. The Legacy Network Adapter has some limitations, but Linux will work with it out of the box.
After configuring your hardware start up your VM and install Linux. If you installed the Legacy Network Adapter and need a network connection then you should refer to the Red hat documentation on how to modify network configuration files (https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-networkscripts-interfaces.html
Download the Linux Integration Components .iso from Microsoft (http://www.microsoft.com/en-us/download/details.aspx?id=34603
). The normal integration .iso that is inserted from the Virtual Machine Connection window will not work, so you need to download this .iso that is designed specifically for Linux. Store it on your Hyper-V host or in your SCVMM library if you are using SCVMM to manage your VMs. Insert your disk into the virtual DVD drive.
Log into your Linux server. In this case I'm going to log in as root to keep things simple, but its always recommended that you log in as a standard user and just elevate command permissions as needed. All of the following commands should be run with root permissions.
- mkdir -p /mnt/cdrom
- mount /dev/cdrom /mnt/cdrom
- cd /mnt/cdrom/RHEL63
At this point the installation will begin. The whole process will look something like this:
Once the installation is complete it will look like the picture below. Restart your server and you are finished.
At this point you can shut down the VM and remove any Legacy Network Adapters you might have since the regular Hyper-V Network Adapters will work. You may need to do some configuration of the Linux network configuration files, so check the Red Hat documentation if necessary. If you install a GUI on the Linux server then mouse integration will work as well.