在我决定自己动手安装kvm虚拟机的时候,我最先去的官网找安装的步骤,没花多大力气就找到了《Getting KVM to run on your machine》这篇文章,按照上面的步骤开始安装。根据这篇文章,安装kvm虚拟机并运行,只需要以下三个步骤:
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很多人在执行第1个步骤的时候,都会很顺利,不会遇到问题。大多数情况下,都会卡在第2个步骤上。在执行第2个步骤的时候,遇到的第一个问题是找不到qemu-system-x86_64命令;第二个问题就是看到"VNC server running on `::1:5900'“这个提示,google了半天也不行。
TigerVNC Viewer for X version 1.1.0 - built Apr 29 2013 11:33:36 Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt) See http://www.tigervnc.org for information on TigerVNC. vncviewer: unable to open display ""因为vncviewer需要在桌面环境下执行。
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 ... Could 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解决这个问题,只需要执行下面的命令即可:
yum install pixman pixman-devel libXfont远程连接vncserver的工具我用的是tightvnc,这个工具是免费的,非常好用。