spice-client && virt-viewer等在Ubuntu16.04(x64)下的编译安装的一些问题

源码下载地址:
https://www.spice-space.org/download.html
spice-protocol: https://www.spice-space.org/download/releases/spice-protocol-0.12.15.tar.bz2
spice-gtk-0.35: https://www.spice-space.org/download/gtk/spice-gtk-0.35.tar.bz2
usbredir-0.8: https://www.spice-space.org/download/usbredir/usbredir-0.8.0.tar.bz2
virt-viewer-8.0: https://virt-manager.org/download/sources/virt-viewer/virt-viewer-8.0.tar.gz


注:以下流程未安装gstreamer。
如需安装gstreamer,则安装如下:

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools

如果编译时提示找不到gstreamer,则需要:

sudo apt install libgstreamer-plugins-base1.0-dev

如果无法安装,可能需要修改或者添加apt的安装源。


编译spice-server

这边也顺手写一下spice-server在CentOS下的编译安装吧。

获取、修改源码

wget https://www.spice-space.org/download/releases/spice-server/spice-0.14.1.tar.bz2

install deps && config && make,缺啥包你们自己补吧
注意,这里没有添加gstreamer的支持,你可以自己不上gstreamer的相关包,然后–enable-gstreamer=yes

yum install spice-protocol
yum install glib2 glib2-devel
yum install pixman pixman-devel
yum install celt051 celt051-devel
yum install openssl openssl-devel
yum install libjpeg-turbo libjpeg-turbo-devel
yum install opus opus-devel
yum install cyrus-sasl cyrus-sasl-devel lz4 lz4-devel usbredir*
./configure --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64 --enable-gtk-doc-pdf=no --enable-gtk-doc-html=no --enable-celt051 --enable-manual=no --enable-gstreamer=no
make -j8


#for spice-protocol

  1. cd spice-protocol-0.12.15/
  2. ./configure --prefix=/usr --libdir=/usr/lib 或者lib64
  3. make
  4. sudo make install

#for spice-gtk-0.35

安装依赖包:

apt install libpixman-1-dev libssl-dev libgtk-3-dev libjpeg-turbo8-dev libopus-dev liblz4-dev libpulse-dev libsasl2-dev libcacard-dev usbredir* intltool

config:

./configure --prefix=/usr --libdir=/usr/lib --enable-gtk-doc-html=no --enable-usbredir=yes

> > --enable-celt051 可要可不要
> > --enable-gstaudio=yes --enable-gstvideo=yes 可要可不要

如果报错:

/usr/local/lib/libusbredirhost.so: undefined reference to `libusb_set_option’

则卸载usbredir:

sudo apt remove libusbredirparser1
下列软件包将被【卸载】:
libusbredirhost-dev libusbredirhost1 libusbredirparser-dev
libusbredirparser1

如果报错:

checking for USBREDIR… no
configure: error: usbredir support explicitly requested, but some required packages are not available

则需要编译安装usbredir:

  1. tar xvjf usbredir-0.8.0.tar.bz2
  2. cd usbredir-0.8.0/
  3. ./configure
    或者 ./configure --prefix=/usr --libdir=/usr/lib (建议用这个)

此时报错:

checking for LIBUSB… no
configure: error: Package requirements (libusb-1.0 >= 1.0.9) were not met:

No package ‘libusb-1.0’ found

然后:

sudo apt install libusb-1.0-0-dev

报错:

下列软件包有未满足的依赖关系:
libusb-1.0-0-dev : 依赖: libusb-1.0-0 (= 2:1.0.20-1) 但是 2:1.0.22-2 正要被安装
        推荐: libusb-1.0-doc 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

解决办法: 使用aptitude降级 或者 dpkg -i 安装libusb-1.0-0-dev_1.0.22-2_amd64.deb

  1. sudo apt-get install aptitude
  2. sudo aptitude install libusb-1.0-0=2:1.0.20-1
  3. sudo apt install libusb-1.0-0-dev

然后继续编译安装usbredir-8.0


#for virt-viewer-8.0

./configure --prefix=/usr --libdir=/usr/lib --without-gtk-vnc --without-ovirt


tips:

在使用过程中,有个小细节需要注意。就是如果使用spice-gtk的spicy,全屏模式下是通过 shift + F12来退出全屏。
而virt-viewer,编译成功之后,生成的可执行文件名字是remote-viewer,就算是走spice协议,也无法通过 shift + F12来退出全屏,而是通过屏幕顶部的悬浮按钮。

究其原因,因为remote-viewer和spicy实际上是调用libspice-client-gtk-3.0.so和libspice-client-glib-2.0.so,在此基础上分别单独实现的gtk程序,二者的实现方法有点区别。
具体区别,后面有空再讲。哈哈哈哈哈

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章