kvm编译安装及常见问题解决

一、KVM的编译安装

1、安装基本系统和开发工具

1.1 编译内核

mkdir /root/kvm

cd /root/kvm

wget http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.5.tar.gz

tar -zvxf linux-3.5.tar.gz -C /usr/src

cd /usr/src/linux-2.6.34.4

make menuconfig

vi .config

增加

CONFIG_SYSFS_DEPRECATED_V2=y

CONFIG_STP=m

CONFIG_BRIDGE=m

修改

CONFIG_STP=y

CONFIG_BRIDGE=y

make -j30 all

make modules_install

make install

1.2 安装kvm_mod

wget
http://nchc.dl.sourceforge.net/project/kvm/kvm-kmod/3.5/kvm-kmod-3.5.tar.bz2

tar -jvxf kvm-kmod-3.5.tar.bz2

cd kvm-kmod-3.5

./configure

make && make install

reboot

1.3 确认kvm_kmod安装成功

lsmod | grep kvm

kvm_intel              40286
 0

kvm                  
266256  1 kvm_intel

如果你的系统是64位可以直接进行这一步,因为64位的ubuntu是自带kvm模块的

1.4 安装qemu-kvm

apt-get install -y libglib2.0-dev

cd /root/kvm

wget
https://launchpad.net/ubuntu/+archive/primary/+files/qemu-kvm_1.0%2Bnoroms.orig.tar.gz

tar -zxf qemu-kvm-0.12.5.tar.gz

cd qemu-kvm-0.12.5

./configure –prefix=/usr/local/kvm  –disable-vnc-tls
 –disable-vnc-sasl  –disable-curl   –enable-system
 –static

make && make install

ln -s /usr/local/kvm/bin/qemu-img /usr/bin/qemu-img

ln -s /usr/local/kvm/bin/qemu-io /usr/bin/qemu-io

ln -s /usr/local/kvm/bin/qemu-nbd /usr/bin/qemu-nbd

ln -s /usr/local/kvm/bin/qemu-system-x86_64 /usr/bin/qemu

ln -s /usr/local/kvm/bin/qemu-system-x86_64 /usr/bin/kvm

ln -s /usr/local/kvm/bin/qemu-system-x86_64 /usr/bin/qemu-kvm

二、libvirt的编译安装

apt-get install -y libdevmapper libdevmapper-dev libgnutls-dev
libxml2-dev libpciaccess-dev libudev-dev libnl-dev gnutls-bin

cd /root/kvm

wget
https://launchpad.net/ubuntu/+archive/primary/+files/libvirt_1.0.2.orig.tar.gz

tar -zxf libvirt_1.0.2.orig.tar.gz

cd libvirt-1.0.2

./configure –prefix=/usr/local/libvirt –enable-debug=no
–with-storage-lvm=no

make && make install

ln -s /usr/local/libvirt/bin/virsh /usr/bin/virsh

三、virtinst的编译安装

四、常见错误问题

问题一:configure: error: You must install the GnuTLS library in order to
compile and run libvirt

解决方法:

Ubuntu:apt-get  install -y libgnutls-dev

问题二:

/usr/local/libvirt/sbin/libvirtd

19:49:56.942: error : virRunWithHook:857 : internal error ‘brctl setfd
virbr0 0‘ exited with non-zero status 1 and signal 0: libvir: error :
cannot execute binary brctl: No such file or directory

19:49:56.982: warning : qemudStartup:1832 : Unable to create
cgroup for driver: No such device or address

解决方法:

Ubuntu:apt-get install -y bridge-utils

问题三:

19:51:11.368: error : virRunWithHook:857 : internal error
‘/sbin/iptables –table filter –insert FORWARD –destination
192.168.122.0/255.255.255.0 –out-interface virbr0 –match state –state
ESTABLISHED,RELATED –jump ACCEPT‘ exited with non-zero status 1 and signal
0: iptables: Unknown error 18446744073709551615

19:51:11.368: error : networkAddMasqueradingIptablesRules:637 : failed
to add iptables rule to allow forwarding to ‘virbr0‘: Invalid argument

19:51:11.420: warning : qemudStartup:1832 : Unable to create cgroup for
driver: No such device or address

如果使用桥接网络独立IP可以忽略

问题四:

checking libxml2 xml2-config >= 2.6.0 … configure: error: Could not
find libxml2 anywhere (see config.log for details).

解决方法:

Ubuntu: apt-get install -y libxml2-dev

问题五:

configure: error: You must install the GnuTLS library in order to
compile and run libvirt

解决方法:

Ubunut: apt-get install -y gnutls-bin(可省)

apt-get install -y libgnutls-dev

问题六:

configure: error: You must install device-mapper-devel/libdevmapper
>= 1.0.0 to compile libvirt

解决方法:

Ubunut:apt-get install -y libdevmapper-dev libdevmapper

问题七:

