CN113835816A - Virtual machine desktop display method, device, equipment and readable storage medium - Google Patents

Virtual machine desktop display method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN113835816A
CN113835816A CN202111145956.7A CN202111145956A CN113835816A CN 113835816 A CN113835816 A CN 113835816A CN 202111145956 A CN202111145956 A CN 202111145956A CN 113835816 A CN113835816 A CN 113835816A
Authority
CN
China
Prior art keywords
virtual machine
operation command
display
client
service module
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.)
Pending
Application number
CN202111145956.7A
Other languages
Chinese (zh)
Inventor
郑仲森
唐强华
王继科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202111145956.7A priority Critical patent/CN113835816A/en
Publication of CN113835816A publication Critical patent/CN113835816A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a method, a device and equipment for displaying a virtual machine desktop and a readable storage medium, wherein the method comprises the following steps: acquiring the picture change content of the virtual machine by using an operating system; generating an operation command corresponding to the screen change content by using an operation system; writing an operation command into the shared memory equipment by using an operating system; and the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to the client so that the client can perform desktop rendering and display by using the operation command. In the application, additional simulation of virtual display equipment is not needed, so that the method can be applied to various CPU architectures including an ARM architecture and an MIPS architecture. At the same time, there is no requirement for the network of the virtual machine itself and the operating system within the virtual machine. The desktop display performance of the virtual machine can be improved on the basis of being compatible with various CPU architectures.

Description

