编译virt viewer之前执行的configure命令,是没有使能usb-redir相关的功能,virt viewer是否支持usbredir是完全依赖于spice-gtk的。
virt viewer对spice-gtk的依赖关系,可以从virt viewer的configure结果看出来:
configure: Configuration summary configure: ===================== configure: configure: Features: configure: configure: Gtk: 3.0 configure: configure: Libraries: configure: configure: GLIB2: -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -pthread -Wl,--export-dynamic -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0 configure: configure: GTK: -pthread -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 configure: configure: GTK_VNC: configure: configure: SPICE_GTK: -pthread -I/usr/local/include/spice-client-gtk-3.0 -I/usr/local/include/spice-client-glib-2.0 -I/usr/local/include -I/usr/local/include/spice-1 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -L/usr/local/lib -lspice-client-gtk-3.0 -lgtk-3 -lspice-client-glib-2.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 configure: configure: LIBXML2: -I/usr/include/libxml2 -lxml2 configure: configure: LIBVIRT: -I/usr/local/include -L/usr/local/lib -lvirt -ldl configure: configure: OVIRT: configure:
其中spice-client-gtk-3.0和spice-client-glib-2.0即是spice-gtk的编译结果。
版本
spice-gtk-0.20.tar
virt-viewer-0.5.6.tar.gz
编译libusbredir
可以在http://www.spicespace.org/page/UsbRedir下载最新版本
./configure make sudo make install
编译spice-gtk
要在virt viewer中使能usbredir,必须先正确的编译spice-gtk,--enable-usbdir=yes 使能usbredir
./configure --with-gtl=3.0 --with-audio=gstreamer --enable-usbdir=yes --enable-smartcard=yes make make install
make install 会把spice-gtk编译的库,头文件等安装到系统中,virt viewer的编译依赖这些库和头文件。
编译virt viewer
./configure --with-gtk=3.0 --with-spice-gtk make make install
sudo ./remote-viewer, 使用sudo执行remote-viewer,因为要操作USB,需要超级用户权限。
如果顺利,执行remote-viewer后,可在file菜单下看到 “USB device selection” 选项。