'

The fastest CentOS VM Deployment on MS Hyper-V Servers - Pt.3.

June 10th, 2012 by Andrea Matesi 5838 Views

Now it's time to create the Father Virtual Machine, install CentOS-minimal, then install the "Linux Integration Services for Hyper-V" component on it.

First you'll have to create a New Dynamic Virtual Hard Disk Drive (the VHD), then a New Virtual Machine, based on your New Dynamic VHD Drive.

New Father Dynamic VHD.

From the Hyper-V main Window.

"New" -> "Hard Disk..."

Create a new dynamically expanding hdd by clicking on "New" > "Hard Disk..."

 

Choose "Dynamically expanding" vhd.

Select "Dynamically expanding" VHD.

 

Specify New vhd Name and Location.

Specify the New VHD Name and Path.

 

Specify the size of your Virtual Hard Disk Drive.

Specify the size of your Dynamically Expanding Virtual Hard Disk Drive or just leave the default of 127GB as I did. A Dynamically expanding VHD will only use as much space as necessary, by allocating it on an incremental basis.

 

Summary page showing you the details of your chosen options.

This is the summary page, showing you all the details of your chosen options.

After following the previous steps, you'll end up with a very small VHD image, occupying something like ~256K.

 

New Father Virtual Machine.

Now, from the main Hyper-V window, you'll create a new Virtual Machine with the "New Virtual Machine Wizard" and attach the previously created Dynamic VHD to this Father VM.

Click on "New" -> "Virtual Machine..."

Click on "New" -> "Virtual Machine..." and the "New Virtual Machine Wizard" will start.

 

the New Virtual Machine Wizard.

Name your new Virtual Machine (i.e.:CentOS-6.2-dist), and specify where your new Virtual Machine configuration files will be located, then click "Next".

Please note the "VM config files" and the "VHD image" created on the previous section are two separate things.

 

Specify how much RAM to assign to your new vm.

Specify how much memory to assign to your VM (i.e.: <512MB for a text installer or 1024MB for the GUI installer), depending from the memory available on your computer.

 

Select a network adapter on your lan capable of going online (ie.External Virtual Network).

Select a network adapter from your LAN capable to go online (i.e.:your "External Virtual Network" adapter). It is not essential, but it's good to offer internet connectivity to your new VM after CentOS-minimal has been installed.

 

Specify where your vhd image is located.

Pay attention to this particular step: here you'll need to specify where your "VHD image" is located for your VM to use.

 

Specify where your CentOS-minimal ISO image is located.

Here you'll specify where your CentOS-minimal ISO image is located (you downloaded this image at the beginning of the tutorial - i.e.:D:\LINUX\). Then click next, read the Summary page and check if everything it's alright, then click finish to end the "New Virtual Machine Wizard".

 

Install CentOS-minimal to your New Father VM.

It's now time to install CentOS-minimal on your newly-created VM.

Select your newly created Father VM.

On the main Hyper-V window, select the Virtual Machine and Click "Settings..."

Open your VM Settings.

Click "BIOS", verify that "Boot from CD" is selected and/or make sure CD appears as first on "Startup order", then Click Ok.

Back on the Hyper-V main window, select the Father VM, then click "Start..." to boot it.

If the previous settings are correct, the CentOS boot installer will start automatically.

CentOS-minimal installer boot screen.

The CentOS-minimal installer boot screen.

Select "Install or upgrade an existing system" (it's autoselected and if you just wait for 60 secs. it will autostart), then Press Enter and follow the on-screen instructions.

  • Please note that once your mouse cursor is focused inside the CentOS window, you won't be able to interact with the other windows. To regain control of your mouse cursor, press CTRL+ALT+LEFT-ARROW.

 

CentOS-minimal text installer.

If you specified a small amount of RAM during your "New Virtual Machine Configuration Wizard", you may be welcomed by a text installer.

No matter how your installer is, in 2012, the CentOS setup has become a matter of "Next", "Next", "Next", especially so for CentOS-minimal, where the amount of customization is almost non-existent.

During the installation wizard, you'll be asked to choose a password for the root user. Input this password and record it somewhere (don't lose it because you''ll need it later).

 

Feel free to have a break now :)

Make a screenshot of this window or save it, because by following my tutorial you're not gonna see it anymore (or at least for a little while)!

Then Click the "Reboot" button to reboot your New CentOS-minimal VM.

 

Install the Linux Integration Services for Hyper-V.

It's now time to install the Linux Integration Services for Hyper-V on your Father VM.

Once your New VM rebooted, you'll be shown a console with a login prompt.

Now you'll need to go back to your Virtual Machine Settings (even if it is running, don't worry!), then attach the "Linux Integration Services for Hyper-V" ISO Image to your Father VM DVD Drive.

Select your VM from the Hyper-V VMs list.

Select your Father VM.

 

Open your VM Settings.

Click on "Settings..." to open the New VM Settings.

 

DVD Drive Properties Window.

Select your DVD Drive, Click on "Image File" and "Browse..." for your "Linux Integration Services for Hyper-V" ISO image, then Click "Ok" to confirm.

 

At this point, you'll need to "slide your hands into the jam" (I like this Italianism (Italian colloquialism)), by typing some bash commands into your Linux Console Window.

Click inside a black part of your terminal window and let the window get the focus (your cursor will feel as being captured like a fly on a spider web - but don't worry, it's just CentOS!).

Input your CentOS credentials that you specified during the setup process (i.e.: root/p@ssw0rd), to login to your VM.

Once you are logged in, you'll be welcomed by a terminal prompt followed by a blinking cursor.

Input the following commands to install your Linux Integration Services for Hyper-V:

Installing Linux Integration Services for Hyper-V on CentOS.

mount -r /dev/sr0 /media
cd /media
./install.sh

Then read the on-screen instructions and wait...seriously, just be patient :)

Once the Linux Integration Services for Hyper-V are installed, type "reboot" and press ENTER to reboot your VM.

Linux Integration Services for Hyper-V installed successfully, time to reboot!

Once your Father VM reboots, you'll end up with a working system that won't catch your mouse anymore (like a fly on a spider web as before...).

Technically speaking, your new VM is now "enlightened" (sounds too cool, isn't it?), and now the kernel loads a module that, basically, allows it to communicate with the Hyper-V host on a more "intimate way".

[OPTIONAL] Now maybe the perfect timing to configure CentOS Networking, download and install some applications/updates and, if you're a pro, generalize and customize the distribution according to your possible scenarios ;-).

That's it for now, follow me on twitter to receive free notifications about my next articles in the series, where I'll show you how to create the 2nd Child (dependant) VM and finish the series with an article which will show you how to break the father-child relation.

Posted in LINUX, Microsoft, System Administration | 3 Comments »

3 responses to “The fastest CentOS VM Deployment on MS Hyper-V Servers - Pt.3.”

  1. MichaelNo Gravatar says:

    These steps are not working for minimal version 6.3 as I get a failed dependencies error when trying to run the install.sh. I tried both the linux integration version 3.2 and 3.3. 

  2. CinjuNo Gravatar says:

    Michael,
     It may be a late reply. But if this helps you by any chance I will be glad. Microsoft has released Linux Integration service 3.4 (http://www.microsoft.com/en-us/download/details.aspx?id=34603). You can install it without any trouble in CentOS 6.3 using the instructions given in the LIS 3.4 readme.