ubuntu下编译libvirt

使用java libvirt进行开发,需要在java的工程中引入libvirt包和jna包。这两个jar包需要依赖底层的动态链接库。

在Windows下,安装libvirt后就会产生所需要的库文件。由于jna是采用名字匹配的,所以需要将产生的库文件修改名称:libvirt-0.dll修改为virt.dll。

System.setproperty("java.path.jna", "库文件所在的路径")。将库加载到环境变量中。

已经验证:在Windows下,只要包含所有的库文件就可以,不需要安装libvirt。


在ubuntu下和Windows的情况是相似的:安装后的libvirt.so文件及其依赖的文件存在路径中就可以。

一.Libvirt的编译:

1. 下载libvirt开发包并解压

http://libvirt.org/sources/网址,选择一个最新的包下载。我选用的是:libvirt-0.9.12.tar.gz

2. 运行./configure

安装缺少的包,直到运行成功。

3. make生成.so

4. libvirt.so添加到路径中。/usr/lib/

经过测试,libvirt.solibvirt.so.0都可以。安装版的libvirt.so是一个软连接,链接到另外一个动态连接库。

5. 创建工程,添加jnalibvirt包,测试。

下面是运行configure中容易出现的问题和需要安装的包,从网上搜的。安装后想想,其实这些都没啥用。主要就是缺少什么包,安装什么包。


libvirt and virt-manager compilation guide

libvirt

Dependencies

libxml++ libxml++-dev gnutls-dev libdevmapper-dev libnl-dev

libhal-dev dbus python-dev libdbus-1-dev libudev-dev libpciaccess-dev

libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libpolkit-gtk-1-0

Configuration Arguments

$ ./configure --bindir=/bin --sbindir=/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/libexec --includedir=/usr/include --localstatedir=/var --with-hal=yes --with-udev=yes --with-polkit=yes

virt-manager

Dependencies

intltool

Configuration Arguments

$ ./configure --bindir=/bin --sbindir=/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/libexec --includedir=/usr/include

virtinst

Dependencies

None 

Configuration Arguments

python setup.py install

Post Installation Steps

GUI Dependencies

apt-get install python-urlgrabber python-gtk-vnc

Then, run /sbin/libvirtd. 

Change libvirtd upstart job

vi /etc/init/libvirt-bin.conf

Then, issue a reboot command. 

libvirt-0.9.0 编译问题 

From:http://blog.163.com/gjx0619@126/blog/static/12740839320114494341832/


#./configure (如果有老版本的libvirt,建议使用 ./configure --prefix=/usr --libdir=/usr/lib64 --localstatedir=/var --sysconfdir=/etc
:libdir是原来版本的/libvirt.so.0指向的目录)

...

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

#

#apt-cache search libxml2

aolserver4-nsxml - Module for XML support in aolsever4

docbook-xml - standard XML documentation system for software and systems

docbook5-xml - standard XML documentation system for software and systems

libgdome2-0 - DOM level2 library for accessing XML files

libgdome2-dev - Development files for libgdome2

gir-repository-dev - XML sources files for the GObject introspection repository

libglobus-libxml2-dev - Globus Toolkit - LibXML2 Library Development Files

libglobus-libxml2 - Globus Toolkit - LibXML2 Library

libgdome2-cpp-smart-dev - C++ bindings for GDome2 DOM implementation

libgdome2-cpp-smart0c2a - C++ bindings for GDome2 DOM implementation

libgdome2-ocaml-dev - OCaml bindings for GDome2 DOM implementation

libgdome2-ocaml - OCaml bindings for GDome2 DOM implementation

libgtkmathview-bin - rendering engine for MathML documents

libgtkmathview-dev - rendering engine for MathML documents

libgtkmathview0c2a - rendering engine for MathML documents

liblua5.1-gnome-0 - GNOME bindings for the Lua language version 5.1

python-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension)

python-lxml-doc - pythonic binding for the libxml2 and libxslt libraries (documentation)

python-lxml - pythonic binding for the libxml2 and libxslt libraries

python3-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension)

python3-lxml - pythonic binding for the libxml2 and libxslt libraries

libcroco3-dev - a generic Cascading Style Sheet (CSS) parsing and manipulation toolkit

libcroco3 - a generic Cascading Style Sheet (CSS) parsing and manipulation toolkit

