Remote control method, system and computing device of virtual machine

Remote control of virtual machines is achieved through Apache Guacamole, which uses browsers and message queues for communication. This solves the problems of cumbersome operation and security risks of traditional virtual machine clusters and achieves efficient and secure remote control.

CN113391876BActive Publication Date: 2025-09-16BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010177661.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-13
Publication Date
2025-09-16
Estimated Expiration
2040-03-13

AI Technical Summary

Technical Problem

Traditional virtual machine cluster operation requires repeated server logins, which is cumbersome and poses security risks, and cannot achieve efficient and convenient remote control.

Method used

A clientless remote desktop gateway based on Apache Guacamole is used to receive user instructions through the browser, and use message queue communication to directly control the virtual machine on the node server, realizing remote power on and off operations without logging into the server.

Benefits of technology

It improves the convenience and security of remote control, reduces direct operations on the server, and is suitable for efficient management of virtual machine clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113391876B_ABST
    Figure CN113391876B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, and computing device for remotely controlling a virtual machine. The method is implemented based on a clientless remote desktop gateway and includes: a browser receiving a first control instruction triggered by a user and containing a virtual machine identifier of a target virtual machine and a first control operation identifier, and sending the first control instruction to a remote desktop gateway backend; a remote desktop gateway client is loaded in the browser; the remote desktop gateway backend sends the first control instruction to a node server via a message queue, so that the node server controls the target virtual machine to perform a first control operation based on the virtual machine identifier and the first control operation identifier. Through the above method, a user can remotely control a virtual machine deployed on a node server through a browser; and the backend directly communicates with the node server via a message queue to remotely control the virtual machine, thereby remotely controlling the virtual machine without logging into the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a remote control method and system for a virtual machine, and a computing device. Background Art

[0002] A virtual machine cluster is implemented by deploying virtual machines on two or more servers. These servers are connected so that they appear as a single computer to clients. This allows for the creation of highly available applications. However, operators often need to operate individual virtual machines in the cluster, such as turning them on and off. Traditionally, operating a virtual machine cluster requires operators to log in to the server hosting the virtual machine on their local machine, locate the virtual machine path, and then start the virtual machine process.

[0003] However, the above operation method has at least the following problems: First, in a virtual machine cluster, it is necessary to repeatedly log in to the server where the virtual machine is located to control the virtual machines deployed on the server, which is cumbersome; second, the local machine used by the staff must be connected to the server network where the virtual machine is located; third, the method of logging into the server exposes the access method of the server, which poses the risk of misoperation of the server. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a remote control method, system, and computing device for a virtual machine that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of an embodiment of the present invention, a method for remotely controlling a virtual machine is provided. The method is implemented based on a clientless remote desktop gateway and includes:

[0006] The browser receives a first control instruction triggered by a user and sends the first control instruction to a remote desktop gateway backend; wherein the first control instruction includes a virtual machine identifier of a target virtual machine and a first control operation identifier, and the browser is loaded with a remote desktop gateway client;

[0007] The remote desktop gateway backend sends the first control instruction to the node server through a message queue, so that the node server controls the target virtual machine to perform the first control operation according to the virtual machine identifier and the first control operation identifier.

[0008] According to another aspect of an embodiment of the present invention, a remote control system for a virtual machine is provided. The system is implemented based on a clientless remote desktop gateway and includes:

[0009] A browser, adapted to receive a first control instruction triggered by a user and send the first control instruction to a remote desktop gateway backend; wherein the first control instruction includes a virtual machine identifier of a target virtual machine and a first control operation identifier, and a remote desktop gateway client is loaded in the browser;

[0010] The remote desktop gateway backend is adapted to send the first control instruction to the node server via a message queue;

[0011] The node server is adapted to control the target virtual machine to perform a first control operation according to the virtual machine identifier and the first control operation identifier.

[0012] According to another aspect of an embodiment of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0013] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned remote control method of the virtual machine.

[0014] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned remote control method for a virtual machine.

[0015] According to an embodiment of the present invention, a method, system, and computing device for remotely controlling a virtual machine loads a guacamole client in a web browser. When a user triggers a first control instruction through the browser, the first control instruction is sent to the guacamole server connected to the loaded guacamole client. The guacamole server then forwards the first control instruction to a node server via a message queue, enabling the node server to control the target virtual machine deployed thereon to perform a first control operation based on the first control instruction, thereby controlling state changes such as powering on and off the virtual machine. Thus, in this embodiment, a user can use a browser as a portal and, based on message queue communication between the guacamole server and the node server, send the first control instruction to the node server and control operations such as powering on and off the virtual machine. This simple and reliable control process is also simple. Furthermore, this control process does not rely on network connectivity between the local machine and the node server, thereby improving the convenience of remote control. Furthermore, since logging into the node server is not required, the access method of the node server is not exposed, which helps ensure the security of the node server. Furthermore, in the case of a virtual machine cluster, repeated logging into each node server is not required, further improving the convenience of remote control.

[0016] The above description is only an overview of the technical solutions of the embodiments of the present invention. In order to more clearly understand the technical means of the embodiments of the present invention, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present invention more obvious and easy to understand, the specific implementation methods of the embodiments of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the embodiments of the present invention. The same reference numerals are used throughout the accompanying drawings to denote the same components. In the accompanying drawings:

[0018] Figure 1 A flowchart of a remote control method for a virtual machine provided by an embodiment of the present invention is shown;

[0019] Figure 2 A flowchart of a remote control method for a virtual machine provided by another embodiment of the present invention is shown;

[0020] Figure 3 The following is an effect diagram of a desktop image of a target virtual machine displayed in a browser in a specific example;

[0021] Figure 4 A schematic diagram showing a control architecture in a specific embodiment of the present invention is shown;

[0022] Figure 5 A schematic diagram showing the structure of a remote control system for a virtual machine provided by an embodiment of the present invention is shown;

[0023] Figure 6 A schematic structural diagram of a computing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0024] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0025] Figure 1A flowchart of a method for remotely controlling a virtual machine, provided by an embodiment of the present invention, is shown. This method is implemented based on Apache Guacamole (a clientless remote desktop gateway), which supports standard protocols such as VNC, RDP, and SSH. Guacamole is installed on the server, allowing access to the remote desktop through a web browser. This method enables users to remotely control virtual machines, such as turning them on and off, using a browser on their local machine.

[0026] like Figure 1 As shown, the method includes the following steps:

[0027] Step S110: The browser receives a first control instruction triggered by the user and sends the first control instruction to the remote desktop gateway backend; wherein the first control instruction includes the virtual machine identifier of the target virtual machine and the first control operation identifier, and the remote desktop gateway client is loaded in the browser.

[0028] Before implementing the embodiments of the present invention, it is necessary to install Apache Guacamole, which includes loading the guacamole client (remote desktop gateway client) in a web browser, and installing the guacamole server (remote desktop gateway backend) and guacamole proxy (also known as guacd, a native application of the remote desktop gateway). It should be noted that the above-mentioned method of installing Apache Guacamole can adopt any existing feasible method, and the present invention will not elaborate on this.

[0029] The guacamole client is implemented in JavaScript. Once loaded into a user's web browser, it immediately connects to the guacamole server. Interactions between the guacamole client and the server are accomplished using the guacamole protocol over HTTP.

[0030] Specifically, a browser loaded with the Guacamole client (an HTML5-enabled web browser) connects to the Guacamole server. When a user, i.e., a staff member, triggers a first control instruction through the web browser on their local machine, the first control instruction is sent to the Guacamole server via the established connection. The first control instruction carries a virtual machine identifier that indicates the target virtual machine to be controlled, and a first control operation identifier that indicates the type of first control operation to be performed on the target virtual machine. Furthermore, the first control operation primarily includes operations that control virtual machine state changes, such as power on / off, rollback, and other operations.

[0031] Step S120: The remote desktop gateway backend sends the first control instruction to the node server through a message queue, so that the node server controls the target virtual machine to perform the first control operation according to the virtual machine identifier and the first control operation identifier.

[0032] There may be one or more node servers. In a scenario where virtual machines in a virtual machine cluster are controlled, there are multiple node servers. At least one virtual machine is deployed on each node server.

[0033] The guacamole server directly communicates with the node server where the virtual machine resides via a message queue. Upon receiving the first control instruction, the guacamole server forwards the first control instruction to the node server via the message queue. The node server determines the target virtual machine based on the virtual machine identifier in the first control instruction and controls the target virtual machine to perform the first control operation based on the first control operation identifier.

[0034] For example, the first control instruction carries a virtual machine identifier of 001, and the first control operation identifier is open. After receiving the first control instruction, the node server controls the target virtual machine 001 deployed thereon to perform a power-on operation.

[0035] According to the remote control method for a virtual machine provided by this embodiment, a guacamole client is loaded in a web browser. When a user triggers a first control instruction through the browser, the first control instruction is sent to the guacamole server connected to the loaded guacamole client. The guacamole server then forwards the first control instruction to the node server via a message queue, so that the node server can control the target virtual machine deployed on it to perform a first control operation based on the first control instruction, thereby controlling the virtual machine's state changes, such as powering on and off. Thus, in this embodiment, the user can use the browser as the entry point and, based on the message queue communication between the guacamole server and the node server, send the first control instruction to the node server and control the virtual machine's power on and off, etc., making the control process simple and reliable. Furthermore, this control process does not rely on network connectivity between the local machine and the node server, thereby improving the convenience of remote control. Furthermore, since there is no need to log in to the node server, the access method of the node server is not exposed, which helps ensure the security of the node server. Furthermore, in the case of a virtual machine cluster, there is no need to repeatedly log in to each node server, further improving the convenience of remote control.

[0036] Figure 2 A flowchart of a remote control method for a virtual machine provided by another embodiment of the present invention is shown. The method is implemented based on Apache Guacamole. Figure 2 As shown, the method includes the following steps:

