Ubuntu14.04 Installing the configuration to create a KVM virtual machine
- |
- Browse:1995
- |
- Updated: 2014-11-22 10:46
- |
- Tags: virtual machines
Step through Reading
One of the most important ways to make sure that OpenStack works is to implement virtualization technology, of course, virtualization technology is more in the way, such as: Xen, KVM, Hyper-V, VMware.
Here I'll start by talking about KVM installation configuration and usage.
Tools/Materials
- Ubuntu14.04 's server
- Support for Virtualization VT
Installation Preparation
- 1
The VT technology is the function of the server CPU, but if the CPU has this function and does not open it needs our own operation to open.
Check if the CPU supports installing KVM:
$ Egrep-o ' (VMX|SVM) '/proc/cpuinfo
If the following information is displayed, it is possible to install KVM
END
Installing KVM
- 1
Required packages for installing KVM:
$ apt-get Install QEMU-KVM libvirt-bin virt-manager bridge-utils
Where: Virt-manager for GUI Management window, bridge-utils: for network bridging
- 2
The installation process is automatic, do not need us to have any action, after the installation we can check whether the installation is successful:
# Lsmod | grep KVM
The output for the following information indicates that we have successfully installed
- 3
Of course, you can also use the following command to see if the KVM installation is successful, in short, the method of verification is more, here also do not do too much to repeat:
Virsh-c Qemu:///system List
This command also verifies that the KVM operation is normal.
END
Create a virtual machine
- 1
Create the images directory under the root and create the ISO and test directories under images. The ISO directory contains ISO images, and test is the hostname of the virtual machine, which holds the disk.img (the data stored in the virtual machine's hard disk)
- 2
Then we can download an ISO file to the directory we specify, and this is the operating system we need to install:
# wget
- 3
When all the preparation was done, we started to create the virtual machine:
Virt-install--name ubuntutest--HVM--ram 1024x768--vcpus 1--disk path=/images/test/disk.img,size=10--network network:def Ault--accelerate--vnc--vncport=5911--cdrom/images/iso/ubuntu-14.04-server-amd64.iso-d
[Parameter description]
--name Virtual machine Name
--HVM uses full virtualization (vs. Para-irtualization) and does not support Xen hypervisor
--ram Virtual machine Memory size
--vcpus virtual Machine Virtual CPU number
--disk the path to the disk (file) used by the virtual machine, in this case the file is placed in the/images/test directory
--network network settings, use the default settings
--vnc set up a VNC port connected to the desktop environment, this example is 5911
--cdrom set the optical drive to get the virtual optical drive file path-D indicates booting from the CD drive (-C indicates booting from the hard drive) we're/images/iso here.
- 4
This allows our virtual machines to be created, and we can use the commands to manage the virtual machines. Let's verify that our virtual machine is not present:
# Virsh List--all
- 5
This means that our virtual machine is the name of Ubuntutest, and the next step is our operation and management of the virtual machine:
Start a virtual machine
# Virsh Start VMNAME
Modify the parameters of the virtual machine, modify the following file:
Vi/etc/libvirt/qemu/vmname.xml
END
Precautions
- Be sure to ensure that the source is available
- There's a need to use VNC, or there will be SDL errors.
UBUNTU->OPENSTACK->KVM Installation