libxml++1.0-dev - A C++ interface to the GNOME XML library (libxml2)

libxml++1.0-doc - HTML interface documentation and examples for libxml++

libxml++1.0c2a - A C++ interface to the GNOME XML library (libxml2)

libxml++2.6-2 - A C++ interface to the GNOME XML library (libxml2)

libxml++2.6-dbg - A C++ interface to the GNOME XML library (debug symbols)

libxml++2.6-dev - A C++ interface to the GNOME XML library (libxml2)

libxml++2.6-doc - HTML interface documentation and examples for libxml++

libxml-dom-xpath-perl - adds XPath support to XML::DOM, using XML::XPathEngine

libxml-libxml-perl - Perl interface to the libxml2 library

libxml-rss-libxml-perl - create and update RSS files using XML::LibXML

libxml2-dbg - Debugging symbols for the GNOME XML library

libxml2-dev - Development files for the GNOME XML library

libxml2-doc - Documentation for the GNOME XML library

libxml2-utils - XML utilities

libxml2 - GNOME XML library

python-libxml2-dbg - Python bindings for the GNOME XML library (debug extension)

python-libxml2 - Python bindings for the GNOME XML library

nd - small command line interface to WebDAV servers

python-pyxmpp-doc - XMPP and Jabber implementation for Python (documentation)

python-pyxmpp - XMPP and Jabber implementation for Python

libsp-gxmlcpp-dev - S+P C++ wrapper for Gnome libxml2/libxslt

libsp-gxmlcpp1 - S+P C++ wrapper for Gnome libxml2/libxslt

# apt-get install libxml++2.6-2

正在读取软件包列表... 完成

正在分析软件包的依赖关系树       

正在读取状态信息... 完成       

下列【新】软件包将被安装:

  libxml++2.6-2

升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。

需要下载 86.7 kB 的软件包。

解压缩后会消耗掉 254 kB 的额外空间。

获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main libxml++2.6-2 amd64 2.30.0-1 [86.7 kB]

下载 86.7 kB,耗时 0秒 (1,853 kB/s)    

选中了曾被取消选择的软件包 libxml++2.6-2。

(正在读取数据库 ... 系统当前共安装有 147612 个文件和目录。)

正在解压缩 libxml++2.6-2 (从 .../libxml++2.6-2_2.30.0-1_amd64.deb) ...

正在设置 libxml++2.6-2 (2.30.0-1) ...

#

# apt-get install libxml++2.6-dev

正在读取软件包列表... 完成

正在分析软件包的依赖关系树       

正在读取状态信息... 完成       

将会安装下列额外的软件包:

  libglib2.0-dev libglibmm-2.4-dev libsigc++-2.0-dev libxml2-dev

建议安装的软件包:

  libglib2.0-doc libglibmm-2.4-doc libgtkmm-2.4-dev libsigc++-2.0-doc

  libxml++2.6-doc

下列【新】软件包将被安装:

  libglib2.0-dev libglibmm-2.4-dev libsigc++-2.0-dev libxml++2.6-dev

  libxml2-dev

升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。

需要下载 3,106 kB 的软件包。

解压缩后会消耗掉 15.3 MB 的额外空间。

您希望继续执行吗?[Y/n]y

获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main libglib2.0-dev amd64 2.24.2-1 [1,273 kB]

获取:2 http://mirror.ivic.org.cn/debian/ squeeze/main libsigc++-2.0-dev amd64 2.2.4.2-1 [113 kB]

获取:3 http://mirror.ivic.org.cn/debian/ squeeze/main libglibmm-2.4-dev amd64 2.24.2-1 [780 kB]

获取:4 http://mirror.ivic.org.cn/debian/ squeeze/main libxml2-dev amd64 2.7.8.dfsg-2 [830 kB]

获取:5 http://mirror.ivic.org.cn/debian/ squeeze/main libxml++2.6-dev amd64 2.30.0-1 [110 kB]

下载 3,106 kB,耗时 0秒 (16.2 MB/s)  

选中了曾被取消选择的软件包 libglib2.0-dev。

(正在读取数据库 ... 系统当前共安装有 147621 个文件和目录。)

正在解压缩 libglib2.0-dev (从 .../libglib2.0-dev_2.24.2-1_amd64.deb) ...