Virtual machine desktop display method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of virtualization technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for displaying a virtual machine desktop.
Background
In a VDI (Virtual Desktop infrastructure) environment, a server mostly adopts an ARM (advanced RISC Machine) architecture, and a few servers are an MIPS (Microprocessor with interleaved program instructions architecture, a processor architecture adopting a reduced instruction set) architecture and an X86(The X86 architecture, a computer language instruction set executed by a Microprocessor) architecture; the virtual machine is a virtual machine installed with a Linux operating system. In the VDI architecture, how to efficiently transmit an image of a virtual machine to a client for display is a key technology affecting user experience.
On a server of an X86 architecture, a Linux virtual machine can efficiently transmit display pictures through an open-source QXL scheme. However, in other CPU architectures, such as ARM architecture, MIPS architecture, AMD64 architecture, the QXL (a virtual display device under QEMU) scheme cannot operate properly. However, if a general VGA (a virtual display device under QEMU) display scheme is used, the interaction experience is poor.
In summary, how to improve the desktop display performance of the virtual machine based on compatibility with various CPU architectures is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a method, a device and equipment for displaying a virtual machine desktop and a readable storage medium, which can improve the display performance of the virtual machine desktop on the basis of being compatible with various CPU architectures.
In order to solve the technical problem, the application provides the following technical scheme:
a virtual machine desktop display method is applied to a virtual machine and comprises the following steps:
acquiring the picture change content of the virtual machine by using an operating system;
generating an operation command corresponding to the screen change content by using the operation system;
writing the operation command into a shared memory device by using the operation system;
and reading the operation command from the shared memory device in a timing or real-time manner by using a service module, and sending the operation command to a client so that the client can perform desktop rendering and display by using the operation command.
Preferably, the acquiring, by using the operating system, the screen change content of the virtual machine includes:
and acquiring the screen change content of the virtual machine by using an X11 display driver in the operating system.
Preferably, the acquiring, by using an X11 display driver in the operating system, the screen change content of the virtual machine includes:
and acquiring the picture change content of the virtual machine by using a virtual display driver in the X11 display driver.
Preferably, the generating, by the operating system, an operation command corresponding to the screen change content includes:
generating an operation command which is in accordance with virtual display equipment simulated by a virtual machine simulator and corresponds to the picture change content by utilizing the operation system;
correspondingly, the reading the operation command from the shared memory device in a timing or real-time manner by using the service module includes:
and utilizing the service module simulated by the virtual machine simulator to read the operation command from the shared memory equipment simulated by the virtual machine simulator in a timing or real-time manner.
Preferably, the generating, by using the operating system, an operating command corresponding to the screen change content and conforming to a virtual display device simulated by a virtual machine simulator includes:
generating a display command and/or a cursor command which is in accordance with QXL virtual display equipment simulated by the virtual machine simulator and corresponds to the picture change content by utilizing the operating system;
determining the display command and/or the cursor command as the operation command.
Preferably, the reading, in real time or in real time, the operation command from the shared memory device simulated by the virtual machine simulator by using the service module simulated by the virtual machine simulator includes:
reading the operation command from the shared memory device in a timing or real-time manner by utilizing a VDI (virtual device interface) simulated by the virtual machine simulator;
and sending the operation command to the client by utilizing a service module simulated by the virtual machine simulator.
Preferably, the sending the operation command to the client by using the service module simulated by the virtual machine simulator includes:
and sending the operation command to the client through the SPICE protocol by utilizing a service module simulated by the virtual machine simulator.
Preferably, before writing the operation command into the shared memory device by using the operating system, the method further includes:
judging whether the operating system and the service module have network communication connection or not;
if so, sending the operation command to the service module by using the network communication connection, and sending the operation command to a client by using the service module so that the client can perform desktop rendering and display by using the operation command;
and if not, executing the step of writing the operation command into the shared memory equipment by using the operating system.
Preferably, the operation command is a QXL command.
A virtual machine desktop display device, comprising:
a virtual machine simulator and an operating system with a display driver;
the virtual machine simulator is used for simulating a service module and shared memory equipment;
the display driver is used for acquiring the picture change content of the virtual machine, generating an operation command corresponding to the picture change content, and writing the operation command into the shared memory device;
the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to a client so that the client can perform desktop rendering and display by using the operation command.
An electronic device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the virtual machine desktop display method when executing the computer program.
A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described virtual machine desktop display method.
The method provided by the embodiment of the application is applied to the virtual machine and comprises the following steps: acquiring the picture change content of the virtual machine by using an operating system; generating an operation command corresponding to the screen change content by using an operation system; writing an operation command into the shared memory equipment by using an operating system; and the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to the client so that the client can perform desktop rendering and display by using the operation command.
In the application, firstly, an operating system is used for obtaining the screen change content of the virtual machine, generating an operation command corresponding to the screen change content, and writing the operation command into the shared memory device. Then, the service module is used for directly reading the operation command from the shared memory device in a timing or real-time mode and sending the operation command to the client. The client can be enabled to perform desktop rendering and display based on the operation command. Therefore, in the application, the screen change content of the virtual machine can be read from the shared memory device, and the subsequent rendering and display can be realized based on the operation command without additionally simulating the virtual display device, so that the method can be applied to various CPU architectures such as an ARM architecture and an MIPS architecture. Meanwhile, the service module directly reads the operation command from the shared storage device, so as to send the operation command to the client. Thus, the operating system of the virtual machine need not communicate with the service module, nor with the client network. That is, the display image data of the virtual machine is transmitted to the service module through the shared device, and further transmitted to the client by the service module, which has no requirement on the network of the virtual machine itself and the operating system in the virtual machine. Therefore, the desktop display performance of the virtual machine can be improved on the basis of being compatible with various CPU architectures.
Accordingly, embodiments of the present application further provide a device, an apparatus, and a readable storage medium corresponding to the virtual machine desktop display method, which have the technical effects described above and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or related technologies of the present application, the drawings needed to be used in the description of the embodiments or related technologies are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart illustrating an implementation of a method for displaying a desktop of a virtual machine according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating an embodiment of a method for displaying a desktop of a virtual machine;
FIG. 3 is a schematic structural diagram of a virtual machine desktop display device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a method for displaying a desktop of a virtual machine in an embodiment of the present application, where the method may be applied to a virtual machine with any architecture, where the virtual machine includes an operating system and a service module. The method comprises the following steps:
s101, acquiring the screen change content of the virtual machine by using the operating system.
The virtual machine may be any virtual machine virtualized by any physical host by using a virtualization technology.
Specifically, the upper and lower frames of the display screen of the virtual machine can be captured by the operating system, and the display change content can be obtained by a comparison method. For how to capture the display frame of the virtual machine and perform the display frame comparison operation, reference may be made to RDP and VNC, which is not described in detail herein.
In consideration of the above, a large amount of operations are caused by the manner of obtaining the picture change content through the display frame comparison operation, which may affect the desktop display performance of the virtual machine. Preferably, in this embodiment, in order to omit the additional display frame comparison operation, the screen change content may be acquired directly by using the X11 display driver in the virtual machine operating system. In a specific implementation process, acquiring the picture change content of the virtual machine may specifically include: and acquiring the screen change content of the virtual machine by using the X11 display driver. Where X11 is a graphics framework on the Linux system, different display devices can be supported by loading different display drivers.
For ease of understanding, the following explanation is made with respect to x 11.
Generally, for X11, it is composed of xserver and xclient, where xserver manages hardware settings related to display on the host (e.g., video card, hard disk, mouse, etc.), and it is responsible for drawing and displaying screen images and informing xclient of actions of input settings (e.g., keyboard, mouse). An Xclient (i.e., an application) is primarily responsible for the handling of events (i.e., the logic of a program).
For example, if the user clicks the left mouse button, because the mouse is managed by xserver, xserver captures the mouse click action, and then it tells xclient about the action, because xclient is responsible for the program logic, then xclient can tell xserver: please draw a circle at the mouse click position. And finally, responding to the request of the xclient by the xserver, and drawing and displaying a circle at the position clicked by the mouse.
Because the xclient and the xserver can clearly know where the image drawing needs to be carried out, namely the xclient and the xserver can clearly know the picture change content, the picture change content can be directly obtained based on the X11 display drive, so that the display frame comparison operation is omitted, and the desktop display performance of the virtual machine is improved.
In the present application, in order to more quickly and efficiently acquire the screen change content of the virtual machine, a virtual display driver (xspecce) may be added to the X11 display driver. That is to say, acquiring the screen change content of the virtual machine by using the X11 display driver in the operating system may further specifically include: the screen change content of the virtual machine is acquired by using a virtual display driver among the X11 display drivers. Specifically, in this further preferred embodiment, X11 shows that each part in the driver is responsible for the following transactions:
xclient: the application program in the Linux virtual machine is connected to the xserver and then responsible for responding to the operation of the user and updating the picture;
xserver: the display service program in the Linux virtual machine is responsible for transmitting the input event to the xclient and rendering the drawing instruction;
xslice: and the virtual display driver in the xserver is responsible for acquiring the picture change of the virtual machine at regular time or in real time and constructing the picture change into a QXL command to be written into the shared memory device.
That is, the following steps are performed from the generation of the screen inside the virtual machine to the acquisition of the screen change content:
when the xclient program interface changes, sending a drawing instruction to the xserver;
the xserver renders the drawing instruction to form a final virtual machine picture;
and the xspic monitors the change of the virtual machine picture and acquires the picture change content at regular time or in real time.
After the frame change content is obtained, step S102 is executed.
S102, an operation command corresponding to the screen change content is constructed by using the operation system.
The operation command may be specifically a command that the client can render and display the screen change content on its display interface based on the operation command. Wherein the operation command may be a QXL command.
Preferably, in order to effectively recognize and execute the operation command between the virtualized service module and the client, the step S102 constructs the operation command corresponding to the screen change content, which may specifically include generating, by using an operating system, the operation command corresponding to the screen change content and conforming to the virtual display device simulated by the virtual machine simulator.
That is, when generating the operation command, it is necessary to specifically refer to a command format supported by the virtual display device simulated by the virtual simulator.
Preferably, if the virtual display device is a QXL virtual display device, generating a display command and/or a cursor command corresponding to the screen change content and conforming to the QXL virtual display device simulated by the virtual simulator by using the operating system; the display command and/or the cursor command are determined as the operation command. That is, the operation command is a QXL command, specifically, a display command or a cursor command, or both a cursor command and a display command. The QXL virtual display device is a virtual display device under QEMU (quick simulator), and is combined with the drive in the virtual machine, so that efficient display image transmission can be provided.
S103, writing the operation command into the shared memory device by using the operating system.
After the operation command is generated, the operation command may be written to the shared content device.
The shared memory device may be modeled by a virtual simulator, which may be specifically a QUEM. QUEM is a virtual simulator that simulates a physical machine and can provide device simulation such as CPU, memory, disk, network card, etc.
In order to avoid confusion, if N virtual machines are virtualized in one host, and the N virtual machines all participate in the desktop display of the virtual machines, each virtual machine of the N virtual machines may set its corresponding shared memory device.
And S104, reading the operation command from the shared memory device in a timing or real-time manner by using the service module, and sending the operation command to the client so that the client can perform desktop rendering and display by using the operation command.
After the operating system writes the operating command into the shared memory device, the operating command can be read from the shared memory device at regular time or in real time by using the service module, and then the operating command is sent to the client. The client and the service module may specifically communicate based on a port number corresponding to a virtual machine to which the service module belongs and an IP address of a physical host to which the virtual machine belongs.
After receiving the operation command, the client can perform desktop rendering and display by using the operation command.
Preferably, in order to facilitate the service module to read the operation command in the shared storage device, a VDI interface may be simulated by using the virtual machine simulator, so as to be used by the service module in the virtual machine. That is, the step of using the service module simulated by the virtual machine simulator in step S104 to read the operation command from the shared memory device simulated by the virtual machine simulator in a timed or real-time manner may specifically include:
step one, using a VDI interface simulated by a virtual machine simulator to read an operation command from the shared memory device in a timing or real-time manner.
The VDI interface may be specifically an interface provided by xspy-display, and the xspy-display, i.e., QEMU internal module, can provide a VDI interface for spice-server, and can implement reading and releasing operations of a display command and a cursor command in the QXL command.
And step two, the service module simulated by the virtual machine simulator is used for sending the operation command to the client.
Further, in order to improve the transmission efficiency of the service module and the client, the transmission can be performed based on the SPICE protocol. That is, the second step of sending the operation command to the client by using the service module simulated by the virtual machine simulator, may specifically include: and sending the operation command to the client through the SPICE protocol by utilizing the service module simulated by the virtual machine simulator. That is, the service module may be specifically a SPICE-server, which is an SPICE service module running inside QEMU and is responsible for fetching QXL commands and sending the QXL commands to SPICE clients.
Among other things, spice Protocol for Independent Computing environment can be used to deploy virtual desktops on service modules and remote computers such as desktops and thin client devices. It is similar to other rendering protocols for remote desktop management.
The client can be specifically a SPICE-client which is a SPICE client running on the thin client and is responsible for receiving the QXL command sent by the service module, rendering and displaying the QXL command to a user.
In an embodiment of the present application, before step S103 is executed, the virtual machine and the network condition inside the virtual machine may be further determined, so as to determine which display manner is selected. Specifically, the following steps may be performed:
judging whether a network communication connection exists between an operating system and a service module;
if so, sending the operation command to a service module by using network communication connection, and sending the operation command to a client by using the service module so that the client can perform desktop rendering and display by using the operation command;
and step three, if not, executing the step of writing the operation command into the shared memory equipment by using the operating system.
That is, if there is a network communication connection between the operating system and the service module, the operating command can be directly sent to the service module through the network communication connection, and if there is no network communication connection between the operating system and the access module, the steps S103 to S104 are executed.
The method provided by the embodiment of the application is applied to the virtual machine and comprises the following steps: acquiring the picture change content of the virtual machine by using an operating system; generating an operation command corresponding to the screen change content by using an operation system; writing an operation command into the shared memory equipment by using an operating system; and the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to the client so that the client can perform desktop rendering and display by using the operation command.
In the application, firstly, an operating system is used for obtaining the screen change content of the virtual machine, generating an operation command corresponding to the screen change content, and writing the operation command into the shared memory device. Then, the service module is used for directly reading the operation command from the shared memory device in a timing or real-time mode and sending the operation command to the client. The client can be enabled to perform desktop rendering and display based on the operation command. Therefore, in the application, the screen change content of the virtual machine can be read from the shared memory device, and the subsequent rendering and display can be realized based on the operation command without additionally simulating the virtual display device, so that the method can be applied to various CPU architectures such as an ARM architecture and an MIPS architecture. Meanwhile, the service module directly reads the operation command from the shared storage device, so as to send the operation command to the client. Thus, the operating system of the virtual machine need not communicate with the service module, nor with the client network. That is, the display image data of the virtual machine is transmitted to the service module through the shared device, and further transmitted to the client by the service module, which has no requirement on the network of the virtual machine itself and the operating system in the virtual machine. Therefore, the desktop display performance of the virtual machine can be improved on the basis of being compatible with various CPU architectures.
In order to make those skilled in the art better understand the virtual machine desktop display method provided in the embodiments of the present application, the following description is provided for the virtual machine desktop display method in combination with the related art and a specific application scenario of the virtual machine desktop display method.
The remote access virtual machine solutions include SPICE, RDP, VNC, etc., and the following mainly describes the principle of obtaining the display content of the virtual machine and the corresponding disadvantages.
The RDP and the VNC acquire the display content of the virtual machine in a mode that the whole screen content is captured at regular time inside the virtual machine and then compared with the previous captured screen image to find a difference area. The difference area is the area of the screen that needs to be updated at this time. Then the region of the frame image is encoded, compressed and transmitted to the client for display. It can be seen that such schemes as RDP and VNC have: the performance overhead is large: the whole screen content is obtained regularly, and the performance overhead for content comparison is high, which can cause poor user experience; the network of the virtual machine needs to be communicated with the network of the client, that is, the image content intercepted by the RDP and the VNC needs to be sent to the client for rendering through the network.
The SPICE scheme mainly obtains images through QEMU simulated QXL display equipment, the virtual machine internal display driver writes image content needing to be updated into the QXL device, and an SPICE server (the same as the service module in the above) reads display content in the QXL device through an interface provided by QEMU, so that changed display content can be obtained. The SPICE scheme relies on QXL virtual machine equipment of QEMU, and the QXL virtual machine equipment can only be used in a virtual machine under an X86 framework at present and cannot be used in a virtual machine under ARM or MIPS.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating an embodiment of a method for displaying a desktop of a virtual machine.
Wherein, xclient: the application program in the Linux virtual machine is connected to the xserver and then responsible for responding to the operation of the user and updating the picture;
xserver: the display service program in the Linux virtual machine is responsible for transmitting the input event to the xclient and rendering the drawing instruction;
xslice: the virtual display driver in the xserver is responsible for acquiring the picture change of the virtual machine at regular time or in real time and constructing the picture change into a QXL command to be written into the shared memory device;
ivshmem: the shared memory device virtualized by the QEMU is responsible for sharing the QXL command between the Linux virtual machine and the QEMU;
xslice-display: the QEMU internal module provides a VDI interface for the spice-server and realizes the reading and releasing operations of the QXL display command and the cursor command;
spice-server: the SPICE server running inside the QEMU is responsible for taking out the QXL command and sending the QXL command to the SPICE client;
spice-client: and the SPICE client running on the thin client is responsible for receiving the QXL command sent by the server, rendering and displaying the QXL command to the user.
Generating a screen from the inside of the virtual machine to the client display, and going through the following steps:
step 1, when an xclient program interface changes, sending a drawing instruction to an xserver;
step 2, the xserver renders the drawing instruction to form a final virtual machine picture;
step 3, the xspec monitors the change of the virtual machine picture, converts the picture change into a QXL command in a timed or real-time manner and writes the QXL command into the shared memory;
step 4, the spice-server calls an interface provided by the xsspice-display and reads a QXL command in the shared memory;
step 5, the spice-server constructs the QXL command into a message of a display channel and a cursor channel and sends the message to the spice-client;
step 6, reading the channel message sent by the server by the spice-client, and rendering the channel message to the local
Therefore, the method for displaying the desktop of the virtual machine provided by the embodiment of the application can acquire the change of the display content by realizing the X11 virtual display drive, and then transmit the image data through a shared memory device of the QEMU, so that the transmission efficiency of the display data can be remarkably improved and the user experience can be optimized by combining the image data and the QEMU. The main advantages are that:
the compatibility is good: the display driver of the X11 can be used for acquiring changed display contents without extra QEMU simulation of virtual display equipment, and the display driver can be suitable for platforms with various CPU architectures, including chips such as ARM and MIPS.
The performance is high: when the display content is drawn, the X11 only draws the area which needs to be redrawn, and the changed display content can be acquired by the X11 virtual display driver without performing additional display frame comparison operation. Meanwhile, display data can be efficiently transmitted to the server for processing through the QEMU shared memory device.
The network of virtual machines need not communicate with the client network: the display image data of the virtual machine is transmitted to the virtualization platform server through the QEMU sharing device for coding processing, and finally transmitted to the client, and no requirement is made on the network of the virtual machine.
Corresponding to the above method embodiments, the present application further provides a virtual machine desktop display apparatus, and the virtual machine desktop display apparatus described below and the virtual machine desktop display method described above may be referred to in a corresponding manner.
Referring to fig. 3, the virtual machine desktop display apparatus includes:
a virtual machine simulator 101 and an operating system 102 with a display driver 103;
the virtual machine simulator is used for simulating the service module 104 and the shared memory device 105;
the display driver is used for acquiring the picture change content of the virtual machine, generating an operation command corresponding to the picture change content, and writing the operation command into the shared memory device;
and the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to the client so that the client can perform desktop rendering and display by using the operation command.
The device provided by the embodiment of the application is applied to a virtual machine and comprises the following components: acquiring the picture change content of the virtual machine by using an operating system; generating an operation command corresponding to the screen change content by using an operation system; writing an operation command into the shared memory equipment by using an operating system; and the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to the client so that the client can perform desktop rendering and display by using the operation command.
In the application, firstly, an operating system is used for obtaining the screen change content of the virtual machine, generating an operation command corresponding to the screen change content, and writing the operation command into the shared memory device. Then, the service module is used for directly reading the operation command from the shared memory device in a timing or real-time mode and sending the operation command to the client. The client can be enabled to perform desktop rendering and display based on the operation command. Therefore, in the application, the screen change content of the virtual machine can be read from the shared memory device, and the subsequent rendering and display can be realized based on the operation command without additionally simulating the virtual display device, so that the method can be applied to various CPU architectures such as an ARM architecture and an MIPS architecture. Meanwhile, the service module directly reads the operation command from the shared storage device, so as to send the operation command to the client. Thus, the operating system of the virtual machine need not communicate with the service module, nor with the client network. That is, the display image data of the virtual machine is transmitted to the service module through the shared device, and further transmitted to the client by the service module, which has no requirement on the network of the virtual machine itself and the operating system in the virtual machine. Therefore, the desktop display performance of the virtual machine can be improved on the basis of being compatible with various CPU architectures.
In an embodiment of the present application, the display driver is specifically an X11 display driver, that is, the virtual machine desktop display device acquires the screen change content of the virtual machine by using the X11 display driver. Further, the screen change content of the virtual machine is acquired by using a virtual display driver among the X11 display drivers.
In a specific embodiment of the present application, an operating system is used to generate an operating command corresponding to a frame change content and conforming to a virtual display device simulated by a virtual machine simulator; and utilizing the service module simulated by the virtual machine simulator to read the operation command from the shared memory device simulated by the virtual machine simulator in a timing or real-time manner.
In a specific embodiment of the application, an operating system is utilized to generate a display command and/or a cursor command which is in accordance with QXL virtual display equipment simulated by a virtual machine simulator and corresponds to the picture change content; the display command and/or the cursor command are determined as the operation command.
In a specific embodiment of the present application, a VDI interface simulated by a virtual machine simulator is used to read an operation command from a shared memory device in a timed or real-time manner; and sending the operation command to the client by using the service module simulated by the virtual machine simulator.
In one embodiment of the present application, the service module simulated by the virtual machine simulator is used to send the operation command to the client through the SPICE protocol.
In a specific embodiment of the present application, it is determined whether a network communication connection exists between an operating system and a service module;
if so, sending the operation command to the service module by using the network communication connection, and sending the operation command to the client by using the service module so that the client can perform desktop rendering and display by using the operation command;
and if not, executing the step of writing the operation command into the shared memory device by using the operating system.
In one embodiment of the present application, the operation command is a QXL command.
Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device, and the electronic device described below and the virtual machine desktop display method described above may be referred to in a corresponding manner.
Referring to fig. 4, the electronic device includes:
a memory 332 for storing a computer program;
and a processor 322, configured to implement the steps of the virtual machine desktop display method of the foregoing method embodiment when executing the computer program.
Specifically, referring to fig. 5, a specific structural diagram of an electronic device provided in this embodiment is shown, where the electronic device may generate a larger difference due to different configurations or performances, and may include one or more processors (CPUs) 322 (e.g., one or more processors) and a memory 332, where the memory 332 stores one or more computer applications 342 or data 344. Memory 332 may be, among other things, transient or persistent storage. The program stored in memory 332 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a data processing device. Still further, the central processor 322 may be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electronic device 301.
The electronic device 301 may also include one or more power sources 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341.
The steps in the virtual machine desktop display method described above may be implemented by the structure of the electronic device.
Corresponding to the above method embodiment, an embodiment of the present application further provides a readable storage medium, and a readable storage medium described below and a virtual machine desktop display method described above may be referred to in correspondence.
A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the virtual machine desktop display method of the above-described method embodiment.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