[0037] Step S210: The browser receives a first control instruction triggered by the user and sends the first control instruction to the remote desktop gateway backend; wherein the first control instruction includes the virtual machine identifier of the target virtual machine and the first control operation identifier, and the remote desktop gateway client is loaded in the browser.

[0038] A browser loaded with the Guacamole client can receive user-triggered commands for remotely controlling a virtual machine and send the received commands to the Guacamole server for subsequent control of the virtual machine. In this embodiment, the commands received by the browser include first control commands for controlling state changes such as powering on and off the virtual machine, and second control commands for manipulating the desktop image of the powered-on virtual machine (for a detailed description of the second control commands, see step S240 below).

[0039] After receiving the first control instruction, the browser sends the first control instruction to the guacamole server, so that the guacamole server controls the virtual machine to perform the first control operation through direct communication with the node server. The first control operation indicated by the first control operation identifier carried in the first control instruction includes any operation that controls a change in the state of the virtual machine. In some optional embodiments, the first control operation includes a power-on operation, a power-off operation, a rollback operation, and / or a snapshot operation. It should be noted that the present invention does not limit the specific method by which a user triggers the first control instruction. Optionally, the user can trigger the first control instruction by clicking the first control operation control of the target virtual machine, or the user can trigger the first control instruction by entering the virtual machine identifier and the second control operation identifier.

[0040] In some optional embodiments of the present invention, the first control instruction is triggered via a virtual machine management list maintained in a Guacamole server. In these optional embodiments, the Guacamole server maintains a virtual machine management list, which can be presented on a browser page via a virtual machine management page. The virtual machine management list records at least one of the following information: virtual network console port information (i.e., VNC port information), operating system information, serial number information, status information, number of snapshots, storage size information, last used time, remote connection control, and a first control operation control. The status information reflects the virtual machine's power on / off status, the storage size information reflects the virtual machine's storage space size (e.g., 1GB), the remote connection control triggers connecting to the virtual machine's remote desktop via Apache Guacamole, and the first control operation control triggers the first control instruction. One or more of these first control operation controls can be set depending on the type of the first control operation, for example, a power on control, a power off control, or a snapshot control. Table 1 below shows an example of two pieces of data in the virtual machine management list.

[0041] 1 5430 Windows 10 16299 x64 vt v60 1 21 2 5415 Windows 10 16299 x86 v30 2 17

[0042] Continued:

[0043] 2019-9-11 12:59:10 connect Startup / shutdown / snapshot / rollback 2019-9-11 11:30:31 connect Startup / shutdown / snapshot / rollback

[0044] In Table 1 above, the first column represents the row number; the second column represents the virtual machine VNC port information, where the virtual machine VNC port on each node server is unique; the third column represents the virtual machine name, which further includes operating system information and virtual machine serial number information. A node server may deploy multiple virtual machines with the same operating system, and the multiple virtual machines can be distinguished by the virtual machine serial number information; the fourth column represents the virtual machine status information, STATUS_VM_CLOSE represents that the virtual machine is not powered on, and STATUS_VM_OPEN represents that the virtual machine is powered on; the fifth column represents the number of snapshots of the virtual machine; the sixth column represents the size of the virtual machine, in G; the seventh column represents the last time the virtual machine was used; the eighth column represents the operation control for remote connection operations; and the ninth column represents the operation control for remote power on, power off, snapshot, rollback, and other operations of the virtual machine, that is, the first control operation control.

[0045] Furthermore, the guacamole server maintains a virtual machine management list, which can be used to browse virtual machine information and trigger operations such as remote connection, startup, shutdown, snapshot, and rollback on virtual machines. Specifically, the browser sends a management list retrieval request to the guacamole server and displays the virtual machine management list returned by the guacamole server in response to the management list retrieval request on the browser page. The browser requests the virtual machine management list from the guacamole server based on the URL of the virtual machine management page input by the user. The guacamole server returns page information of the virtual machine management page to the browser, and the browser renders and displays the page information based on the page information, presenting the virtual machine management page to the user. Accordingly, the browser receiving a first control instruction triggered by the user specifically includes: the browser receiving the first control instruction triggered by the user operating a first control control in the virtual machine management list, wherein the virtual machine identifier carried in the first control instruction is the name of the virtual machine in the row where the first control control is located, and the first control operation identifier is the identifier corresponding to the first control operation control, for example, a startup identifier corresponding to a startup identifier of open, and a shutdown identifier corresponding to a shutdown identifier of close.

[0046] For example, the user clicks the power-on control in the ninth column of the first row in Table 1 to trigger a remote power-on control operation on the target virtual machine Windows 1016299 x86 v30.

[0047] In the above-mentioned method of triggering the first control instruction through the virtual machine management list maintained in the guacamole server, the user can trigger the control instruction by clicking the corresponding control, which improves the convenience of triggering the control instruction and does not require the user to edit the request information.

