The following tutorial provides a road map to install and configure Red Hat Enterprise Linux 6.1 in Microsoft 2008 R2 Hyper-V. This tutorial assumes you have an understanding of Hyper-V and Red Hat operating systems.
Create Virtual Machine in Microsoft Hyper-V
- Select your Virtual Host. Right click it then click New then Virtual Machine….
- Click Next at the Before you Begin (if you haven’t disabled this screen).
- Create a Name for your RHEL virtual machine and choose a location to store it.
- Select the memory allocation.
- Select a network connection that provides access to the Internet. Note that the Network Adapter will not work until after the Linux Integration Components are installed. As mentioned shortly you will get network access through the Legacy Network Adapter.
- Name the VHD file, confirm the location, and size.
- Select install an operating system from a boot CD/DVD and choose image file. (assuming install from ISO)
- Finish
- Upon virtual machine completion and before powering on the virtual machine to begin the install go into the virtual machine settings and select “Add Hardware” then select “Legacy Network Adapter”. Make sure to choose your connected network that has Internet access. You will need this for Red Hat Network (RHN) registration and yum updates should you decide to update your system. This can be removed later after you confirm your Network Adapter is working.
Red Hat Enterprise Linux 6.1 Installation
- Connect to the console of the virtual machine you just created then power it on.
- Press Enter to select “Install or upgrade an existing system”.
- Choose whether or not you want to perform a media check. It’s always best to test to ensure your ISO or media source isn’t corrupt. I didn’t look into this at all but sometimes after the media check is performed you have to restart the install process. Seemed the restart was quicker than investigating why.
- At the Splash screen for RHEL press Enter for “Next”.
- Select your Language then press Enter for “Next”.
- Select your keyboard then press Enter for “Next”.
- Select the Basic Storage Devices then press Enter for “Next”.
- When you receive the Storage Device Warning select “Yes, Discard any data” then press Enter. This assumes a new virtual machine with no data on it.
- Assign a host name to this RHEL server. At this screen make sure to select “Configure Network” since the Legacy Network Adapter will be used for network access. Select “Edit” to modify System eth0. Ensure the connection is enabled so it’s active at boot. Do this by selecting “Connect Automatically”. By default IPv4 DHCP is enabled. Apply your changes, select “Close”, then press Enter to proceed.
- Select the time zone then press Enter for “Next”.
- Set the root password then press Enter for “Next”.
- Select “Use All Space” then press Enter for “Next”.
- Select Write changes to disk.
- Choose Basic Server installation then tab down to “Customize Now”. We will want to customize the software installed. Press Enter for “Next”.
- Select Desktops in the left pane. Then in the right pane select Desktop and Graphical Administration Tools.
- Reboot at the end of installation.
Post Installation Tasks
- At bootup you’ll be prompted with a series of tools you can execute to simplify post-installation settings. Select RHN Register. Registering your RHEL server will allow you to get critical updates, etc. Select Next. Enter your RHN credentials then Next. At system profile if everything looks good then Next. Next at Packages. Next to Send Profile. At Revew system select OK then Finish.
- Select Quit at the Tools menu.
- After a few moments you will find yourself at the RHEL login.
Installing Linux Integration Components v3.1
- Now it’s time to install the Linux Integrated Components from Microsoft. You can download them here http://www.microsoft.com/download/en/details.aspx?id=26837. You will need version 3.1 since previous versions will not work with the kernel in RHEL 6. Download this to a location you can access in the next step.
- From your RHEL virtual machine console in Hyper-V select File then Settings. Select the DVD Drive under IDE Controller 1 then select the “Linux IC v3.0.iso” file you just downloaded. Click OK.
- Run the following commands from the RHEL command line now that the ISO is mounted in Hyper-V:
- mount /dev/cdrom /media
For 64-bit version of RHEL run these two commands
rpm –ivh /media/x86_64/kmod-microsoft-hyper-v-rhel6-60.1.x86_64.rpm
rpm –ivh /media/x86_64/microsoft-hyper-v-rhel6-60.1.x86_64.rpm
reboot
For 32-bit versions of RHEL run these two commands
rpm –ivh /media/x86/kmod-microsoft-hyper-v-rhel6-60.1.i686.rpm
rpm –ivh /media/x86/microsoft-hyper-v-rhel6-60.1.i686.rpm
reboot
Special Notes
You may notice that you can no longer mount a cdrom after running the RPM installs. There’s some fine text in the Linux Integration Services v3 Read Me.pdf file that can be downloaded here – http://www.microsoft.com/download/en/details.aspx?id=26837
To mount an ISO file in the virtual machine, the following command must be run before executing the mount command:
# insmod /lib/modules/$(uname -r)/kernel/drivers/ata/ata_piix.ko
Alternatively, copy the ISO file into the virtual machine and mount it using the -o loop option.