Claims (12)

1. A virtual machine desktop display method is applied to a virtual machine and comprises the following steps:
acquiring the picture change content of the virtual machine by using an operating system;
generating an operation command corresponding to the screen change content by using the operation system;
writing the operation command into a shared memory device by using the operation system;
and reading the operation command from the shared memory device in a timing or real-time manner by using a service module, and sending the operation command to a client so that the client can perform desktop rendering and display by using the operation command.
2. The method for displaying the desktop of the virtual machine according to claim 1, wherein the obtaining, by using the operating system, the screen change content of the virtual machine includes:
and acquiring the screen change content of the virtual machine by using an X11 display driver in the operating system.
3. The method for displaying the desktop of the virtual machine according to claim 2, wherein the obtaining of the screen change content of the virtual machine by using an X11 display driver in the operating system comprises:
and acquiring the picture change content of the virtual machine by using a virtual display driver in the X11 display driver.
4. The method for displaying the desktop of the virtual machine according to claim 1, wherein the generating, by the operating system, the operation command corresponding to the screen change content includes:
generating an operation command which is in accordance with virtual display equipment simulated by a virtual machine simulator and corresponds to the picture change content by utilizing the operation system;
correspondingly, the reading the operation command from the shared memory device in a timing or real-time manner by using the service module includes:
and utilizing the service module simulated by the virtual machine simulator to read the operation command from the shared memory equipment simulated by the virtual machine simulator in a timing or real-time manner.
5. The method according to claim 4, wherein the generating, by the operating system, the operation command corresponding to the screen change content and conforming to the virtual display device simulated by the virtual machine simulator includes:
generating a display command and/or a cursor command which is in accordance with QXL virtual display equipment simulated by the virtual machine simulator and corresponds to the picture change content by utilizing the operating system;
determining the display command and/or the cursor command as the operation command.
6. The method as claimed in claim 4, wherein the reading the operation command from the shared memory device simulated by the virtual machine simulator in real time or periodically by using the service module simulated by the virtual machine simulator comprises:
reading the operation command from the shared memory device in a timing or real-time manner by utilizing a VDI (virtual device interface) simulated by the virtual machine simulator;
and sending the operation command to the client by utilizing a service module simulated by the virtual machine simulator.
7. The method for displaying the desktop of the virtual machine according to claim 6, wherein the sending the operation command to the client by using the service module simulated by the virtual machine simulator comprises:
and sending the operation command to the client through the SPICE protocol by utilizing a service module simulated by the virtual machine simulator.
8. The method according to claim 1, further comprising, before writing the operation command to the shared memory device using the operating system:
judging whether the operating system and the service module have network communication connection or not;
if so, sending the operation command to the service module by using the network communication connection, and sending the operation command to a client by using the service module so that the client can perform desktop rendering and display by using the operation command;
and if not, executing the step of writing the operation command into the shared memory equipment by using the operating system.
9. The virtual machine desktop display method of claim 1, wherein the operation command is a QXL command.
10. A virtual machine desktop display apparatus, comprising:
a virtual machine simulator and an operating system with a display driver;
the virtual machine simulator is used for simulating a service module and shared memory equipment;
the display driver is used for acquiring the picture change content of the virtual machine, generating an operation command corresponding to the picture change content, and writing the operation command into the shared memory device;
the service module is used for reading the operation command from the shared memory device in a timing or real-time manner and sending the operation command to a client so that the client can perform desktop rendering and display by using the operation command.
11. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the virtual machine desktop display method according to any one of claims 1 to 9 when executing said computer program.
12. A readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the steps of the virtual machine desktop display method according to any one of claims 1 to 9.
CN202111145956.7A 2021-09-28 2021-09-28 Virtual machine desktop display method, device, equipment and readable storage medium Pending CN113835816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111145956.7A CN113835816A (en) 2021-09-28 2021-09-28 Virtual machine desktop display method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111145956.7A CN113835816A (en) 2021-09-28 2021-09-28 Virtual machine desktop display method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN113835816A true CN113835816A (en) 2021-12-24