[0048] Furthermore, in the aforementioned optional embodiment in which the first control instruction is triggered via the virtual machine management list maintained by the guacamole server, the guacamole server updates the state information, snapshot count, last used time, and / or operability information of the first control operation control in the virtual machine management list based on historically executed first control operations. The guacamole server updates the list information in the virtual machine management list in real time, wherein the operability information of the first control operation control is determined based on the operability information of the first control operation control before the most recent execution of the first control operation, combined with the type of the most recently executed first control operation. For example, for the Windows 10 16299x86 v30 virtual machine in Table 1, if the startup control is enabled and the shutdown control is disabled, then after executing the startup control operation on this virtual machine, the startup control must be updated to disabled and the shutdown control to enabled.

[0049] Embodiments of the present invention provide remote control of virtual machines, particularly for virtual machine clusters. This eliminates the need for repeated logins to node servers, significantly improving control convenience. In some optional embodiments of the present invention, the backend program behind the remote desktop gateway is reconstructed using the Python asynchronous, non-blocking framework Tornado. In other words, Guacamole Server is implemented using the Python asynchronous, non-blocking framework Tornado. In these optional embodiments, the native Java-implemented Guacamole Server is reconstructed using the Python asynchronous, non-blocking framework Tornado. Compared to multithreading, Tornado implements asynchronous access through coroutines, resulting in significantly higher execution efficiency. Furthermore, the greater the number of threads, the more significant the performance advantage of coroutines. By reconstructing the Guacamole Server using Tornado, the reconstructed Guacamole Server can support high concurrency, making it more suitable for use in high-concurrency virtual machine cluster scenarios. The CPU usage of the Guacamole Server is also significantly reduced by up to 50%.

[0050] Step S220: The remote desktop gateway backend sends the first control instruction to the node server via a message queue.

[0051] The guacamole server directly communicates with each node server involved in the virtual machine cluster through a message queue, and forwards the first control instruction to the node server through the message queue. This process does not require logging into the node server or directly operating the node server.

[0052] In some optional embodiments of the present invention, the process of communicating between the guacamole server and each node server via a message queue is as follows: a listening service is deployed on the node server, and the guacamole server sends the first control instruction to the listening service via a message queue. The message queue may be ZeroMQ (a message queue library, or ZMQ) to achieve high concurrency and high availability. Accordingly, the guacamole server sends the first control instruction to the listening service via ZMQ.

[0053] For example, when a user clicks on a virtual machine through a browser to start the operation, guacamoleserver will send the virtual machine ID and operation name of the virtual machine to the listening service through a message.

[0054] Step S230: the node server controls the target virtual machine to perform a first control operation according to the virtual machine identifier and the first control operation identifier.

[0055] The node server determines a target virtual machine to be controlled based on a virtual machine identifier, such as a virtual machine name, and then performs a first control operation corresponding to a first control operation identifier on the target virtual machine through a virtual machine operation interface provided by the target virtual machine. In an embodiment where a monitoring service is deployed on the node server, upon receiving the first control instruction, the monitoring service invokes the operation interface of the target virtual machine based on the virtual machine identifier and performs the first control operation corresponding to the first operation identifier.

[0056] At this point, by executing steps S210 to S230 above, the user triggers the first control instruction through the browser, and based on the direct communication between guacamoleserver and the node server established via a message queue, remote control of virtual machines deployed on the node server, such as powering on and off, can be achieved. However, when actually remotely controlling a virtual machine, simply performing operations such as powering on and off, taking snapshots, and rolling back the virtual machine is far from sufficient. Based on this, in an embodiment of the present invention, a second control operation is further performed on the virtual machine through the following step S240, where the second control operation refers to an operation performed on the desktop image of the powered-on target virtual machine, such as clicking a desktop icon or closing a running application.

[0057] Step S240: After controlling the target virtual machine to be in a powered-on state, performing a second control operation on the target virtual machine through the native application of the remote desktop gateway.

[0058] Specifically, after the power-on control operation in the first control operation is performed on the target virtual machine through the aforementioned steps, and the target virtual machine is in the power-on state, the desktop image of the target virtual machine is obtained and the second control operation is performed by relying on the connection between the guacamoleproxy in Apache guacamole and the target virtual machine.

[0059] Furthermore, the guacamole proxy establishes a VNC connection with the target virtual machine based on a connection request from the target virtual machine. The connection request is initiated by a user through a browser and forwarded to the guacamole proxy by the guacamole server. The connection request includes the VNC port information of the target virtual machine, with one VNC connection corresponding to each virtual machine. Furthermore, the guacamole proxy translates the Guacamole protocol data forwarded by the guacamole server into data from protocols such as RDP and VNC, and connects to the target virtual machine corresponding to the VNC port information carried in the connection request as a client. More specifically, the connection request is initiated by a user operating the remote connection control for the target virtual machine in the virtual machine management list. The user requests the virtual machine management page from the guacamole server through a browser and, on the virtual machine management page displayed by the browser, operates the remote connection control for the target virtual machine in the virtual machine management list (such as the control in the eighth column of Table 1), thereby initiating the connection request. Furthermore, the connection request automatically includes the VNC port information of the target virtual machine, without requiring user input.

