Gentoo installation Kvm+spice and OPENCV tutorial

Source: Internet
Author: User
Tags gtk

Gentoo Installation Kvm+spice

It's been heard long ago that spice is a lot more powerful relative to VNC, since it was installed with a 32-bit system that could not be tried, installed 64-bit systems, and had no time to toss.

Last week has actually changed the graphics of the previous Windows virtual machine from VNC to spice, and yesterday it took care of the agent's startup and remote copy paste.

First of all, installation, the process of installation is relatively convenient, the first need to uninstall the original installation of the APP-EMULATION/QEMU-KVM, because the next to install the spice function of the KVM and this package is mutual block. After uninstalling, you will need to emerge app-emulation/qemu-kvm-spice this package again. Otherwise, the virtual machine's display will be switched from VNC to spice directly in Virt-manager, prompting this version of the KVM to not support the Spice protocol at boot time. Other and spice related packages are: App-emulation/spice,app-emulation/spice-protocol and so on, if you want to connect directly to the spice interface in Virt-manager, you need to install net-misc/ SPICE-GTK This bag (but when I used it in KDE, I found that using NET-MISC/SPICE-GTK would make the entire interface transparent, presumably because the GTK and KWin effects were incompatible).

The installation is still very simple, and after the installation is complete, it is necessary to reconfigure the original Windows virtual machine. Delete the original VNC display in the Virt-manager, add a new graphics, type select Spice Server. Replace the virtual video card used in the original video with QXL so that after you start the virtual machine, you will use spice.

As mentioned earlier, there are a lot of spice-gtk in KDE, so I am using the SPICEC command directly, because there is no encryption configured, so the connection is very simple, direct use:

Spicec-h 127.0.0.1-p 5900

The port number can be set when the spice server is added, and if automatic allocation is selected, the allocation will be incremented starting from 5900.

After startup, you need to install drivers for Windows inside, and all binaries required by Windows can be found in the Windows binaries http://spice-space.org/download.html here. First download QXL driver, when Windows prompts you to install the driver file, install the QXL driver, you can complete the spice display function.

Before installing Windows driver on this page of http://www.linux-kvm.com/content/rhev-spice-guest-drivers-released-windows, it is convenient to install QXL in front, However, the subsequent VDI port driver has not been prompted to install, after the last step install SPICE agent, the service has been unable to start, the first attempt to SPICE the end of the time.

And then continue to search the next Spice Agent failed to start, found in Redhat bugzilla now Sprice agent has not passed VDI, need to interact through virtio-serial. In the Virt-manager interface, how can not find how to add this device method, and finally only by editing the virtual machine configuration file directly modify the way. By using Virsh edit xxx (the name of XXX as the virtual machine), the configuration file for the virtual machine opens, adding two channel to the devices tag according to the Libvirt Web site:

<channel type= ' pty ' >
<target type= ' virtio ' name= ' arbitrary.virtio.serial.port.name '/>
<address type= ' virtio-serial ' controller= ' 0′bus= ' 0′port= ' 1 '/>
</channel>
<channel type= ' Spicevmc ' >
<target type= ' virtio ' name= ' com.redhat.spice.0 '/>
<address type= ' virtio-serial ' controller= ' 0′bus= ' 0′port= ' 2 '/>
</channel>

Save this configuration file and start the virtual machine, and Windows will be prompted to discover new hardware. You need to install using Windows Virtio-serial driver on the Spice download page. After the installation is complete, reinstall the Spice agent, this time the Spice Agent service can start normally. With this service, the virtual machine is able to share the Clipboard with host hosts.


Gentoo Installation OpenCV

Prior to the OPENCV application, after changing the Gentoo, read the PNG picture will prompt:

Libpng Warning:application is compiled with png.h from libpng-1.2.29
Libpng Warning:application is running with png.c from libpng-1.4.5

After writing a script, I found that this application relies on a PNG library that is 1.4.5. The above hint is that libpng specified the wrong version at compile time. Although I have 1.2 and 1.4 two versions of libpng locally, the header file is only 1.4. Carefully looked at the compiled directory, through the search png.h this keyword, found unexpectedly since the OpenCV inside from the libpng. It stands to say that if you discover the libpng of the system, you should not use your own libpng. Finally, these are found in the Cmakelists.txt file of the Highgui module:

if (with_jpeg)
Add_definitions (-dhave_jpeg)
if (not jpeg_found)
Set (Use_3rdparty TRUE)
endif ()
endif ()
if (with_png)
Add_definitions (-dhave_png)
if (not png_found)
Set (Use_3rdparty TRUE)
endif ()
endif ()
if (With_tiff)
Add_definitions (-dhave_tiff)
if (not tiff_found)
Set (Use_3rdparty TRUE)
endif ()
endif ()
if (With_jasper)
Add_definitions (-dhave_jasper)
if (not jasper_found)
Set (Use_3rdparty TRUE)
endif ()
endif ()
if (Use_3rdparty)
Include_directories ("${cmake_current_source_dir}/.") /.. /3rdparty/include ")
endif ()

In other words, if any one of these libraries does not, the 3rdparty/include directory will be added to the search directory of the header file. Gentoo in emerge, the default is not usejpeg2k, that is, do not use the System Jasper Library, resulting in a reference to the png.h.

After you find the reason, it is very convenient to solve, before emerge OpenCV, make sure to add jpeg2k to use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.