Family

ID=78967186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111145956.7A Pending CN113835816A (en) 2021-09-28 2021-09-28 Virtual machine desktop display method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113835816A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562794A (en) * 2022-12-07 2023-01-03 天津卓朗昆仑云软件技术有限公司 Virtual desktop system and virtual desktop implementation method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007977A (en) * 2019-04-18 2019-07-12 山东超越数控电子股份有限公司 One kind improving SPICE video broadcasting method based on feedback frame losing algorithm

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007977A (en) * 2019-04-18 2019-07-12 山东超越数控电子股份有限公司 One kind improving SPICE video broadcasting method based on feedback frame losing algorithm

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李博: "基于SPICE协议的桌面虚拟化客户端的设计与实现", 《硕士电子期刊》, pages 25 - 37 *
杨荣尊: "Linux***下的虚拟桌面显示协议实现", 《电子世界》, pages 128 - 132 *
邓丽萍: "基于Spice协议分块图像缓存优化设计与分析", 《福建教育学院学报》, no. 4, pages 120 - 125 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562794A (en) * 2022-12-07 2023-01-03 天津卓朗昆仑云软件技术有限公司 Virtual desktop system and virtual desktop implementation method
CN115562794B (en) * 2022-12-07 2023-03-10 天津卓朗昆仑云软件技术有限公司 Virtual desktop system and implementation method of virtual desktop