[0060] After the guacamole proxy establishes a VNC connection with the target virtual machine in response to the connection request, the guacamole proxy receives the desktop image sent by the target virtual machine via the VNC connection and distributes it to the browser for rendering and display via the guacamole server. The target virtual machine sends the desktop image via the VNC connection to the guacamole proxy, which compresses the desktop image and passes it to the guacamole server. The guacamole server then distributes the desktop image to the browser that triggered the connection request for rendering and display. At this point, the target virtual machine's desktop image is displayed on the browser page, allowing the user to perform a second control operation on the desktop image within the browser page. Figure 3 FIG shows an effect diagram of the desktop image of the target virtual machine displayed in a browser in a specific example. Figure 3 As shown, the desktop image of the target virtual machine is completely displayed on the browser page, and the desktop image includes multiple desktop files.

[0061] After the desktop image is displayed in the browser, the browser receives a second user control operation on the desktop image, encapsulates the second control operation into a second control instruction, and forwards it to the guacamole proxy via the guacamole server. The second control instruction is a guacamole instruction (remote desktop gateway instruction). The guacamole proxy translates the second control instruction into a VNC instruction, which it then sends to the target virtual machine to control the target virtual machine to perform the control operation corresponding to the second control operation. The user manipulates the desktop image using a mouse, keyboard, or other touch-sensitive method. The browser encapsulates the user manipulation into a guacamole instruction using JavaScript and sends it to the guacamole server. The guacamole server then forwards the guacamole instruction to the guacamole proxy. The guacamole proxy translates the guacamole instruction into a VNC instruction and transmits it to the target virtual machine. The target virtual machine can then perform the corresponding mouse and keyboard operations.

[0062] After step S240, a VNC connection is established with the target virtual machine via the guacamole proxy, and the desktop image sent by the target virtual machine is received. The desktop image is then displayed in the browser. The user can manipulate the displayed desktop image to trigger the second control instruction. By sequentially connecting the guacamole client, the guacamole server, the guacamole proxy, and the target virtual machine, remote control of the desktop image of the target virtual machine can be achieved.

[0063] In order to facilitate understanding of the control principles of the first control instruction and the second control instruction, the control architecture in a specific embodiment of the present invention is used for illustration below. Figure 4 FIG. 1 shows a schematic diagram of a control architecture in a specific embodiment of the present invention. Figure 4As shown, after loading the guacamole client in a browser and installing the guacamole server and guacamole proxy, on the one hand, the web browser can establish a connection with the backend (i.e., guacamoleserver), and after the backend establishes direct communication with the node server via a message queue, the communication between the web browser, the backend, and the node server can be relied upon to implement a first control instruction initiated from the web browser to control the state of the virtual machine deployed on the node server, such as powering on and off. On the other hand, relying on the sequential connections between the guacamoleclient, the guacamole server, the guacamole proxy (i.e., the native application in the figure), and the target virtual machine, a connection request is initiated from the web browser to obtain the desktop image of the target virtual machine. After obtaining the desktop image, a second control instruction can be further initiated from the web browser to perform a second control operation on the desktop image.

[0064] According to the remote control method for a virtual machine provided by this embodiment, by loading the guacamoleclient in a browser and installing the guacamole server and guacamole proxy, a user can trigger a first control instruction for a target virtual machine in the browser, thereby completing a first control operation on the target virtual machine. Furthermore, when the user initiates a connection request in the browser, the guacamole proxy establishes a VNC connection with the target virtual machine and obtains a desktop image sent by the target virtual machine based on the VNC connection, which is then displayed in the browser. Based on the desktop image displayed in the browser, a second control instruction can be triggered, thereby completing a second control operation on the desktop image of the target virtual machine. Furthermore, both the first control instruction and the connection request can be initiated by manipulating the virtual machine management list, without requiring the user to enter request information. Furthermore, by reconfiguring the guacamole server using Tornado, it can adapt to high-concurrency scenarios in virtual machine clusters. Thus, this embodiment allows users to operate remote virtual machines by accessing the browser, eliminating the need for repeated server logins, thereby improving control efficiency. Furthermore, it prevents users from directly operating the server and exposes the server's access method. Furthermore, access to virtual machines is not restricted by the server's network segment, enabling flexible access.

[0065] Figure 5 FIG. 1 shows a schematic diagram of the structure of a remote control system for a virtual machine provided by an embodiment of the present invention. Figure 5 As shown, the system includes:

[0066] The browser 510 is adapted to receive a first control instruction triggered by a user and send the first control instruction to a remote desktop gateway backend; wherein the first control instruction includes a virtual machine identifier of a target virtual machine and a first control operation identifier, and the remote desktop gateway client is loaded in the browser;

[0067] The remote desktop gateway backend 520 is adapted to send the first control instruction to the node server via a message queue;

[0068] The node server 530 is adapted to control the target virtual machine to perform a first control operation according to the virtual machine identifier and the first control operation identifier.

[0069] In an optional manner, the first control operation includes a power-on operation, a power-off operation, a rollback operation and / or a snapshot operation.

