CN109358951B - SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards - Google Patents
SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards Download PDFInfo
- Publication number
- CN109358951B CN109358951B CN201811265334.6A CN201811265334A CN109358951B CN 109358951 B CN109358951 B CN 109358951B CN 201811265334 A CN201811265334 A CN 201811265334A CN 109358951 B CN109358951 B CN 109358951B
- Authority
- CN
- China
- Prior art keywords
- display
- virtual
- card
- virtual machine
- spice
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Controls And Circuits For Display Device (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention belongs to the technical field of virtual desktops, and particularly relates to a display method for intelligently supporting direct connection of a display card and a virtual display card based on an SPICE protocol. The method is implemented based on a display system comprising: the system comprises a virtual machine, a virtual desktop client, an SPICE server, a physical server and a virtual display card; the virtual machine comprises: the virtual machine internal agent module and the display card drive; the physical server comprises a physical display card; the SPICE service end comprises: a display information acquisition and control module; compared with the prior art, the invention continues to use the original SPICE protocol, can self-adapt to two modes of the transparent transmission of the physical display card and the virtual display card, displays the virtual desktop, and has high compatibility with the original system. The virtual machine is communicated with the server side through virtIO and is not directly communicated with the client side, and therefore system safety is improved.
Description
Technical Field
The invention belongs to the technical field of virtual desktops, and particularly relates to a display method for intelligently supporting direct connection of a display card and a virtual display card based on an SPICE protocol.
Background
The existing virtualization desktop scheme can only support one of a virtual display card or a display card direct connection mode, and cannot support the virtual display card and the display card direct connection mode at the same time.
SPICE is an open source desktop virtualization data transmission protocol developed by reddat, captures display information from a virtual display card provided by QEMU to a virtual machine, and sends the display information to an SPICE client through a display channel. On the other hand, since the demands for the video cards with higher requirements such as game playing, video processing, and 3D design are greatly increased, the analog video card with lower performance provided by QEMU cannot meet the demands of users. Through a display card direct connection mechanism provided by QEMU, a physical display card on the server is provided for the virtual machine to use, and the high-performance display requirement of a user can be met. In order to meet the requirements of different users, the scheme needs to support the display of the virtual display card and the display card in a direct mode. However, the existing scheme only supports one of two display modes, namely a virtual display card or a display card direct connection mode, and cannot support the two display modes at the same time.
1: scheme for supporting virtual graphics card:
the SPICE protocol can directly capture commands in the virtual display card, is converted into SPICE protocol messages after being optimized, and finally is sent to the client side through the display channel to display the virtual desktop. Due to the limitation of a mechanism for obtaining display information of the display card by SPICE, the display information in the physical display card directly communicated to the virtual machine cannot be captured, so that a virtual desktop cannot be displayed at a virtual desktop client and a user cannot operate the virtual desktop.
2: the scheme for supporting the direct connection of the display card comprises the following steps:
1) the scheme of using the virtual machine internal agent to directly send the display information through the network is as follows:
disabling a display channel in the SPICE protocol, networking the virtual machines, installing an agent in the virtual machines, capturing display information in the physical display card and sending the display information to the client through the network of the virtual machines; the client is then modified to be able to parse the display information sent through the proxy. The method modifies the client and the server of the desktop virtualization protocol at the same time, and has poor compatibility with the original SPICE protocol. Meanwhile, the client is directly connected with the Internet, so that the host isolation is damaged, and the safety is reduced.
2) The scheme for transmitting display information based on the shared memory between the virtual machine and the server comprises the following steps:
according to the scheme, a part of memory in the virtual machine is shared with a part of memory in the physical server, an agent is installed in the virtual machine, display information in the physical display card is captured and written into the shared memory, then a server side of an SPICE protocol is modified, the display information in the shared memory is read, and the display information is sent to a client side through an original display channel of the SPICE. The method needs to add a shared memory allocation and management mechanism in QEMU, and has high control complexity and great realization difficulty.
The existing scheme has the defect that the two modes of the virtual display card and the direct connection of the display card cannot be simultaneously supported.
For the scheme only supporting the virtual graphics card, the performance of the scheme cannot meet the high performance requirement of the user.
For the scheme only supporting the direct connection of the display card, the original SPICE protocol is greatly changed, and the compatibility with the original virtual desktop system based on the SPICE protocol is poor; because the virtual graphics card is not supported, resources are wasted when high performance display requirements are not needed.
Disclosure of Invention
Technical problem to be solved
The technical problem to be solved by the invention is as follows: how to provide a display method for intelligently supporting direct connection of a display card and a virtual display card requires high compatibility with an SPICE protocol and can simultaneously support two modes of direct connection of the virtual display card and the display card; and the virtual machine does not directly communicate with the server side or the client side, so that the safety is enhanced.
(II) technical scheme
In order to solve the above technical problem, the present invention provides a display method for intelligently supporting a direct connection of a graphics card and a virtual graphics card based on an SPICE protocol, wherein the method is implemented based on a display system, and the display system comprises: the system comprises a virtual machine, a virtual desktop client, an SPICE server, a physical server and a virtual display card;
the virtual machine comprises: the virtual machine internal agent module and the display card drive;
the physical server comprises a physical display card;
the SPICE service end comprises: a display information acquisition and control module;
the display method comprises the following steps:
step 1: the virtual machine is connected with the virtual desktop client;
step 2: in the starting process of the virtual machine, the agent module in the virtual machine is not started, the virtual machine captures display information from the virtual display card and sends the display information to the virtual desktop client through the original display channel;
and step 3: the virtual desktop client receives display information from the original display channel, and displays the display information after processing and rendering;
and 4, step 4: after the virtual machine is started, the virtual machine internal agent module is started to acquire display card driving information, detect the type of the display card and send the display card type information to a display information acquisition and control module in the SPICE server;
and 5: the method comprises the following steps that a display information acquisition and control module in the SPICE server receives the type information of a display card of an agent module in the virtual machine, judges the type of the display card and stores a result, and the method is divided into the following two conditions according to different detected types of the display card:
step 51: if the virtual machine internal display card is detected to be the virtual display card, entering the step 6:
step 52: if the video card in the virtual machine is detected to be the direct physical video card, the step 7 is carried out:
step 6: displaying the virtual display card;
and 7: and displaying the direct physical display card.
Wherein the step 6 comprises the following substeps:
step 61: capturing display information from a virtual display card by the virtual machine, and sending the display information to the virtual desktop client through the original display channel;
step 62: and the virtual desktop client receives the display information from the original display channel, and displays the display information after processing and rendering.
Wherein the step 7 comprises the following substeps:
step 71: the method comprises the following steps that a display information acquisition and control module in an SPICE server receives a channel establishment instruction transmitted by a virtual machine internal agent module, establishes a Stream channel, and sends a control command to the virtual machine internal agent module to inform the virtual machine internal agent module of the start of capturing display card information;
step 72: the virtual machine inner agent module receives the control command, starts to capture display information from the display card drive, and sends the captured display information to the SPICE server;
step 73: the SPICE server receives the display information and sends the display information to the virtual desktop client through the Stream channel;
step 74: and the virtual desktop client receives the display information from the Stream channel, and displays the display information after processing and rendering.
Wherein the method further comprises:
and 8: the virtual desktop client disconnects and sends a disconnection instruction;
and step 9: and after receiving the disconnection instruction of the virtual desktop client, the SPICE server judges whether the virtual machine is a direct physical display card or not according to the type of the display card detected in the step 5.
Step 10: if the virtual machine is a direct physical display card according to the judgment result, the display information acquisition and control module in the SPICE server sends a command for stopping capturing the display information to the agent module in the virtual machine;
step 11: and the virtual machine internal agent module receives a command of stopping capturing the display information, stops capturing the display information from the display card drive, and feeds back the result to the SPICE server.
In step 72, the captured display information is sent to the SPICE server through virtIO port.
(III) advantageous effects
Compared with the prior art, the invention comprises the following distinguishing technical characteristics:
(1) display data and control commands are passed between the virtual machines and the SPICE server using virtIO ports.
(2) The display information in the two channels can be intelligently selected and displayed at the client.
(3) And detecting the type of the video card used by the virtual machine through an agent in the virtual machine.
Therefore, compared with the prior art, the method continues to use the original SPICE protocol, can be self-adapted to two modes of transparent transmission of the physical display card and the virtual display card, displays the virtual desktop, and has high compatibility with the original system. The virtual machine is communicated with the server side through virtIO and is not directly communicated with the client side, and therefore system safety is improved.
Drawings
Fig. 1 is a schematic diagram of the technical scheme of the invention.
Detailed Description
In order to make the objects, contents, and advantages of the present invention clearer, the following detailed description of the embodiments of the present invention will be made in conjunction with the accompanying drawings and examples.
In order to solve the above technical problem, the present invention provides a display method for intelligently supporting a direct display card and a virtual display card based on SPICE protocol, as shown in fig. 1, the method is implemented based on a display system, and the display system includes: the system comprises a virtual machine, a virtual desktop client, an SPICE server, a physical server and a virtual display card;
the virtual machine comprises: the virtual machine internal agent module and the display card drive;
the physical server comprises a physical display card;
the SPICE service end comprises: a display information acquisition and control module;
the display method comprises the following steps:
step 1: the virtual machine is connected with the virtual desktop client;
step 2: in the starting process of the virtual machine, the agent module in the virtual machine is not started, the virtual machine captures display information from the virtual display card and sends the display information to the virtual desktop client through the original display channel;
and step 3: the virtual desktop client receives display information from the original display channel, and displays the display information after processing and rendering;
and 4, step 4: after the virtual machine is started, the virtual machine internal agent module is started to acquire display card driving information, detect the type of the display card and send the display card type information to a display information acquisition and control module in the SPICE server;
and 5: the method comprises the following steps that a display information acquisition and control module in the SPICE server receives the type information of a display card of an agent module in the virtual machine, judges the type of the display card and stores a result, and the method is divided into the following two conditions according to different detected types of the display card:
step 51: if the virtual machine internal display card is detected to be the virtual display card, entering the step 6:
step 52: if the video card in the virtual machine is detected to be the direct physical video card, the step 7 is carried out:
step 6: displaying the virtual display card;
and 7: and displaying the direct physical display card.
Wherein the step 6 comprises the following substeps:
step 61: capturing display information from a virtual display card by the virtual machine, and sending the display information to the virtual desktop client through the original display channel;
step 62: and the virtual desktop client receives the display information from the original display channel, and displays the display information after processing and rendering.
Wherein the step 7 comprises the following substeps:
step 71: the method comprises the following steps that a display information acquisition and control module in an SPICE server receives a channel establishment instruction transmitted by a virtual machine internal agent module, establishes a Stream channel, and sends a control command to the virtual machine internal agent module to inform the virtual machine internal agent module of the start of capturing display card information;
step 72: the virtual machine inner agent module receives the control command, starts to capture display information from the display card drive, and sends the captured display information to the SPICE server;
step 73: the SPICE server receives the display information and sends the display information to the virtual desktop client through the Stream channel;
step 74: and the virtual desktop client receives the display information from the Stream channel, and displays the display information after processing and rendering.
Wherein the method further comprises:
and 8: the virtual desktop client disconnects and sends a disconnection instruction;
and step 9: and after receiving the disconnection instruction of the virtual desktop client, the SPICE server judges whether the virtual machine is a direct physical display card or not according to the type of the display card detected in the step 5.
Step 10: if the virtual machine is a direct physical display card according to the judgment result, the display information acquisition and control module in the SPICE server sends a command for stopping capturing the display information to the agent module in the virtual machine;
step 11: and the virtual machine internal agent module receives a command of stopping capturing the display information, stops capturing the display information from the display card drive, and feeds back the result to the SPICE server.
In step 72, the captured display information is sent to the SPICE server through virtIO port.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.
Claims (5)
1. A display method of intelligent support display card direct connection and virtual display card based on SPICE protocol is characterized in that the method is implemented based on a display system, and the display system comprises: the system comprises a virtual machine, a virtual desktop client, an SPICE server, a physical server and a virtual display card;
the virtual machine comprises: the virtual machine internal agent module and the display card drive;
the physical server comprises a physical display card;
the SPICE service end comprises: a display information acquisition and control module;
the display method comprises the following steps:
step 1: the virtual machine is connected with the virtual desktop client;
step 2: in the starting process of the virtual machine, the agent module in the virtual machine is not started, the virtual machine captures display information from the virtual display card and sends the display information to the virtual desktop client through the original display channel;
and step 3: the virtual desktop client receives display information from the original display channel, and displays the display information after processing and rendering;
and 4, step 4: after the virtual machine is started, the virtual machine internal agent module is started to acquire display card driving information, detect the type of the display card and send the display card type information to a display information acquisition and control module in the SPICE server;
and 5: the method comprises the following steps that a display information acquisition and control module in the SPICE server receives the type information of a display card of an agent module in the virtual machine, judges the type of the display card and stores a result, and the method is divided into the following two conditions according to different detected types of the display card:
step 51: if the virtual machine internal display card is detected to be the virtual display card, entering the step 6:
step 52: if the video card in the virtual machine is detected to be the direct physical video card, the step 7 is carried out:
step 6: displaying the virtual display card;
and 7: and displaying the direct physical display card.
2. The SPICE protocol-based display method of an intelligent supported graphics card direct and virtual graphics card according to claim 1, wherein the step 6 comprises the substeps of:
step 61: capturing display information from a virtual display card by the virtual machine, and sending the display information to the virtual desktop client through the original display channel;
step 62: and the virtual desktop client receives the display information from the original display channel, and displays the display information after processing and rendering.
3. The SPICE protocol-based display method of an intelligent supported graphics card direct and virtual graphics card according to claim 1, wherein the step 7 comprises the substeps of:
step 71: the method comprises the following steps that a display information acquisition and control module in an SPICE server receives a channel establishment instruction transmitted by a virtual machine internal agent module, establishes a Stream channel, and sends a control command to the virtual machine internal agent module to inform the virtual machine internal agent module of the start of capturing display card information;
step 72: the virtual machine inner agent module receives the control command, starts to capture display information from the display card drive, and sends the captured display information to the SPICE server;
step 73: the SPICE server receives the display information and sends the display information to the virtual desktop client through the Stream channel;
step 74: and the virtual desktop client receives the display information from the Stream channel, and displays the display information after processing and rendering.
4. The SPICE protocol-based display method of intelligent support graphics card direct and virtual graphics card according to claim 3, wherein the method further comprises:
and 8: the virtual desktop client disconnects and sends a disconnection instruction;
and step 9: after receiving a disconnection instruction of the virtual desktop client, the SPICE server judges whether the virtual machine is a direct physical display card or not according to the type of the display card detected in the step 5;
step 10: if the virtual machine is a direct physical display card according to the judgment result, the display information acquisition and control module in the SPICE server sends a command for stopping capturing the display information to the agent module in the virtual machine;
step 11: and the virtual machine internal agent module receives a command of stopping capturing the display information, stops capturing the display information from the display card drive, and feeds back the result to the SPICE server.
5. The SPICE protocol-based display method for intelligent support graphics card direct and virtual graphics cards according to claim 3, wherein the captured display information in step 72 is sent to the SPICE server via virtIO port.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811265334.6A CN109358951B (en) | 2018-10-29 | 2018-10-29 | SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811265334.6A CN109358951B (en) | 2018-10-29 | 2018-10-29 | SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109358951A CN109358951A (en) | 2019-02-19 |
CN109358951B true CN109358951B (en) | 2021-07-02 |
Family
ID=65346896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811265334.6A Active CN109358951B (en) | 2018-10-29 | 2018-10-29 | SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109358951B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109918171A (en) * | 2019-02-22 | 2019-06-21 | 上海映云信息技术有限公司 | A kind of standard communication method based on QEMU-KVM hardware device |
CN110336846B (en) * | 2019-04-15 | 2020-12-08 | 长飞光纤光缆股份有限公司 | Cloud desktop file dragging and transmitting method based on spice protocol |
CN110647375A (en) * | 2019-09-23 | 2020-01-03 | 天津卓朗科技发展有限公司 | Image rendering method and device of cloud desktop and cloud server |
CN111901414A (en) * | 2020-07-27 | 2020-11-06 | 山东超越数控电子股份有限公司 | Realization method and realization system of secure desktop transmission protocol based on virtualization environment |
CN114489552B (en) * | 2022-03-28 | 2022-08-12 | 广东统信软件有限公司 | Remote display control system, remote control interface display method and computing equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101154166A (en) * | 2006-09-25 | 2008-04-02 | 联想(北京)有限公司 | Virtual machine system and its graphics card access method |
CN100561438C (en) * | 2006-11-15 | 2009-11-18 | 联想(北京)有限公司 | A kind of dummy machine system and video card using method thereof |
CN103491188A (en) * | 2013-09-30 | 2014-01-01 | 上海沃帆信息科技有限公司 | Implementation method for enabling multiple users to share graphic workstation by using virtual desktop and GPU pass-through |
CN106569877A (en) * | 2016-11-14 | 2017-04-19 | 中国石油化工股份有限公司 | Method for sharing graphic workstation GPU by virtual machines in direct connection way |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170004808A1 (en) * | 2015-07-02 | 2017-01-05 | Nvidia Corporation | Method and system for capturing a frame buffer of a virtual machine in a gpu pass-through environment |
-
2018
- 2018-10-29 CN CN201811265334.6A patent/CN109358951B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101154166A (en) * | 2006-09-25 | 2008-04-02 | 联想(北京)有限公司 | Virtual machine system and its graphics card access method |
CN100561438C (en) * | 2006-11-15 | 2009-11-18 | 联想(北京)有限公司 | A kind of dummy machine system and video card using method thereof |
CN103491188A (en) * | 2013-09-30 | 2014-01-01 | 上海沃帆信息科技有限公司 | Implementation method for enabling multiple users to share graphic workstation by using virtual desktop and GPU pass-through |
CN106569877A (en) * | 2016-11-14 | 2017-04-19 | 中国石油化工股份有限公司 | Method for sharing graphic workstation GPU by virtual machines in direct connection way |
Non-Patent Citations (2)
Title |
---|
Implementation of GPU virtualization using PCI pass-through mechanism;Chao-Tung Yang;《The Journal of Supercomputing》;20131031;第68卷;第183-213页 * |
基于虚拟化的系统安全增强及显卡透传研究;侯建宁;《计算机工程》;20120430;第38卷(第8期);第224-231页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109358951A (en) | 2019-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109358951B (en) | SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards | |
CN105260153B (en) | Image output device and image output method | |
JP3833483B2 (en) | Image display system, image data transmission apparatus, display image data transmission method, differential transfer method, program, and storage medium | |
WO2019114185A1 (en) | App remote control method and related devices | |
CN112073758B (en) | Cloud desktop screen projection method and device, computer equipment, computer readable storage medium and cloud desktop screen projection interaction system | |
WO2014089793A1 (en) | Method, device, and system for video redirection and computer readable medium | |
WO2016202102A1 (en) | Message transmission method and device | |
CN108206842B (en) | Cloud desktop remote access method and system | |
CN101316203B (en) | Method for monitoring embedded IP terminal internetwork connection condition | |
WO2016197863A1 (en) | Client, smart television system, and corresponding data transmission method | |
CN104301687A (en) | Camera video processing method and corresponding equipment applied to virtual desktop environment | |
WO2023020025A1 (en) | Screen projection method and electronic device | |
CN103677701A (en) | Large screen synchronous display method and system | |
WO2014121477A1 (en) | Video redirection method, device and system, and computer readable medium | |
US11979941B2 (en) | Data transmission method and terminal | |
CN102546803B (en) | Remote desktop communication method based on capability set | |
CN101707622A (en) | Method for realizing remote data monitoring | |
TW201005546A (en) | System and method for using virtual IP addresses in a multi-user server system | |
WO2023109895A1 (en) | Object sharing method and apparatus, electronic device, and storage medium | |
CN110928707A (en) | Data exchange method and related device for host machine and virtual machine | |
CN113051032A (en) | Application picture processing method, device and system | |
CN115052043A (en) | Video transmission method, electronic equipment, device and medium of cloud desktop | |
CN103853305B (en) | A kind of method for managing power supply and electronic equipment | |
CN112839097A (en) | Remote control method, equipment and system | |
CN102902504B (en) | Connection system and connection method for computer base map signal of embedded image control platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |