Pawan Sharma | July 18, 2013 | Be the first to comment!

Creating KVM Virtual Machines in RHEL6.

In this post we will discuss about packages required for KVM (Virtualization), creation of KVM virtual machine and managing those virtual machines. KVM can run multiple windows and Linux guest operating system. KVM virtualization is only available for 64 bits machines. You can’t use KVM virtualization on 34 bit architecture machines.

You can install KVM virtualization environment at the time of RHEL6 installation by selecting virtual host packages. Or on currently installed RHEL6 server, you can install packages using yum. For full KVM virtualization host you will require virt-manager, libvirt libvirt-python, python-virtinst, libvirt-client.


# yum install –y virt-manager libvirt libvirt-python python-virtinst libvirt-client

If you don’t have yum server, you can configure it by following easy steps mentioned in this post.

After installing KVM packages you can now create new virtual machines using virt-install command or using virt-manager GUI.

1. Start libvirtd daemon to start KVM virtualization.

# /etc/init.d/libvirtd start
# chkconfig libvirtd on

2. Open Applications --> System Tools --> Virtual Machine Manager. Or run virt-manager command as root user. Click on create new virtual machine button.

 

3. Give name to virtual machine and select installation media option.


4. In this example we have selected ISO image as our installation media.


5. Define RAM and CPU for the KVM virtual machine.


6. Define disk size.


7. Select network options (Bridge or NAT) as per your requirements and click finish.


8. Install RHEL on the created KVM virtual guest.


For RHEL installation steps follow this post.
In next post we will discuss about command line tools for administering KVM virtual machines.
Please comment if you have any questions.

Pawan Sharma | July 9, 2013 | Be the first to comment!

Network Device not working after cloning RHEL6 VM (Device eth0 does not seem to be present, delaying initialization)

In this post I will give solution to one problem I faced while cloning RHEL6 virtual machine.

ISSUE: I have installed RHEL6.2 on KVM/VMware workstation/Oracle VirtualBox. After installation I have cloned the virtual machine. And when starting cloned virtual machine I get below error while restarting the network service.

Device eth0 does not seem to be present, delaying initialization


I have also removed HWADDR entry from “/etc/sysconfig/network-scripts/ifcfg-eth0”, but still I am getting the same error.

SOLUTION: To resolve this problem follow below mentioned steps:

1. As mentioned above, remove HWADDR entry form “/etc/sysconfig/network-scripts/ifcfg-eth0”.

2. Take backup of file “/etc/udev/rules.d/70-persistent-net.rules” and remove all reference to eth0.

Ex.
[root@squid2 ~]# cp /etc/udev/rules.d/70-persistent-net.rules /root/
[root@squid2 ~]# cat /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:08:fa:85", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:b7:08:97", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Entry for PCI device marked with green color is the entry for Ethernet card.

3. Remove the marked entry for both PCI devices from the file “/etc/udev/rules.d/70-persistent-net.rules”.

4. Restart the server.

After restart, you will be able to get IP information for the Ethernet card.

If you have any questions please comment.