Showing posts with label Redhat Linux on Hyper-V. Show all posts
Showing posts with label Redhat Linux on Hyper-V. Show all posts

Friday, August 14, 2009

Installing Redhat Linux 5.3 on Hyper-V with Linux Integration Components v2 RC2

It has been a real busy week with Windows 7 RTM and with Windows 2008 R2 releasing soon, there are so many new features to try out. Well, as work requires, I have the opportunity to try setup Redhat Linux 5.3 on Hyper-V with the new release of Linux Integration Components v2 RC2.

The LinuxICs are available for download on http://connect.microsoft.com. The Linux Integration Components Readme.pdf which is packaged with the LinuxIC download provides are very good detailed explanation of the installation process.

I am doing a full pictorial of a installation of RHEL5.3 onto a Hyper-V server and I got the mouse to work too.

Create the Virtual Machine

First, you need to create a Virtual Machine.

image

Give it 1GB of memory for GUI features.

image

We will need network to work so that we can get yum updates.

image

You configure a hard disk size for your VM.

image

Map the RHEL iso image to DVD drive for installation.

image

And we are just about ready to start. DO NOT start yet, as we need to add a legacy network adaptor at this moment.

image

Add a Legacy Network Adaptor to your Virtual Machine hardware.

image

Connect this Legacy Adaptor to your bridged network that have internet connectivity as we need YUM UPDATE.

image

Now, fire up the machine and start installation.

image

You will need to enter your Installation Number here to be able to get YUM UPDATE.

image

You need to setup networking here.

image

In previous RHEL versions we have to install XEN Virtualization components, with this new LinuxIC and RHEL 5.3, DO NOT choose Virtualization. Now we can use a regular Linux Kernel and not a Xen Kernel. Please select Software Development.

image

Complete the wizard and we are ready to start installation.

image

Reboot once installation completes.

image

Let’s verify the network are ok by issuing “ifconfig eth0”. Check that you have a working IP address.

image

With network connectivity, we should now do a “yum update” to get the latest updates from your linux sources.

image

When you completed the update, reboot the machine by issuing “reboot” command.

image

Once the system boots up, verify that we have the required packages installed by issuing “yum install kernel-devel” and “yum install gcc” command.

image

Now we are ready to install the Linux IC. Insert the LinuxIC iso into the DVD drive and copy the contents to /opt/linuxic directory. You can issue the commands below.

mkdir /mnt/cdrom

mount /dev/cdrom /mnt/cdrom

mkdir /opt/linuxic

cp /mnt/cdrom/* /opt/linuxic/ –R

cd /opt/linuxic

Having copy the content to /opt/linuxic, issue the command “./setup.pl drivers” to install the Linux Integration Components. Please do a reboot once installation completes.

image

Now that we have installed the Linux IC, I suggest we remove the legacy network adaptor and connect virtual network to the default Synthetic Ethernet network adaptor.

image

Let’s verify that the Linux ICs are working by issuing “/sbin/lsmod grep vsc”.

image

Then verify the Synthetic Ethernet adapter is working by issuing “ifconfig seth0”

image

The final step is to get the mouse working. Download the mouse support for Linux under Hyper-V from Citrix Project Satori http://www.xen.org/download/satori.html.

Mount the ISO and copy its contents to /opt/mousedrv.

Do a “yum install xorg-x11-server-sdk” to install xorg-x11-server-sdk package.

Then run “./setup.pl” from /opt/mousedrv/ directory.

image

Here we have it, Redhat Linux 5.3 installed on Hyper-V with Linux Integration Components installed and mouse working too.

Wednesday, October 22, 2008

Hosting Redhat Linux Virtual Machine on Hyper-V

These are the steps to setup a RedHat Linux virtual machine on Hyper-V host.
I get this working with the help from other bloggers and my colleague.
This post is an amended version from another blog.

Pre-requisites
Please note that I am using RHEL 5.2 x86_64 and you must have a valid RHN installation number. The RHEL VM is installed as a 64bit machine and please install all packages, meaning install everything. It is also helpful to have a RHN Account so that you can get yum update from rhn.redhat.com. Note that for that “yum” command to work with RedHat Linux, you must be subscribed to their update service so that you can fetch the package, or else you will have to go and find them on your installation DVD/CDs.
You first need to fetch a copy of the ISO image from the zip of the Linux Integration Components.
You will also have to download the kernel source RPM and copy/ftp it to your RHEL VM. You can get this from ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-92.el5.src.rpm.

Configuring the Virtual Machine
There are steps needed to get this Redhat Linux Virtual Machine working. So please follow this closely. Open Hyper-V Manager and add a Network Adapter, a Legacy Network Adapter and a SCSI Controller with a Hard Drive attached to you RHEL VM. Ensure the Legacy Network Adapter is assigned to the virtual network that contains your physical external network card.

Linux Integration Components RC2
Using the “Media” menu in the Hyper-V “Connect...” window, choose “DVD Drive”, “Insert Disk...” and select the Linux Integration Components ISO image, “LinuxIC-RC2.iso”. Then run
mkdir -p /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp -rp /mnt/cdrom /opt/linux_ic
umount /mnt/cdrom

Building the Kernel
Let's do a update to ensure that we have the required packages installed. (requires your network is working and have a valid RHN account)
yum install redhat-rpm-config gcc rpm-build make gnupg

Go to the directory where you store the kernel source RPM and install the SRPM with the command:
rpm -ivh kernel-2.6.18-92.el5.src.rpm

You need to edit the spec file in /usr/src/redhat/SPECS/kernel-2.6.spec., so make a backup copy of it first for safety.
Before the “%build” line, insert this line:
patch -p1 -d ../linux-%{kversion}.%{_target_cpu} < /opt/linux_ic/patch/x2v-x64-rhel.patch Next find the line that sets “with_headers” and change it to%define with_headers 0 Find the line that defined “%define with_xen” and change it to%define with_xen 1 and the line containing “%define with_xenonly” and changed to%define with_xenonly 1 You can now build the RPM, which will construct the xen one which is what you need. So cd /usr/src/redhat/SPECS rpmbuild -ba kernel-2.6.spec Be warned, this will take *hours* on a on a virtual machine.

Installing the Kernel
cd /usr/src/redhat/RPMS/x86_64
rpm --force -ivh kernel-xen-2*rpm
rpm --force -Uvh kernel-xen-devel-2*rpm

Build the x2v version of the kernel
cd /opt/linux_ic
perl setup.pl x2v /boot/grub/grub.conf

Reboot, and it should boot your newly built kernel with the X2V shims in place.

Building the Hypervisor, Network and Storage Drivers
The next step is to build the drivers. First, link the "build" link in /lib/modules/ directory to make it point into the kernel source that you have been building from.
Note: Please note that in the preceding commands, the quotes are single backquotes, not apostrophes or anything else.
cd /lib/modules/`uname -r`
ln -nsf /usr/src/kernels/`uname -r`-`arch` build

Build the Drivers
cd /opt/linux_ic
Edit setup.pl and look for the string “kernel-devel”. Change that to “kernel-xen-devel” and save the file.
perl setup.pl drivers

Reboot and you should now have the drivers running.

Building the X Mouse Driver
The last step is to build the mouse driver for use by X. This is very simple, you just need to install a couple of extra packages with
yum install xorg-x11-server-sdk xorg-x11-proto-devel
cd /opt/linux_ic
cd drivers/dist
make inputvsc_install

We are done! You now have the Linux IC installed on your Redhat Linux 5.2 vritual machine.