Similar Documents

Publication Publication Date Title
US20170323418A1 (en) Virtualized gpu in a virtual machine environment
US9189261B2 (en) Saving, transferring and recreating GPU context information across heterogeneous GPUs during hot migration of a virtual machine
CN111433743B (en) APP remote control method and related equipment
JP6092381B2 (en) Method, system, and computer-readable storage medium for providing access to a remote application via a web client
US8762544B2 (en) Selectively communicating data of a peripheral device to plural sending computers
US8654134B2 (en) Command remoting
US8872835B2 (en) Prevention of DoS attack by a rogue graphics application
US9235452B2 (en) Graphics remoting using augmentation data
JP2008526107A (en) Using graphics processors in remote computing
CN104660687A (en) Realization method and system for virtual desktop display
CN111240631A (en) Method and system for virtually transmitting Linux virtual machine screen picture based on AMD display card
US20140108940A1 (en) Method and system of remote communication over a network
CN106797398B (en) For providing the method and system of virtual desktop serve to client
CN108762934B (en) Remote graphic transmission system and method and cloud server
EP3605327B1 (en) Method and apparatus for capturing screenshots of guest operating system in computer device
CN108733602B (en) Data processing
US9460481B2 (en) Systems and methods for processing desktop graphics for remote display
CN113835816A (en) Virtual machine desktop display method, device, equipment and readable storage medium
CN113778593A (en) Cloud desktop control method and device, electronic equipment, storage medium and program product
US20150145876A1 (en) Graphics Data Processing Method, Apparatus, and System
CN104717175A (en) Virtual desktop processing method and system
KR20170105317A (en) Method for transmitting screen of virtual machine using graphic procedding unit based on hardware and apparatus using the same
CN114028801A (en) User input method, device, equipment and storage medium based on cloud
CN114610259A (en) Data transmission system, method, service system, device and storage medium
KR20160041353A (en) Apparatus for processing data based on virtual desktop and method for the same

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