选中了曾被取消选择的软件包 libsigc++-2.0-dev。

正在解压缩 libsigc++-2.0-dev (从 .../libsigc++-2.0-dev_2.2.4.2-1_amd64.deb) ...

选中了曾被取消选择的软件包 libglibmm-2.4-dev。

正在解压缩 libglibmm-2.4-dev (从 .../libglibmm-2.4-dev_2.24.2-1_amd64.deb) ...

选中了曾被取消选择的软件包 libxml2-dev。

正在解压缩 libxml2-dev (从 .../libxml2-dev_2.7.8.dfsg-2_amd64.deb) ...

选中了曾被取消选择的软件包 libxml++2.6-dev。

正在解压缩 libxml++2.6-dev (从 .../libxml++2.6-dev_2.30.0-1_amd64.deb) ...

正在处理用于 man-db 的触发器...

正在设置 libglib2.0-dev (2.24.2-1) ...

正在设置 libsigc++-2.0-dev (2.2.4.2-1) ...

正在设置 libglibmm-2.4-dev (2.24.2-1) ...

正在设置 libxml2-dev (2.7.8.dfsg-2) ...

正在设置 libxml++2.6-dev (2.30.0-1) ...
#
checking libxml2 xml2-config >= 2.6.0 ... configure: error: Could not find libxml2 anywhere (see config.log for details).
# apt-get install libxml++2.6-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libglib2.0-dev libglibmm-2.4-dev libsigc++-2.0-dev libxml2-dev pkg-config
Suggested packages:
  libglib2.0-doc libglibmm-2.4-doc libgtkmm-2.4-dev libsigc++-2.0-doc
  libxml++2.6-doc
The following NEW packages will be installed:
  libglib2.0-dev libglibmm-2.4-dev libsigc++-2.0-dev libxml++2.6-dev libxml2-dev
  pkg-config
