KVM Install full version rhel6

Source: Internet
Author: User
Tags gpg mkdir iptables
KVM Install full Edition
Host minimizes installation, and installs another managed client
Cpu:
Vendor_id:authenticamd
CPU Family:16
Model:4
Model NAME:AMD Phenom (tm) II X4 965 Processor
Operating system: Linux RHEL6VM 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT x86_64 x86_64-x86_64 Gnu/linux
Prerequisite: CPU Support Virtualization
#cat/proc/cpuinfo | grep (VMX|SMV)


I. Installation of RHEL6
1, the installation process set up a good network card
2, the English minimum installation choose Mini Mode
A quick 2-3 minutes.


Second, set up a good yum for the future installation of software convenience.
#mkdir/MEDIA/YUM1
#cp all the files in the RHEL6 disc into/MEDIA/YUM1
#vi/etc/yum.repos.d/cdrom.repo
[CDROM]

name=red Hat Enterprise Linux Base

Baseurl=file:///media/yum1

Enabled=1

Gpgcheck=1

Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release

#yum Clean All

If there is a problem, mkdir-p/...

Three. Install the software to be used
Installing the KVM Module
#yum Install qemu-kvm.x86_64
Install the KVM Debugging tool (can not be installed)
#yum Install qemu-kvm-tools.x86_64
Install the Python component, which is used primarily to record XML files when you create a VM
#yum Install Python-virtinst.noarch
Install the QEMU component, use the QEMU command to create the disk, start the virtual machine, etc. (this may have been installed qemu-kvm.x86_64)
#yum Install qemu-img.x86_64
Installing Network Support Tools
#yum Install bridge-utils.x86_64
Install Virtual machine management tools, use Virsh to manage virtual machines
#yum Install Libvirt
Reboot
Iv. Check the KVM module for installation complete
#lsmod | grep KVM
Two modules are displayed
Kvm_intel/kvm_amd
Kvm

Check physical host Virtualization completion
#virsh List

Id Name State
----------------------------------

Appear as indicated to have been fitted up

Five. Set the network card Bridge mode

#cd/etc/sysconfig/network-scripts/
#vi Ifcfg-eth0

Add Bridge=br0

CP Ifcfg-eth0 IFCFG-BR0
Change Device=br0
Type=bridge
Also delete the system name uuid and so on
#service Network Restart

#ifconfig

Br0 Link encap:ethernet hwaddr 1C:6F:650:CC:AF
inet addr:58.211.112.15 bcast:58.255.255.255 mask:255.255.255.240
Inet6 ADDR:FE80::6881:D3FF:FE70:3101/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:3525519 errors:0 dropped:0 overruns:0 frame:0
TX packets:1875715 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4633406660 (4.3 GiB) TX bytes:222071251 (211.7 MiB)

Eth0 Link encap:ethernet hwaddr 1C:6F:650:CC:AF
Inet6 ADDR:FE80::1E6F:65FF:FED0:CCAF/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:3527263 errors:0 dropped:0 overruns:0 frame:0
TX packets:1876659 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4682951686 (4.3 GiB) TX bytes:222162510 (211.8 MiB)
Interrupt:25 Base address:0x4000

Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0

The above indicates that the installation has been completed normally

Six, you can use Virt-install to create a new virtual machine, but after the start of no way to see
So to install the client to manage, you can also use Virsh to manage, but also add VNC to connect the virtual machine
Installing VNC
#yum Install tigervnc-server.x86_64

Change firewall
I'm going to change iptables.
#vi/etc/sysconfig/iptables
Add a sentence
-A input-m state--state new-m tcp-p TCP--dport 6900-j ACCEPT
#service iptables Restart

You can start a new virtual machine
#virt-install--name vmxp1--ram 1024--vcpus=1--disk path=/home/kvm/img/xp1.img,size=20--network bridge=br0-- Os-variant=winxp--cdrom/home/kvm/soft/xp.iso--vnclisten=58.211.162.45--vncport=6900--vnc

Connect with remote VNC


If you do not use graphics management software, Virsh can be used to manage, to this.
With orders
Virsh List of common commands
Help displays a description of the command
Quit End Virsh, back to Shell
Connect to the specified virtual machine server
Create to start a new virtual machine
Destroy Delete a virtual machine

Start to open (defined) virtual machines that are not started

Define defines a virtual machine from XML

Undefine a virtual machine that is not defined

Dumpxml the set value of the dump virtual machine

List List virtual machines

Reboot restart the virtual machine

Save Storage Virtual Machine status

Restore revert to virtual machine status

Suspend pause the execution of a virtual machine

Resume continue to execute the virtual machine

Dump dumps the kernel of the virtual machine to the specified file for parsing and scheduling errors

Shutdown shut down the virtual machine

Setmem Modify the size of the memory

Setmaxmem set the maximum memory value

Setvcpus Modify the number of virtual processors


Vii. Install client management software
I am using XP under the VMware Workstation7.0 install RHEL6 to do management
Select Chinese directly when installing---desktop is well installed
Add local yum as on the host
Installation
#yum Install Virt-manager
Open Virtual System Manager after reboot-and automatically install something, just fine.

File---Add Connection Plus host IP



Already installed 2008

Remote Connection 2008

See Host performance


It's all in the whole thing.
All of the above operations are referred to the information on the Internet,
This is also in the past half a month has been doing XEN,ESX,ESXI4.1,KVM aspects of learning
Finally summed up the more successful method, is to share with you. Also make a reference for yourself.
Because it is done before writing, so there may be a little problem. Find it in the change.
cryboy2001 2011.5.11
(165.32 KB, download times: 83)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.