configure: error: libnl-devel >= 1.1 is required for macvtap
support

解决方法:

Ubunut:apt-get install -y libnl-dev

问题八:

# ./configure –prefix=/usr –libdir=/usr/lib64 –localstatedir=/var
–sysconfdir=/etc –with-hal=yes –with-udev=yes

checking for UDEV… no

configure: error: You must install libudev-devel >= 145 to compile
libvirt

解决方法:

Ubunut: apt-get install -y libudev-dev

问题九:

configure: error: You must install libpciaccess-devel >= 0.10.0 to
compile libvirt

解决方法:

Ubuntu: apt-get install -y libpciaccess-dev

问题十:

configure: error: You must install python-devel to build Python
bindings

解决方法:

Ubuntu:apt-get install -y python-dev

sudo apt-get install python-dev

注:有时依然不能用virsh nodedev-dumpxml pci_0000_00_19_0

#./configure –prefix=/usr –libdir=/usr/lib64 –localstatedir=/var
–sysconfdir=/etc –with-hal=yes –with-udev=yes –with-polkit=yes

….

checking for POLKIT… no

configure: error: You must install PolicyKit >= 0.6 to compile
libvirt

# apt-get install libpolkit-agent-1-0 libpolkit-backend-1-0
libpolkit-gobject-1-0 libpolkit-gtk-1-0

kvm编译安装及常见问题解决,布布扣,bubuko.com

时间: 2024-10-05 05:05:58

kvm编译安装及常见问题解决的相关文章

PHP编译安装时常见错误解决办法,php编译常见错误

PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 解决方法: yum -y install libxslt-devel 2.configure: error: Could not find net-snmp-config binary. Please check your net-snmp installa

linux 编译安装php及编译安装mysql常见错误总结及解决办法

一.编译安装php常见错误总结及解决办法 错误 1checking for xml2-config path…configure: error: xml2-config not found. Please check your libxml2 installation.解决办法:# yum -y install libxml2-devel 错误 2 checking for BZip2 in default path… not foundconfigure: error: Please rein

linux编译安装时常见错误解决办法

linux编译安装时常见错误解决办法 This article is post on https://coderwall.com/p/ggmpfa 原文链接:http://www.bkjia.com/PHPjc/1008013.html configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution复制代码 代码如下:yum -y install libxslt-devel c

OpenStack之安装kvm+编译安装libvirt+解决遇到的问题

http://libvirt.org/sources/ 下载libvirt进行编译安装 1.简单编译安装libvirt [email protected]:/tool#tar -xf libvirt-1.3.4.tar.gz [email protected]:/tool# cd libvirt-1.3.4 [email protected]:/tool/libvirt-1.3.4# Ubuntu缺省情况下,没有提供C/C++的编译环境,所以还需手动安装如下包[email protected]:

AutoItLibrary安装和常见问题解决

AutoItLibrary 安装步骤: 1. 安装pythonwin32 在下载地址:http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/找到对应自己python的pythonwin32版本,下载并安装pythonwin32. 最新的版本为build220. [注意]:不管电脑的版本是否为32或者64位的,pythonwin32的版本需要匹配python的版本. Python的版本可以按照以下步骤查看:cmd->py

magent编译安装及常见错误

安装magent到/usr/local/下 cd /usr/local mkdir magent cd magent/ wget http://memagent.googlecode.com/files/magent-0.6.tar.gz tar zxvf magent-0.6.tar.gz /sbin/ldconfig sed -i "s#LIBS = -levent#LIBS = -levent -lm#g" Makefile make 错误1: gcc -lrt -Wall -g

Genymotion模拟器的安装及常见问题解决方法

Genymotion是很好用很快的一款Android模拟器. 我们使用的时候下载一个免费版的就足够用了. 官网下载地址:http://www.genymotion.net/ 不过这个软件下载之前必须注册,因为我们后面在创建模拟器的时候也需要登录账号.注册的时候可能会需要FQ软件. 下载之后就直接进行安装,安装的时候全部下一步,并且所有的东西都要安装. 安装好之后我们还需要创建模拟器,这里创建模拟器的时候我们开始先试试能不能直接创建,如果可以则忽略下面括号中这一步,如果不能创建的话就进行下面括号中

Linux下安装 TestLink常见问题解决方法

Read/write permissions For security reason we suggest that directories tagged with [S] on following messages, will be made UNREACHEABLE from browser Checking if C:\xampp\htdocs\testlink-1.9.5\gui\templates_c directory exists OK Checking if C:\xampp\h

(转)ubuntu源码编译安装php常见错误解决办法

原文地址 http://blog.csdn.net/white__cat/article/details/28907535 './configure' '–prefix=/usr/local/PHP' '–with-config-file-path=/etc' '–with-MySQL=/usr/local/mysql' '–with-mysqli=/usr/local/mysql/bin/mysql_config' '–with-iconv-dir=/usr/local' '–with-fre