0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
Need to get 3,166 kB of archives.
After this operation, 15.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirror.ivic.org.cn/debian/ squeeze/main pkg-config amd64 0.25-1.1 [59.2 kB]
Get:2 http://mirror.ivic.org.cn/debian/ squeeze/main libglib2.0-dev amd64 2.24.2-1 [1,273 kB]
Get:3 http://mirror.ivic.org.cn/debian/ squeeze/main libsigc++-2.0-dev amd64 2.2.4.2-1 [113 kB]
Get:4 http://mirror.ivic.org.cn/debian/ squeeze/main libglibmm-2.4-dev amd64 2.24.2-1 [780 kB]
Get:5 http://mirror.ivic.org.cn/debian/ squeeze/main libxml2-dev amd64 2.7.8.dfsg-2 [830 kB]
Get:6 http://mirror.ivic.org.cn/debian/ squeeze/main libxml++2.6-dev amd64 2.30.0-1 [110 kB]
Fetched 3,166 kB in 0s (22.4 MB/s)        
Selecting previously deselected package pkg-config.
(Reading database ... 42977 files and directories currently installed.)
Unpacking pkg-config (from .../pkg-config_0.25-1.1_amd64.deb) ...
Selecting previously deselected package libglib2.0-dev.
Unpacking libglib2.0-dev (from .../libglib2.0-dev_2.24.2-1_amd64.deb) ...
Selecting previously deselected package libsigc++-2.0-dev.
Unpacking libsigc++-2.0-dev (from .../libsigc++-2.0-dev_2.2.4.2-1_amd64.deb) ...
Selecting previously deselected package libglibmm-2.4-dev.
Unpacking libglibmm-2.4-dev (from .../libglibmm-2.4-dev_2.24.2-1_amd64.deb) ...
Selecting previously deselected package libxml2-dev.
Unpacking libxml2-dev (from .../libxml2-dev_2.7.8.dfsg-2_amd64.deb) ...
Selecting previously deselected package libxml++2.6-dev.
Unpacking libxml++2.6-dev (from .../libxml++2.6-dev_2.30.0-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up pkg-config (0.25-1.1) ...
Setting up libglib2.0-dev (2.24.2-1) ...
Setting up libsigc++-2.0-dev (2.2.4.2-1) ...
Setting up libglibmm-2.4-dev (2.24.2-1) ...
Setting up libxml2-dev (2.7.8.dfsg-2) ...
Setting up libxml++2.6-dev (2.30.0-1) ...
root@shahe26:~/libvirt-0.9.0# 

#./configure

....

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

#

# apt-get install gnutls-bin(可省)

正在读取软件包列表... 完成

正在分析软件包的依赖关系树       

正在读取状态信息... 完成       

下列【新】软件包将被安装:

  gnutls-bin

升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。

需要下载 333 kB 的软件包。

解压缩后会消耗掉 631 kB 的额外空间。

获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main gnutls-bin amd64 2.8.6-1 [333 kB]

下载 333 kB,耗时 0秒 (6,967 kB/s) 

选中了曾被取消选择的软件包 gnutls-bin。

(正在读取数据库 ... 系统当前共安装有 148297 个文件和目录。)

正在解压缩 gnutls-bin (从 .../gnutls-bin_2.8.6-1_amd64.deb) ...

正在处理用于 man-db 的触发器...

正在设置 gnutls-bin (2.8.6-1) ...
#

#  apt-get install libgnutls-dev
root@shahe26:~/libvirt-0.9.0# apt-get install libgnutls-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libgcrypt11-dev libgpg-error-dev libtasn1-3-dev
Suggested packages:
  libgcrypt11-doc gnutls-doc guile-gnutls
The following NEW packages will be installed:
  libgcrypt11-dev libgnutls-dev libgpg-error-dev libtasn1-3-dev
0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded.
Need to get 1,435 kB of archives.
After this operation, 3,969 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirror.ivic.org.cn/debian/ squeeze/main libgpg-error-dev amd64 1.6-1 [36.3 kB]
Get:2 http://mirror.ivic.org.cn/debian/ squeeze/main libgcrypt11-dev amd64 1.4.5-2 [376 kB]
Get:3 http://mirror.ivic.org.cn/debian/ squeeze/main libtasn1-3-dev amd64 2.7-1 [386 kB]
Get:4 http://mirror.ivic.org.cn/debian/ squeeze/main libgnutls-dev amd64 2.8.6-1 [637 kB]
Fetched 1,435 kB in 0s (21.6 MB/s)     
Selecting previously deselected package libgpg-error-dev.
(Reading database ... 43686 files and directories currently installed.)
Unpacking libgpg-error-dev (from .../libgpg-error-dev_1.6-1_amd64.deb) ...
Selecting previously deselected package libgcrypt11-dev.
Unpacking libgcrypt11-dev (from .../libgcrypt11-dev_1.4.5-2_amd64.deb) ...
Selecting previously deselected package libtasn1-3-dev.
Unpacking libtasn1-3-dev (from .../libtasn1-3-dev_2.7-1_amd64.deb) ...
Selecting previously deselected package libgnutls-dev.
Unpacking libgnutls-dev (from .../libgnutls-dev_2.8.6-1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Setting up libgpg-error-dev (1.6-1) ...
Setting up libgcrypt11-dev (1.4.5-2) ...
Setting up libtasn1-3-dev (2.7-1) ...
Setting up libgnutls-dev (2.8.6-1) ...
#./configure
...

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

# apt-get install libdevmapper-dev libdevmapper

root@Optiplex-780:/home/qinguan/桌面/libvirt-0.9.0# apt-get install libdevmapper-dev

正在读取软件包列表... 完成

正在分析软件包的依赖关系树       

正在读取状态信息... 完成       

将会安装下列额外的软件包:

  libselinux1-dev libsepol1-dev

下列【新】软件包将被安装:

  libdevmapper-dev libselinux1-dev libsepol1-dev

升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。

需要下载 930 kB 的软件包。

解压缩后会消耗掉 4,571 kB 的额外空间。

您希望继续执行吗?[Y/n]y

获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main libsepol1-dev amd64 2.0.41-1 [578 kB]

获取:2 http://mirror.ivic.org.cn/debian/ squeeze/main libselinux1-dev amd64 2.0.96-1 [320 kB]

获取:3 http://mirror.ivic.org.cn/debian/ squeeze/main libdevmapper-dev amd64 2:1.02.48-5 [32.6 kB]

下载 930 kB,耗时 0秒 (7,633 kB/s)     

选中了曾被取消选择的软件包 libsepol1-dev。

(正在读取数据库 ... 系统当前共安装有 148437 个文件和目录。)

正在解压缩 libsepol1-dev (从 .../libsepol1-dev_2.0.41-1_amd64.deb) ...

选中了曾被取消选择的软件包 libselinux1-dev。

正在解压缩 libselinux1-dev (从 .../libselinux1-dev_2.0.96-1_amd64.deb) ...

选中了曾被取消选择的软件包 libdevmapper-dev。

正在解压缩 libdevmapper-dev (从 .../libdevmapper-dev_2%3a1.02.48-5_amd64.deb) ...

正在处理用于 man-db 的触发器...

正在设置 libsepol1-dev (2.0.41-1) ...

正在设置 libselinux1-dev (2.0.96-1) ...

正在设置 libdevmapper-dev (2:1.02.48-5) ...

# .configure

...

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

# apt-get install libnl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libnl-doc
The following NEW packages will be installed:
  libnl-dev
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 33.7 kB of archives.
After this operation, 262 kB of additional disk space will be used.
Get:1 http://mirror.ivic.org.cn/debian/ squeeze/main libnl-dev amd64 1.1-6 [33.7 kB]
Fetched 33.7 kB in 0s (0 B/s)        
Selecting previously deselected package libnl-dev.
(Reading database ... 44026 files and directories currently installed.)
Unpacking libnl-dev (from .../libnl-dev_1.1-6_amd64.deb) ...
Setting up libnl-dev (1.1-6) ...

checking for HAL... no
configure: error: You must install hal-devel >= 0.5.0 to compile libvirt
# apt-cache search hal-dev
gnome-device-manager - GNOME device manager based on HAL
libgnome-device-manager-dev - GNOME device manager based on HAL - development files
libgnome-device-manager0 - GNOME device manager based on HAL - libraries
libhal-dev - Hardware Abstraction Layer - development files
# apt-get install libhal-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
将会安装下列额外的软件包:
  libdbus-1-dev
建议安装的软件包:
  hal-doc
下列【新】软件包将被安装:
  libdbus-1-dev libhal-dev
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 4 个软件包未被升级。
需要下载 347 kB 的软件包。
解压缩后会消耗掉 1,352 kB 的额外空间。
您希望继续执行吗?[Y/n]
获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main libdbus-1-dev amd64 1.2.24-4 [244 kB]
获取:2 http://mirror.ivic.org.cn/debian/ squeeze/main libhal-dev amd64 0.5.14-3 [103 kB]
下载 347 kB,耗时 0秒 (3,208 kB/s)  
选中了曾被取消选择的软件包 libdbus-1-dev。
(正在读取数据库 ... 系统当前共安装有 149814 个文件和目录。)
正在解压缩 libdbus-1-dev (从 .../libdbus-1-dev_1.2.24-4_amd64.deb) ...
选中了曾被取消选择的软件包 libhal-dev。
正在解压缩 libhal-dev (从 .../libhal-dev_0.5.14-3_amd64.deb) ...
正在设置 libdbus-1-dev (1.2.24-4) ...
正在设置 libhal-dev (0.5.14-3) ...
# ./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

# apt-cache search libudev-dev
libudev-dev - libudev development files
# apt-get install libudev-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列【新】软件包将被安装:
  libudev-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 4 个软件包未被升级。
需要下载 53.6 kB 的软件包。
解压缩后会消耗掉 418 kB 的额外空间。
获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main libudev-dev amd64 164-3 [53.6 kB]
下载 53.6 kB,耗时 0秒 (1,136 kB/s)
选中了曾被取消选择的软件包 libudev-dev。
(正在读取数据库 ... 系统当前共安装有 149853 个文件和目录。)
正在解压缩 libudev-dev (从 .../libudev-dev_164-3_amd64.deb) ...
正在设置 libudev-dev (164-3) ...
# ./configure --prefix=/usr --libdir=/usr/lib64 --localstatedir=/var --sysconfdir=/etc --with-hal=yes --with-udev=yes
....
checking for PCIACCESS... no
configure: error: You must install libpciaccess-devel >= 0.10.0 to compile libvirt
# apt-cache search libpciaccess-dev
libpciaccess-dev - Generic PCI access library for X - development files
# apt-get install libpciaccess-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列【新】软件包将被安装:
  libpciaccess-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 4 个软件包未被升级。
需要下载 42.8 kB 的软件包。
解压缩后会消耗掉 147 kB 的额外空间。
获取:1 http://mirror.ivic.org.cn/debian/ squeeze/main libpciaccess-dev amd64 0.12.0-1 [42.8 kB]
下载 42.8 kB,耗时 0秒 (2,051 kB/s)       
选中了曾被取消选择的软件包 libpciaccess-dev。
(正在读取数据库 ... 系统当前共安装有 149877 个文件和目录。)
正在解压缩 libpciaccess-dev (从 .../libpciaccess-dev_0.12.0-1_amd64.deb) ...
正在设置 libpciaccess-dev (0.12.0-1) ...
#

#make

#make install


注:有时依然不能用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

Ubuntu10.04下 Libvirt源码安装2 

看到了一篇《libvirt API学习笔记》
http://blog.csdn.net/qq250941970/article/details/5989940
2010年末就已经0.8.1版本了,自己昨天竟然弄的是0.3.3版本的(不了解libvirt那个ftp结构,因为在ubuntu下面装想到去deb目录下找)

于是把之前工作(http://blog.csdn.net/jyjmc/article/details/7084627)全部删掉:make uninstall,并删除~/libvirt。
下载了0.9.8版本(2011年12月更新)重新安装。

Configure过程出错:
$checking for libdevmapper.h... no
 configure: error: You must install device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt
$checking for python extension module directory... ${exec_prefix}/lib/python2.6/site-packages
 configure: error: You must install python-devel to build Python bindings
于是安装:
sudo apt-get install libdevmapper-dev
sudo apt-get install python-dev
这下配置成功的信息多了很多:
config.status: creating po/Makefile
configure: 
configure: Configuration summary
configure: =====================
configure: 
configure: Drivers
configure: 
configure:      Xen: yes
configure:     QEMU: yes
configure:      UML: yes
configure:   OpenVZ: yes
configure:   VMware: yes
configure:     VBox: yes
configure:   XenAPI: no
configure: xenlight: no
configure:      LXC: yes
configure:     PHYP: no
configure:      ESX: yes
configure:  Hyper-V: no
configure:     Test: yes
configure:   Remote: yes
configure:  Network: yes
configure: Libvirtd: yes
configure:    netcf: no
configure:  macvtap: no
configure: virtport: no
configure: 
configure: Storage Drivers
configure: 
configure:      Dir: yes
configure:       FS: yes
configure:    NetFS: yes
configure:      LVM: yes
configure:    iSCSI: no
configure:     SCSI: yes
configure:    mpath: yes
configure:     Disk: no
configure: 
configure: Security Drivers
configure: 
configure:  SELinux: yes
configure: AppArmor: no
configure: 
configure: Driver Loadable Modules
configure: 
configure:   dlopen: no
configure: 
configure: Libraries
configure: 
configure:   libxml: -I/usr/include/libxml2   -lxml2  
configure:   dlopen: -ldl
configure:  libcurl: -DCURL_DISABLE_TYPECHECK   -lcurl  
configure: openwsman: no
configure:  libssh2:  
configure:   gnutls:   -lgnutls   -lgcrypt
configure:     sasl: no
configure:     yajl: no
configure:  sanlock: no
configure:    avahi: no
configure:   polkit: /usr/bin/pkcheck (version 1)
configure:    audit: no
configure:  selinux:  -lselinux
configure: apparmor: no
configure:  numactl: no
configure:    capng: no
configure:      xen:   -lxenstore
configure:   xenapi: no
configure: xenlight: no
configure:      hal: no
configure:     udev: no
configure:    netcf: no
configure:     pcap: no
configure:       nl: no
configure:    mscom: no
configure:      xdr: 
configure: 
configure: Test suite
configure: 
configure:    Coverage: no
configure:   Alloc OOM: no
configure: 
configure: Miscellaneous
configure: 
configure:         Debug: yes
configure:      Warnings: maximum
configure: Warning Flags:  -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat -Wsync-nand -Wattributes -Wcoverage-mismatch -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral -Wframe-larger-than=4096 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const
configure:      Readline: yes
configure:        Python: yes
configure:        DTrace: no
configure:   XML Catalog: /etc/xml/catalog
configure:   Init script: check
configure: 
configure: Privileges
configure: 
configure:       QEMU: root:root

configure: 



  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值