This article was sponsored by Xiuyi linfeng and first launched 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
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.
Now, connect the VNC client to the virtual machine as follows:
192.168.1.240: 5991
Now, start VNC to install the centos system, for example:
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.
If the image file is not detected, go to the installation page.
Start installation and next step.
We strongly recommend that you select English in this language.
Select American standard keyboard for keyboard format
Select basic storage
Select allow
Enter the host name.
Select time zone
Set the root user password
Select Custom Partition
We can see that the entire hard disk is not partitioned yet.
Start creating a new partition, and select a standard partition here.
Partition/boot first
Partition according to the above, and the result is as above.
Format partitions
Save partition information to Hard Disk
Install system boot Information
Start System Installation
After the system is installed, restart the system.
We can see that the system has been installed successfully, and the partition information is exactly the same as what we configured.