When I decided to install the kvm Virtual Machine on CentOS 6.3, I first went to the official website to find the installation steps, without much effort, I found the article "Getting KVM to run on your machine" and followed the steps above to start the installation. According to this article, you only need to perform the following three steps to install and run the kvm virtual machine:
1./usr/local/kvm/bin/qemu-img create-f qcow2 vdisk. img 10G
2./usr/local/kvm/bin/qemu-system-x86_64-hda vdisk. img-cdrom/path/to/boot-media.iso-boot d-m 384
3./usr/local/kvm/bin/qemu-system-x86_64 vdisk. img-m 384
Many people perform the 1st steps smoothly without any problems. In most cases, it is stuck in step 1. The first problem encountered while executing Step 1 was that the qemu-system-x86_64 command could not be found; the second problem was that the prompt "VNC server running on ': 1: 100'" was displayed, google does not work after half a day.
First of all, the first problem is that the qemu-system-x86_64 is the command generated when installing qemu (note not qemu-kvm), and The qemu-kvm package is installed by default in CentOS, the corresponding command is qemu-kvm. This information is also described in the above article, but the problem is that the qemu-kvm command cannot be found. The command qemu-kvm is in the/usr/libexec/directory. If you are familiar with the Red Hat system, you can easily find the directory where the qemu-kvm command is located. You only need to check the output of rpm-ql qemu-kvm. In the future, you will encounter similar problems, you can also use the rpm-ql command.
If you are in a desktop environment, run the "vncviewer: 5900" command directly to continue the installation process. If you execute the vncviewer command in the shell connected to remote ssh, the following error is reported:
TigerVNC Viewer for X version 1.1.0-built Apr 29 2013 11:33:36
Copyright (C) 1999-2011 TigerVNC Team and other others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Vncviewer: unable to open display ""
Because vncviewer needs to be executed in the desktop environment.
Another way is to add "-vnc: 0" when executing the qemu-kvm command, you can use tools such as tightvnc to connect to port 5900 to continue the installation process. In this case, the system does not need a graphical interface.
Of course, some people may need to configure vncserver in the server segment. In this case, the rpm package to be installed in CentOS is tigervnc and tigervnc-server, the vncviewer command is located in the tigervnc package. For details about the installation process, see the following two articles:
Http://wiki.centos.org/HowTos/VNC-Server#head-76401321dae4d80916a7fd7e710272a9b85c9485
When starting the vncserver service, you may encounter the following problems:
WARNING: The first attempt to start Xvnc failed, possibly because the font
Catalog is not properly configured. Attempting to determine an appropriate
Font path for this system and restart Xvnc using that font path...
Cocould not start Xvnc.
/Usr/bin/Xvnc: symbol lookup error:/usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/Usr/bin/Xvnc: symbol lookup error:/usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
To solve this problem, you only need to execute the following command:
Yum install pixman-devel libXfont
I use tightvnc to remotely connect to vncserver. This tool is free of charge and is very useful.