[0070] In an optional manner, the system further includes: a reconstruction module, adapted to reconstruct the background program of the remote desktop gateway background through the Python asynchronous non-blocking framework Tornado.

[0071] In an optional manner, a listening service is deployed on the node server; the remote desktop gateway backend is further adapted to: send the first control instruction to the listening service via a message queue, so that the listening service calls the operation interface of the target virtual machine according to the virtual machine identifier, and executes the first control operation corresponding to the first operation identifier.

[0072] In an optional manner, the remote desktop gateway backend is further adapted to: send the first control instruction to the monitoring service through a message queue processing library.

[0073] In an optional manner, a virtual machine management list is maintained in the background of the remote desktop gateway; the virtual machine management list records at least one of the following information: virtual network console port information, operating system information, serial number information, status information, number of snapshots, storage size information, last usage time, remote connection control, and first control operation control.

[0074] In an optional manner, the system further includes:

[0075] An acquisition module, adapted for the browser to send a management list acquisition request to the remote desktop gateway backend, and display the virtual machine management list returned by the remote desktop gateway backend according to the management list acquisition request on the browser page;

[0076] The browser is further adapted to receive a first control instruction triggered by a user operating a first control operation control in the virtual machine management list.

[0077] In an optional manner, the remote desktop gateway backend is further adapted to update the status information, number of snapshots, last usage time and / or operable information of the first control operation control in the virtual machine management list according to the first control operation executed historically.

[0078] In an optional manner, the system further includes:

[0079] A remote desktop gateway native application is adapted to establish a virtual network console connection with a target virtual machine in response to a connection request from the target virtual machine; the connection request includes virtual network console port information of the target virtual machine; receive a desktop image sent by the target virtual machine via the virtual network console connection, and distribute the desktop image to a browser for rendering and display via a remote desktop gateway backend; and translate the second control instruction to obtain a virtual network console instruction, and send the virtual network console instruction to the target virtual machine to control the target virtual machine to perform a control operation corresponding to the second control operation;

[0080] The browser is further adapted to receive a second control operation of the user on the desktop image, encapsulate the second control operation into a second control instruction and forward it to the remote desktop gateway native application via the remote desktop gateway backend; the second control instruction is a remote desktop gateway instruction.

[0081] An embodiment of the present invention provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the remote control method of a virtual machine in any of the above method embodiments.

[0082] Figure 6 The schematic diagram of the structure of the computing device provided by the embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computing device.

[0083] like Figure 6 As shown, the computing device may include: a processor (processor) 602 , a communications interface (Communications Interface) 604 , a memory (memory) 606 , and a communication bus 608 .

[0084] Processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608. Communication interface 604 is used to communicate with other devices, such as clients or other server network elements. Processor 602 is used to execute program 610, which may specifically perform the steps described in the aforementioned embodiment of the remote control method for a virtual machine of a computing device.

[0085] Specifically, the program 610 may include program codes, which include computer operation instructions.

[0086] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in a computing device may be of the same type, such as one or more CPUs, or may be of different types, such as one or more CPUs and one or more ASICs.

[0087] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, or may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0088] The program 610 may be specifically configured to enable the processor 602 to perform the following operations:

[0089] The browser receives a first control instruction triggered by a user and sends the first control instruction to a remote desktop gateway backend; wherein the first control instruction includes a virtual machine identifier of a target virtual machine and a first control operation identifier, and the browser is loaded with a remote desktop gateway client;

[0090] The remote desktop gateway backend sends the first control instruction to the node server through a message queue, so that the node server controls the target virtual machine to perform the first control operation according to the virtual machine identifier and the first control operation identifier.

[0091] In an optional manner, the first control operation includes a power-on operation, a power-off operation, a rollback operation and / or a snapshot operation.

[0092] In an optional manner, the program 610 enables the processor 602 to further perform the following operation: reconstruct the background program of the remote desktop gateway background through the Python asynchronous non-blocking framework Tornado.

[0093] In an optional manner, a monitoring service is deployed on the node server;

[0094] The program 610 causes the processor 602 to further perform the following operations:

[0095] The remote desktop gateway backend sends the first control instruction to the monitoring service through a message queue, so that the monitoring service calls the operation interface of the target virtual machine according to the virtual machine identifier and executes the first control operation corresponding to the first operation identifier.

[0096] In an optional manner, the program 610 enables the processor 602 to further perform the following operations:

[0097] The remote desktop gateway backend sends the first control instruction to the monitoring service through the message queue processing library.

[0098] In an optional manner, a virtual machine management list is maintained in the background of the remote desktop gateway; the virtual machine management list records at least one of the following information: virtual network console port information, operating system information, serial number information, status information, number of snapshots, storage size information, last usage time, remote connection control, and first control operation control.

[0099] In an optional manner, the program 610 enables the processor 602 to further perform the following operations:

[0100] The browser sends a management list acquisition request to the remote desktop gateway backend, and displays the virtual machine management list returned by the remote desktop gateway backend according to the management list acquisition request on the browser page;

