This article is first published in the dark world.
In the previous article, I introduced the installation and configuration of KVM. Next, we will introduce how to install centos in KVM.
Note that the centos image file uses: CentOS-6.5-x86_64-minimal.iso
Installing the operating system in KVM is generally divided into three steps:
Use the qemu-IMG command to create the hard disk required by the VM.
Start the VM and run the virt-install command.
Install the system as usual
To create a hard disk, run the following command:
Qemu-IMG create-F qcow2/vhost/ilanni01.img 4G
650) This. width = 650; "Title =" clip_image001 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image001 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272185QIqO.png "width =" 761 "Height =" 252 "/>
After the hard disk is created, run the following command to install the virtual machine:
Virt-install -- name ilanni01-r 2048 -- vcpus = 1 -- OS-type = Linux -- accelerate-C/ISO/CentOS-6.5-x86_64-minimal.iso -- Disk Path =/vhost/ilanni01.img, size = 4, format = qcow2, bus = virtio -- Bridge = br0, model = virtio -- VNC -- vncport = 5991 -- vnclisten = 0.0.0.0 -- force-autostart
-- Name: Virtual Machine name
-R memory allocated to the Virtual Machine
-- Number of CPUs allocated to virtual machines by vcpus
-- OS-type: OS type of the VM
-- Vncport: Specifies the VNC port number to connect to the virtual machine.
You can use virt-install-help to view other options.
650) This. width = 650; "Title =" clip_image002 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image002 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272186IO8C.png "width =" 992 "Height =" 175 "/>
Now, connect the VNC client to the virtual machine as follows:
192.168.1.240: 5991
650) This. width = 650; "Title =" clip_image003 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image003 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272186J79f.png "width =" 476 "Height =" 157 "/>
Now, start VNC to install the centos system, for example:
650) This. width = 650; "Title =" clip_image004 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image004 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272188kiIb.png "width =" 662 "Height =" 549 "/>
Select the first option to start system installation.
Note: If you want to enter the character interface, install centos. At this time, you can press the "ESC" key on the disk, for example, enter Linux text. Enter the character installation page.
Also, it has been verified multiple times. In versions earlier than centos 5, including centos 5, you can manually partition centos 5 on the Character interface. However, after centos6, you cannot manually partition on the Character interface. You can only manually partition on the graphic interface.
If the VM memory is smaller than MB, the character interface is automatically displayed during installation. If the value is greater than MB, the system automatically enters the graphic interface.
650) This. width = 650; "Title =" clip_image005 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image005 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272188lWoz.png "width =" 740 "Height =" 467 "/>
650) This. width = 650; "Title =" clip_image006 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image006 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272189NdEO.png "width =" 741 "Height =" 459 "/>
If the image file is not detected, go to the installation page.
650) This. width = 650; "Title =" clip_image007 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image007 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272190FFVe.png "width =" 1044 "Height =" 833 "/>
Start installation and next step.
650) This. width = 650; "Title =" clip_image008 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image008 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272191USL3.png "width =" 1039 "Height =" 832 "/>
We strongly recommend that you select English in this language.
650) This. width = 650; "Title =" clip_image009 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image009 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272192muHX.png "width =" 1035 "Height =" 828 "/>
Select American standard keyboard for keyboard format
650) This. width = 650; "Title =" clip_image010 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image010 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272192dHAQ.png "width =" 1040 "Height =" 823 "/>
Select basic storage
650) This. width = 650; "Title =" clip_image011 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image011 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272193CWID.png "width =" 836 "Height =" 487 "/>
Select allow
650) This. width = 650; "Title =" clip_image012 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image012 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272193pn4i.png "width =" 1037 "Height =" 777 "/>
Enter the host name.
650) This. width = 650; "Title =" clip_image013 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image013 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272194Q8GQ.png "width =" 1040 "Height =" 834 "/>
Select time zone
650) This. width = 650; "Title =" clip_image014 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image014 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272195cdj4.png "width =" 1041 "Height =" 835 "/>
Set the root user password
650) This. width = 650; "Title =" clip_image015 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image015 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272196jtCB.png "width =" 1034 "Height =" 830 "/>
Select Custom Partition
650) This. width = 650; "Title =" clip_image016 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image016 "src =" http://img1.51cto.com/attachment/201407/25/526870_14062721973k0l.png "width =" 1030 "Height =" 783 "/>
We can see that the entire hard disk is not partitioned yet.
650) This. width = 650; "Title =" clip_image017 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image017 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272197VmpY.png "width =" 449 "Height =" 502 "/>
Start creating a new partition, and select a standard partition here.
650) This. width = 650; "Title =" clip_image018 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image018 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272198OJAs.png "width =" 516 "Height =" 477 "/>
Partition/boot first
650) This. width = 650; "Title =" clip_image019 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image019 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272198tbJE.png "width =" 766 "Height =" 627 "/>
650) This. width = 650; "Title =" clip_image020 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image020 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272199kYWk.png "width =" 1041 "Height =" 790 "/>
Partition according to the above, and the result is as above.
650) This. width = 650; "Title =" clip_image021 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image021 "src =" http://img1.51cto.com/attachment/201407/25/526870_14062721991O4O.png "width =" 501 "Height =" 359 "/>
Format partitions
650) This. width = 650; "Title =" clip_image022 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image022 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272200A7dE.png "width =" 448 "Height =" 218 "/>
Save partition information to Hard Disk
650) This. width = 650; "Title =" clip_image023 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image023 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272200P9nT.png "width =" 1027 "Height =" 802 "/>
Install system boot Information
650) This. width = 650; "Title =" clip_image024 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image024 "src =" http://img1.51cto.com/attachment/201407/25/526870_140627220188iB.png "width =" 1043 "Height =" 832 "/>
Start System Installation
650) This. width = 650; "Title =" clip_image025 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image025 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272202oHlO.png "width =" 1037 "Height =" 828 "/> 650) This. width = 650; "Title =" clip_image026 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image026 "src =" http://img1.51cto.com/attachment/201407/25/526870_14062722032BuK.png "width =" 1042 "Height =" 831 "/>
After the system is installed, restart the system.
650) This. width = 650; "Title =" clip_image027 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image027 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272203U4Il.png "width =" 744 "Height =" 469 "/>
650) This. width = 650; "Title =" clip_image028 "style =" border-right-width: 0px; Background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-Right: 0px; border-top-width: 0px; "Border =" 0 "alt =" clip_image028 "src =" http://img1.51cto.com/attachment/201407/25/526870_1406272204kwSF.png "width =" 707 "Height =" 364 "/>
We can see that the system has been installed successfully, and the partition information is exactly the same as what we configured.
This article from the "muddy world" blog, please be sure to keep this source http://ilanni.blog.51cto.com/526870/1530099