Tuesday, April 10, 2012

RHEL/CentOS on Hyper-V 2k8 R2 with LIC v3.2

Microsoft Officially supports RedHat, CentOS and SUSE Linux Distributions as VMs running on Hyper-V. Linux Integration Components (LIC) or Linux Integration Services are the software components released by Microsoft that need to be installed on Linux VMs to take full advantage of Hyper-V features.
 
  • Linux Integration Components are a set of drivers that enable synthetic device support in supported Linux virtual machines running on Microsoft Hyper-V
These components when installed on Linux mainly provide below features
 
1. Drivers : Synthetic network controller (NIC), IDE and SCSI storage controllers support
2. Time sync : Clock inside the virtual machine will be in synch with the clock on the Host
3. Integrated Shutdown : Shut down from either Hyper-V Manager or SCVMM
4. Symmetric Multi-Processing (SMP) Support : Support up to 4 virtual processors Per VM
5. Heartbeat : Allows Host to detect if the virtual machine is running and responsive
6. Integrated Mouse Support : Seamless mouse integration when used with the Linux GUI
 
If Linux IC are not installed one might be presented with one or all of the below errors
 
CEntOS-00
 
CEntOS-01
 
CEntOS-02
 
Note: This post assumes that one has install CentOS/RHEL/Scientific Linux 6.2 on HyperV and has mounted Linux IC v3.2.iso onto DVD Drive of VM. If not please follow link below this post for Picture guide of CentOS server minimal installation
 
The documentation available along with LIC v3.2 looks good, but, unfortunately when trying to install you will get an error similar to the below one
 
ls: cannot access kmod-hyper-v-rhel6-43.1.x86_64.rpm: no such file or directory
ls: cannot access hyper-v-rhel6-43.1.x86_64.rpm: no such file or directory RPM’s are missing
 
There is a simple work around to this by changing the working directory to the mount point of Linux IC drive and invoking ./install.sh script.
 
LIC-Error
 
Below are the commands to run to install Linux IC and reboot, once prompted, as shown in the above screenshot
 
mount /dev/cdrom /media
 
cd /media
 
./install.sh
 
reboot
 
When VM is rebooted you will notice that there is no network connectivity to your VM. Follow steps below for configuring network connectivity
vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
Press i Key on keyboard and type the below lines
DEVICE="eth0"
ONBOOT="yes"
HWADDR=
TYPE=Ethernet
BOOTPROTO=dhcp
NAME="System eth0"
 
HWADDR is the MAC address of the NIC that can be found from settings menu of VM in Hyper-V (Below screenshot for your reference) and DHCP is the mode of getting IP Address
 
CEntOS-27b
 
Now use below Key Combination to save the file and close
Esc
Shift + :
wq
Enter
 
Use the below commands to edit, Save and close one more file
vi /etc/sysconfig/network
 
CEntOS-27c
 
Enter below text, save and close
NETWORKING=yes
 
CEntOS-27d
 
Now Run ifup eth0 and you should be connected to network or else take a reboot.
 
CEntOS-27e
 
With this our CentOS/RHEL/Scientific Linux 6.2 can take full advantage of Hyper-V synthetic drivers and is ready for production :)
 
Useful Links:-

2 comments:

  1. everytime I hit control + esc it takes me out of the centos window and back to hyper-v windows... is there a way around this?

    ReplyDelete
    Replies
    1. @Unknown - Thanks for the comment. It pointed me to the mistake I made. It should be ESC instead of Control + ESC. I have updated the post as well.

      Delete

Share what you feel