[0101] The browser receives a first control instruction triggered by a user operating a first control operation control in the virtual machine management list.

[0102] In an optional manner, the program 610 enables the processor 602 to further perform the following operations:

[0103] The remote desktop gateway backend updates the status information, number of snapshots, last usage time and / or operable information of the first control operation control in the virtual machine management list according to the first control operation executed historically.

[0104] In an optional manner, the program 610 enables the processor 602 to further perform the following operations:

[0105] The remote desktop gateway native application establishes a virtual network console connection with the target virtual machine according to the connection request of the target virtual machine; the connection request includes the virtual network console port information of the target virtual machine;

[0106] The remote desktop gateway native application receives the desktop image sent by the target virtual machine through the virtual network console connection, and distributes the desktop image to the browser via the remote desktop gateway backend for rendering and display;

[0107] The browser receives a second control operation of the user on the desktop image, encapsulates the second control operation into a second control instruction and forwards it to the remote desktop gateway native application via the remote desktop gateway backend; the second control instruction is a remote desktop gateway instruction;

[0108] The remote desktop gateway native application translates the second control instruction to obtain a virtual network console instruction, and sends the virtual network console instruction to the target virtual machine to control the target virtual machine to perform a control operation corresponding to the second control operation.

[0109] In an optional manner, the connection request of the target virtual machine is initiated by a user operating a remote connection control of the target virtual machine in the virtual machine management list.

[0110] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other device. Various general-purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the embodiment of the present invention is not directed to any specific programming language. It should be understood that various programming languages ​​can be utilized to implement the content of the embodiment of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the embodiment of the present invention.

[0111] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.

[0112] Similarly, it should be understood that in order to streamline the embodiments of the invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed approach should not be interpreted as reflecting an intention that the claimed embodiments of the invention require more features than are expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Accordingly, the claims that follow the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the invention.

[0113] Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively modified and installed in one or more devices different from the embodiments. The modules, units, or components in the embodiments can be combined into a single module, unit, or component, and furthermore, they can be divided into multiple sub-modules, sub-units, or sub-components. All features disclosed in this specification (including the accompanying claims, abstract, and drawings), and all processes or units of any method or device disclosed therein, can be combined in any combination, unless at least some of such features and / or processes or units are mutually exclusive. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0114] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, combinations of features from different embodiments are intended to be within the scope of the present invention and to form different embodiments. For example, in the claims below, any of the claimed embodiments may be used in any combination.

[0115] The various component embodiments of the present invention may be implemented in hardware, as software modules running on one or more processors, or as a combination thereof. Those skilled in the art will appreciate that, in practice, a microprocessor or digital signal processor (DSP) may be used to implement some or all of the functionality of some or all of the components according to the embodiments of the present invention. The embodiments of the present invention may also be implemented as an apparatus or device program (e.g., a computer program or computer program product) for performing part or all of the methods described herein. Such programs implementing the embodiments of the present invention may be stored on a computer-readable medium or in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0116] It should be noted that the above embodiments illustrate rather than limit the embodiments of the invention, and that a person skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The embodiments of the invention may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.

Claims

1. A method for remotely controlling a virtual machine, the method being implemented based on a clientless remote desktop gateway, comprising: The browser receives a first control instruction triggered by a user and sends the first control instruction to a remote desktop gateway backend; wherein the first control instruction includes a virtual machine identifier of a target virtual machine and a first control operation identifier, and the browser is loaded with a remote desktop gateway client; The remote desktop gateway backend sends the first control instruction to the node server through a message queue, so that the node server controls the target virtual machine to perform the first control operation according to the virtual machine identifier and the first control operation identifier; The method further includes: reconstructing the background program of the remote desktop gateway background through the Python asynchronous non-blocking framework Tornado to achieve asynchronous access through coroutines.

2. The method according to claim 1, wherein The first control operation includes a power-on operation, a power-off operation, a rollback operation and / or a snapshot operation.

3. The method according to claim 1 or 2, wherein: The node server is deployed with a monitoring service; the remote desktop gateway backend sends the first control instruction to the node server through a message queue, so that the node server controls the target virtual machine to perform the first control operation according to the virtual machine identifier and the first control operation identifier, further comprising: The remote desktop gateway backend sends the first control instruction to the monitoring service through a message queue, so that the monitoring service calls the operation interface of the target virtual machine according to the virtual machine identifier and executes the first control operation corresponding to the first operation identifier.

4. The method according to claim 3, wherein: The remote desktop gateway backend sending the first control instruction to the monitoring service through a message queue further includes: The remote desktop gateway backend sends the first control instruction to the monitoring service through the message queue processing library.

5. The method according to any one of claims 1 to 4, wherein: A virtual machine management list is maintained in the background of the remote desktop gateway; the virtual machine management list records at least one of the following information: virtual network console port information, operating system information, serial number information, status information, number of snapshots, storage size information, last usage time, remote connection control and first control operation control.

6. The method according to claim 5, wherein: Before the browser receives the first control instruction triggered by the user, the method further includes: The browser sends a management list acquisition request to the remote desktop gateway backend, and displays the virtual machine management list returned by the remote desktop gateway backend according to the management list acquisition request on the browser page; The browser receives the first control instruction triggered by the user specifically: The browser receives a first control instruction triggered by a user operating a first control operation control in the virtual machine management list.

7. The method according to claim 5, wherein: The method further includes: the remote desktop gateway backend updates the status information, number of snapshots, last usage time and / or operable information of the first control operation control in the virtual machine management list according to the first control operation executed historically.

8. The method according to any one of claims 1 to 7, wherein: After controlling the target virtual machine to be in a powered-on state, the method further includes: The remote desktop gateway native application establishes a virtual network console connection with the target virtual machine according to the connection request of the target virtual machine; the connection request includes the virtual network console port information of the target virtual machine; The remote desktop gateway native application receives the desktop image sent by the target virtual machine through the virtual network console connection, and distributes the desktop image to the browser via the remote desktop gateway backend for rendering and display; The browser receives a second control operation of the user on the desktop image, encapsulates the second control operation into a second control instruction and forwards it to the remote desktop gateway native application via the remote desktop gateway backend; the second control instruction is a remote desktop gateway instruction; The remote desktop gateway native application translates the second control instruction to obtain a virtual network console instruction, and sends the virtual network console instruction to the target virtual machine to control the target virtual machine to perform a control operation corresponding to the second control operation.

9. The method according to claim 8, wherein The connection request for the target virtual machine is initiated by a user operating a remote connection control of the target virtual machine in the virtual machine management list.

10. A remote control system for a virtual machine, the system being implemented based on a clientless remote desktop gateway, comprising: A browser, adapted to receive a first control instruction triggered by a user and send the first control instruction to a remote desktop gateway backend; wherein the first control instruction includes a virtual machine identifier of a target virtual machine and a first control operation identifier, and a remote desktop gateway client is loaded in the browser; The remote desktop gateway backend is adapted to send the first control instruction to the node server via a message queue; a node server, adapted to control the target virtual machine to perform a first control operation according to the virtual machine identifier and the first control operation identifier; The system further includes: a reconstruction module, which is suitable for reconstructing the background program of the remote desktop gateway background through the python asynchronous non-blocking framework Tornado to achieve asynchronous access through coroutines.

11. The system according to claim 10, wherein: The first control operation includes a power-on operation, a power-off operation, a rollback operation and / or a snapshot operation.

12. The system according to claim 10 or 11, wherein: A monitoring service is deployed on the node server; the remote desktop gateway backend is further adapted to: send the first control instruction to the monitoring service via a message queue, so that the monitoring service calls the operation interface of the target virtual machine according to the virtual machine identifier and executes the first control operation corresponding to the first operation identifier.

13. The system according to claim 12, wherein: The remote desktop gateway backend is further adapted to: send the first control instruction to a monitoring service via a message queue processing library.

14. The system according to any one of claims 10 to 13, wherein: A virtual machine management list is maintained in the background of the remote desktop gateway; the virtual machine management list records at least one of the following information: virtual network console port information, operating system information, serial number information, status information, number of snapshots, storage size information, last usage time, remote connection control and first control operation control.

15. The system according to claim 14, wherein: The system further comprises: An acquisition module, adapted for the browser to send a management list acquisition request to the remote desktop gateway backend, and display the virtual machine management list returned by the remote desktop gateway backend according to the management list acquisition request on the browser page; The browser is further adapted to receive a first control instruction triggered by a user operating a first control operation control in the virtual machine management list.

16. The system of claim 14, wherein: The remote desktop gateway backend is further adapted to update the status information, number of snapshots, last usage time and / or operable information of the first control operation control in the virtual machine management list according to the first control operation executed historically.

17. The system according to any one of claims 10 to 16, wherein: The system further comprises: A remote desktop gateway native application is adapted to establish a virtual network console connection with a target virtual machine in response to a connection request from the target virtual machine; the connection request includes virtual network console port information of the target virtual machine; receive a desktop image sent by the target virtual machine via the virtual network console connection, and distribute the desktop image to a browser for rendering and display via a remote desktop gateway backend; and translate the second control instruction to obtain a virtual network console instruction, and send the virtual network console instruction to the target virtual machine to control the target virtual machine to perform a control operation corresponding to the second control operation; The browser is further adapted to receive a second control operation of the user on the desktop image, encapsulate the second control operation into a second control instruction and forward it to the remote desktop gateway native application via the remote desktop gateway backend; the second control instruction is a remote desktop gateway instruction.

18. The system according to claim 17, wherein: The connection request for the target virtual machine is initiated by a user operating a remote connection control of the target virtual machine in the virtual machine management list.

19. A computing device comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the remote control method for a virtual machine according to any one of claims 1 to 9.

20. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, wherein the executable instruction enables a processor to execute an operation corresponding to the remote control method for a virtual machine according to any one of claims 1 to 9.