Method and system for interaction between client and virtual machine based on noVNC environment
By configuring OpenSSH services and using SFTP protocol in a virtualization technology environment, monitoring the operation behavior of virtual machine users is solved, and real-time monitoring of user operations is achieved.
Patent Information
- Application Number
- CN202411109203.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-01-07
AI Technical Summary
The prior art cannot monitor the user's operating behavior of virtual machines in a virtualization technology environment, resulting in inefficient virtual machine management.
By configuring the OpenSSH service, remotely access the virtual machine on the client's browser, and using the SFTP protocol in the OpenSSH service to build a transmission channel between the client and the virtual machine, obtain video log files from the virtual machine, analyze video log files to Monitor user operation behavior.
Real-time monitoring of user operation behavior is realized and the management efficiency of virtual machines is improved.
Smart Images

Figure CN119276856A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer application technology, and in particular to a method and system for interaction between a client and a virtual machine in a noVNC environment. Background Art
[0002] In the virtualization technology environment, noVNC is an HTML5 VNC client that is widely used in various virtual machine control panels because it can directly access and operate the virtual machine system through the browser without installing additional plug-ins. The existing technical solutions mainly focus on Ubuntu virtual machines to achieve file upload and download between the user end and the virtual machine. It is impossible to track and analyze the operation behavior on the virtual machine, which reduces the management efficiency of the virtual machine. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application provide a method and system for interaction between a client and a virtual machine based on a noVNC environment, which solves the problem that the current virtualization technology cannot monitor the user's operation behavior, and can monitor the user's operation behavior in real time to improve the management efficiency of virtual machine use.
[0004] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0005] In a first aspect, an embodiment of the present application provides a method for interaction between a client and a virtual machine in a noVNC environment, the method comprising:
[0006] Configure the OpenSSH service and remotely access the virtual machine on the client browser;
[0007] Use the SFTP protocol in the OpenSSH service to build a transmission channel between the client and the virtual machine;
[0008] Based on the transmission channel, the video log files are obtained from the virtual machine, the video log files are analyzed, and the client is monitored.
[0009] In some embodiments, the method further comprises:
[0010] Receiving a transmission request from a client, wherein the transmission request includes a file download request and a file upload request;
[0011] If the transmission request is a file download request, obtaining a file corresponding to the file download request from the virtual machine, and transmitting the file corresponding to the file download request to the client;
[0012] If the transmission request is a file upload request, a file corresponding to the file upload request is obtained from the client, and the file corresponding to the file upload request is transmitted to the virtual machine.
[0013] In some embodiments, the method further comprises:
[0014] Get the application's authorization file from the client;
[0015] Send the application's authorization file to the virtual machine;
[0016] Monitor the startup status of the application corresponding to the authorization file.
[0017] In some embodiments, the transport channel is implemented by a class library including a JSch library in Java.
[0018] In some embodiments, the virtual machine includes at least one of a Linux virtual machine and a Windows virtual machine.
[0019] In a second aspect, an embodiment of the present application provides a backend server, comprising
[0020] at least one processor; and,
[0021] a memory communicatively connected to at least one processor; wherein,
[0022] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the interaction method between the client and the virtual machine based on the noVNC environment as described in the first aspect.
[0023] In a third aspect, an embodiment of the present application provides an interactive system between a client and a virtual machine based on a noVNC environment, including:
[0024] Client, used to remotely access the virtual machine;
[0025] A virtual machine server, used to run virtual machines;
[0026] For example, the backend server in the second aspect is used to build a file upload and download channel between the client and the virtual machine.
[0027] In some embodiments, the virtual machine server is further used to start the virtual machine recording function, record the operations of the client in the desktop of the virtual machine, and save the recorded video log file to a specified location.
[0028] In some embodiments, the virtual machine server is further used to start the application and read the authorization file of the application to start the application through the authorization file.
[0029] In some embodiments, the backend server is further used to obtain the authorization file of the application from the client, send the authorization file of the application to the virtual machine, and monitor the startup status of the application by the authorization file.
[0030] The beneficial effect of the implementation mode of the present application is: different from the existing technology, the implementation mode of the present application provides an interaction method between a client and a virtual machine based on a noVNC environment, the method comprising: configuring an OpenSSH service, and remotely accessing the virtual machine on the client, building a transmission channel between the client and the virtual machine through the SFTP protocol in the OpenSSH service, obtaining a video log file from the virtual machine based on the transmission channel, analyzing the video log file, monitoring the client, and being able to monitor the user's operation behavior to improve the management efficiency of the use of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.
[0032] Figure 1 It is a schematic diagram of an interactive system between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0033] Figure 2 It is a flowchart of a method for interaction between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0034] Figure 3 This is a schematic diagram of a process of uploading and downloading files between a virtual machine and a client provided in an embodiment of the present application;
[0035] Figure 4 It is a flowchart of monitoring the startup status of an application program of a virtual machine provided in an embodiment of the present application;
[0036] Figure 5 It is a structural diagram of an interactive system between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0037] Figure 6 It is a structural diagram of an interactive device between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0038] Figure 7 It is a structural diagram of a back-end server provided in an embodiment of the present application.
[0039] Description of Figure Numbers:
[0040] DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, and all are within the scope of protection of the present application. In addition, the words "first", "second", etc. used in the present application do not limit the data, but only divide the same or similar items with basically the same functions and effects.
[0043] Before introducing the embodiments of the present application, a brief introduction is first given to the interaction method between the client and the virtual machine in the noVNC environment known to the inventor of the present application, so as to facilitate the subsequent understanding of the embodiments of the present application.
[0044] noVNC is an open source project based on HTML5 and JavaScript, which allows users to remotely access the Virtual Network Computer (VNC) service through a web browser. The noVNC environment consists of WebSockets, VNC server, and WebSocket proxy. WebSockets provides a full-duplex communication channel that can directly transmit data between the user's browser and the server. The VNC server remote control software allows users to access and control the graphical interface of another computer. The WebSocket proxy is used to convert the protocol so that the VNC server supports the WebSockets protocol. The core function of noVNC is to implement a VNC client in the browser, so that users can directly connect to the remote server through the web interface to perform screen sharing, desktop control and other operations. The main features of noVNC are easy access, cross-platform, and flexibility. noVNC is usually used in cloud computing services, data center management, distance education, online collaboration and other fields, especially for occasions where servers need to be managed quickly, temporarily or routinely through the Internet.
[0045] Existing virtualization technology can only support users to upload and download files between the client and the virtual machine, but cannot monitor the user's operation behavior on the virtual machine.
[0046] To address the above problems, this application configures the OpenSSH service and remotely accesses the virtual machine on the client. Through the SFTP protocol in the OpenSSH service, a transmission channel is built between the client and the virtual machine. Based on the transmission channel, the video log file is obtained from the virtual machine, the video log file is analyzed, and the client is monitored. It is possible to monitor the user's operation behavior to improve the management efficiency of virtual machine use.
[0047] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings:
[0048] See also Figure 1 , Figure 1 It is a schematic diagram of an interactive system between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0049] like Figure 1 As shown, the client-virtual machine interaction system 100 based on the noVNC environment includes a client 10, a backend server 20, and a virtual machine server 30, wherein the client 10, the backend server 20, and the virtual machine server 30 are connected to each other via a wireless network or a wired network. The wireless network includes wireless networks such as 2G, 3G, 4G, 5G, wireless LAN, and Bluetooth, and the wired network includes wired networks such as serial cables and network cables.
[0050] The client 10 is used to remotely access the virtual machine running on the virtual machine server 30 through a browser, wherein the client 10 is a client supporting noVNC, and the client 10 includes networked devices such as notebooks and computer terminals, wherein noVNC is a VNC client implemented based on HTML5, WebSocket, Canvas and JavaScript, which allows users to directly access and control the remote computer desktop installed with the VNC server through a Web browser that supports the WebSockets protocol, without installing traditional VNC client software.
[0051] The backend server 20 is used to build a file upload and download channel between the client 10 and the virtual machine to achieve fast upload and download of files between the client 10 and the virtual machine.
[0052] The virtual machine server 30 is used to run virtual machines.
[0053] Among them, the back-end server 20 and the virtual machine server 30 can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms.
[0054] Among them, the virtual machine server 30 can run multiple independent virtual environments (i.e., virtual machines), each environment can simulate a complete computer, and the client 10 includes multiple clients, and multiple clients can simultaneously access different virtual machines on the virtual machine server 30. For example, in a teaching and training platform, there will be a scenario of virtual machine services provided to platform users. Users can access the virtual machine on any client that can access the Internet environment. Multiple users need to provide multiple virtual machine environments to provide users with a teaching and training platform.
[0055] See also Figure 2 , Figure 2 It is a flowchart of a method for interaction between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0056] The method for interaction between a client and a virtual machine in a noVNC environment is applied to a backend server. Specifically, the execution subject of the method for interaction between a client and a virtual machine in a noVNC environment is one or at least two processors of the backend server.
[0057] like Figure 2 As shown, the interaction method between the client and the virtual machine based on the noVNC environment includes:
[0058] Step S201: Configure the OpenSSH service and remotely access the virtual machine on the client's browser;
[0059] Among them, the OpenSSH service is a free open source implementation of the SSH protocol, which is used to provide a secure transmission environment for network services in an insecure network.
[0060] The virtual machine includes at least one of a Linux virtual machine and a Windows virtual machine, and a plurality of application programs are installed on the virtual machine, such as experimental application programs required in a teaching experiment scenario.
[0061] Specifically, the OpenSSH service is configured in the virtual machine and the backend server, and the OpenSSH service is set to start when the virtual machine and the backend server are powered on.
[0062] Furthermore, after configuring the OpenSSH service, open the desktop of the virtual machine on the client's browser to remotely access the virtual machine.
[0063] In the embodiment of the present application, after the desktop of the virtual machine is opened through the browser of the client, the application on the virtual machine can be opened on the desktop of the virtual machine to control the application on the virtual machine.
[0064] In the embodiment of the present application, remote access to the virtual machine on the client is implemented based on the OpenSSH service, which enables the user to interact with the virtual machines of different platforms, so that there is no platform restriction for the interaction between the user and the virtual machine, thereby improving the user experience.
[0065] Step S202: Building a transmission channel between the client and the virtual machine through the SFTP protocol in the OpenSSH service;
[0066] The SFTP protocol is a secure file transfer protocol implemented on the basis of the SSH protocol. When transmitting data, it provides an encrypted file transfer function to ensure the security of data transmission. The SFTP protocol is implemented by a class library, which includes the JSch library in Java.
[0067] Specifically, a file transfer interface is constructed through the SFTP protocol in the OpenSSH service. Through the file transfer interface, file transfer between the client and the virtual machine is realized, that is, a transmission channel between the client and the virtual machine is constructed, wherein file transfer includes uploading and downloading of files.
[0068] The specific file transfer between the client and the virtual machine is implemented as follows:
[0069] (1) Basic environment configuration
[0070] Install the OpenSSH service in the virtual machine.
[0071] (2) File upload and download
[0072] Based on the SFTP protocol in the OpenSSH service, the file transfer interface is implemented, the virtual machine is remotely accessed on the client's browser, and HTML elements are used on the browser page to create a file upload, such as using HTML<inputtype=“file”> Element is used to create file upload. After a file is selected, the selected file is uploaded to the backend server through an asynchronous HTTP request, where the asynchronous request includes XMLHttpRequest (XHR) and Fetch API.
[0073] After the back-end server receives the HTTP request sent by the client, it temporarily stores the file corresponding to the HTTP request in the back-end server. The back-end server connects to the virtual machine server through the SFTP protocol and uploads the file corresponding to the HTTP request to the file location in the virtual machine. The file location in the virtual machine may be different in different virtual environments. For example, the file location in the Linux virtual machine is " / home / xunfang / tmp / ", and the file location in the Windows virtual machine is " / C: / Users / xunfang / tmp / ".
[0074] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a process of uploading and downloading files between a virtual machine and a client provided in an embodiment of the present application;
[0075] like Figure 3 As shown, the process of uploading and downloading files between the virtual machine and the client includes:
[0076] Step S301: receiving a transmission request from a client, wherein the transmission request includes a file download request and a file upload request;
[0077] Specifically, the backend server receives a transmission request from the client, wherein the transmission request is an HTTP request, and the transmission request includes a file download request and a file upload request.
[0078] Step S302: determining whether the transmission request is a file download request;
[0079] Specifically, it is determined whether the transmission request is a file download request. If the transmission request is a file download request, the process jumps to step S303; if the transmission request is not a file download request, the process jumps to step S304.
[0080] Step S303: Obtain the file corresponding to the file download request from the virtual machine, and transmit the file corresponding to the file download request to the client;
[0081] Specifically, when the transmission request is a file download request, the file corresponding to the file download request is obtained from the virtual machine and temporarily stored in the backend server, and the backend server transmits the file corresponding to the file download request to the client.
[0082] Step S304: determining that the transmission request is a file upload request, obtaining a file corresponding to the file upload request from the client, and transmitting the file corresponding to the file upload request to the virtual machine;
[0083] Specifically, when the transmission request is not a file download request, it is determined that the transmission request is a file upload request, the file corresponding to the file upload request is obtained from the client, and temporarily saved in the back-end server, and the file corresponding to the file upload request is transferred to the virtual machine through the file transfer interface implemented by the SFTP protocol.
[0084] In an embodiment of the present application, in the noVNC environment, file transfer between the virtual machine and the client is implemented based on the SFTP protocol in the OpenSSH service, and the client does not need to install any plug-in tools to achieve fast file transfer between different terminals.
[0085] Step S203: Based on the transmission channel, obtain the video log file from the virtual machine, analyze the video log file, and monitor the client;
[0086] In an embodiment of the present application, after remotely accessing the virtual machine through the client's browser, the recording function in the virtual machine is turned on to record the user's operating behavior in the virtual machine, and the storage location for storing the recorded script is configured, wherein the script is used to store the log of the user's command input and output in the virtual machine, wherein the storage location of the script in the Linux virtual machine is " / home / log / ".
[0087] Specifically, based on the transmission channel, that is, the file transfer interface implemented based on the SFTP protocol, the back-end server obtains the video log file from the script storage location of the virtual machine, analyzes the video log file, and monitors the client, wherein the video log file stores the log of the user's input and output through commands in the virtual machine.
[0088] For example, in a simulated teaching experiment scenario, the experiment application in the virtual machine is opened, and the virtual machine monitoring function is turned on to record the operations in the experiment application, such as monitoring the input and output of the command line in the experiment application to obtain a video log file. The back-end server uses the ChannelSftp class of the class library JSch to connect to the SFTP server, and downloads the video log file stored in the " / home / log / " location in the Linux virtual machine to the back-end server through the file transfer interface implemented by the SFTP protocol. The back-end server compares and analyzes the steps of the key guidance operations in the experimental instruction book corresponding to the virtual machine experiment, and analyzes whether the command input and output operations stored in the video log file are the same as the key guidance operations in the experimental process, so as to analyze whether the user has completed the virtual machine operations required in the experimental instruction book. For example, the experimental instruction book requires the user to install a JDK in the virtual machine, version 1.8, and start the Tomcat container, etc. By retrieving the key steps of the input and output commands in the video log file, it is checked whether the user has installed the software and started the container, so as to monitor the quality of the user's experimental process.
[0089] In an embodiment of the present application, a transmission channel is constructed between the client and the virtual machine through the SFTP protocol in the OpenSSH service. Based on the transmission channel, the video log file is obtained from the virtual machine, the video log file is analyzed, and the client is monitored, so that the user's operation behavior can be monitored.
[0090] Please refer to Figure 4 , Figure 4 It is a flowchart of monitoring the startup status of an application program of a virtual machine provided in an embodiment of the present application;
[0091] like Figure 4 As shown, the startup status of the application of the monitoring virtual machine includes:
[0092] Step S401: Obtaining the authorization file of the application from the client;
[0093] In the embodiment of the present application, different application programs have different service level agreements, and therefore different application programs have different authorization methods, that is, different application programs have different performance requirements and customer expectations. Application programs include commercial applications, open source applications (Open Source Software), shared applications, and free applications. A service level agreement (SLA) is a contractual relationship between a service provider and a customer, and usually involves a commitment by a software provider to provide a specific level of service to a user. A commercial application refers to an application that requires payment of a certain fee to obtain the right to use it. An open source application refers to an application that allows users to freely use, modify, and distribute source code, such as the Linux operating system and the Git version control system. A shared application refers to an application that provides a free trial period, and after the trial period, the user needs to pay to obtain authorization to continue using the application. A free application refers to an application that can be downloaded, used, and distributed for free.
[0094] In an embodiment of the present application, when some applications that require authorization are used in a virtual machine, the authorization of the application can be achieved by uploading the authorization file of the application to the virtual machine through the client. For example, some industrial software is basically bound to the machine code, and industrial applications cannot be used in the virtual machine, such as VayoPro-DFM Expert. In this case, it is necessary to remotely upload the authorization file in the client to achieve temporary authorization in order to expand the scope of use of the application in the virtual machine.
[0095] Specifically, apply for an authorization file of the application in the client, such as the xxx.key file. The key file stores the authorization time of the application, such as 7 days. After applying for the authorization file, upload the authorization file to the backend server to obtain the authorization file of the application from the client.
[0096] Step S402: Send the authorization file of the application to the virtual machine;
[0097] Specifically, the authorization file of the application is sent to the virtual machine through the file transfer interface implemented by the SFTP protocol and saved to a specific location. For example, the authorization file is stored in " / C: / Users / xunfang / tmp / " in the Windows virtual machine.
[0098] Step S403: monitoring the startup status of the application corresponding to the authorization file;
[0099] Specifically, when the virtual machine starts the application corresponding to the authorization file, the backend server monitors the startup status of the application corresponding to the authorization file, wherein the startup status includes startup success and startup failure.
[0100] In an embodiment of the present application, when the application corresponding to the authorization file is started in the virtual machine, the authorization file of the application is automatically obtained from a specific location to complete the authorization of the application. When the authorization file does not exist in the specific location, the application will fail to start. When the authorization file exists in the specific location, the authorization file is obtained to complete the authorization of the application and successfully start the application.
[0101] In an embodiment of the present application, in the noVNC environment, by configuring the OpenSSH service and implementing file upload and download between the client and virtual machines of different platforms through the SFTP protocol in the OpenSSH service, it is possible to monitor the user's operating behavior on the virtual machine and implement authorization of the application in the virtual machine. The client does not need to install any plug-in tools, reducing the security risks caused by local plug-ins or tools, and achieving efficient, convenient and secure interaction between users and virtual machines, thereby improving the user experience.
[0102] See also Figure 5 , Figure 5 It is a structural diagram of an interactive system between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0103] like Figure 5 As shown, the client-virtual machine interaction system 100 based on the noVNC environment includes a client 10 , a backend server 20 , and a virtual machine server 30 .
[0104] The client 10 is used to remotely access the virtual machine.
[0105] The backend server 20 is used to build a file upload and download channel between the client and the virtual machine, obtain the authorization file of the application from the client, send the authorization file of the application to the virtual machine, and monitor the startup status of the authorization file for the application.
[0106] The virtual machine server 30 is used to run the virtual machine and start the virtual machine recording function to record the operation of the client in the desktop of the virtual machine and save the recorded video log file to a designated location.
[0107] In an embodiment of the present application, the interaction between the client and the virtual machine can be realized through the interaction system between the client and the virtual machine in the noVNC environment, virtual machine file upload and download are realized, and the user's operation behavior in the virtual machine is monitored. Temporary authorization of the application in the virtual machine is also realized, thereby improving the management efficiency of the use of the virtual machine.
[0108] See also Figure 6 , Figure 6 It is a structural diagram of an interactive device between a client and a virtual machine in a noVNC environment provided by an embodiment of the present application;
[0109] like Figure 6 As shown, the client and virtual machine interaction device 600 based on the noVNC environment includes:
[0110] Configuration unit 601, configures OpenSSH service and remotely accesses the virtual machine on the browser of the client;
[0111] A construction unit 602 constructs a transmission channel between the client and the virtual machine through the SFTP protocol in the OpenSSH service;
[0112] The monitoring unit 603 obtains the video log file from the virtual machine based on the transmission channel, analyzes the video log file, and monitors the client.
[0113] In an embodiment of the present application, the interaction device between the client and the virtual machine in the noVNC environment can be a software module, which includes a number of instructions stored in a memory. The processor can access the memory and call the instructions for execution to complete the interaction method between the client and the virtual machine in the noVNC environment in the above-mentioned embodiments.
[0114] In the embodiments of the present application, the interactive device between the client and the virtual machine in the noVNC environment can also be constructed by hardware devices. For example, the interactive device between the client and the virtual machine in the noVNC environment can be constructed by one or more chips, and each chip can work in coordination with each other to complete the interactive method between the client and the virtual machine in the noVNC environment described in the above embodiments. For another example, the interactive device between the client and the virtual machine in the noVNC environment can also be constructed by various logic devices, such as a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machi ne) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0115] The interactive device between the client and the virtual machine based on the noVNC environment in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0116] The interactive device between the client and the virtual machine based on the noVNC environment in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0117] The interactive device between the client and the virtual machine based on the noVNC environment provided in the embodiment of the present application can realize Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0118] It should be noted that the above device can execute the method for interacting between a client and a virtual machine based on a noVNC environment provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in the device embodiment, please refer to the method for interacting between a client and a virtual machine based on a noVNC environment provided in the embodiment of the present application.
[0119] In an embodiment of the present application, the various units of the interaction device between the client and the virtual machine in the noVNC environment cooperate with each other to monitor the user's operating behavior on the virtual machine and implement the authorization of the application in the virtual machine. The client does not need to install any plug-in tools, thereby reducing the security risks caused by local plug-ins or tools, and realizing efficient, convenient and secure interaction between the user and the virtual machine, thereby improving the user experience.
[0120] See also Figure 7 , Figure 7 It is a structural diagram of a back-end server provided in an embodiment of the present application;
[0121] like Figure 7As shown, the backend server 20 includes one or more processors 21 and a memory 22. Figure 7 A processor 21 is taken as an example.
[0122] The processor 21 and the memory 22 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0123] A processor is used to execute the method for interacting between a client and a virtual machine in a noVNC environment in any embodiment of the present application, the method comprising:
[0124] Configure the OpenSSH service and remotely access the virtual machine on the client;
[0125] Use the SFTP protocol in the OpenSSH service to build a transmission channel between the client and the virtual machine;
[0126] Based on the transmission channel, the video log files are obtained from the virtual machine, the video log files are analyzed, and the client is monitored.
[0127] The memory 22, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for interacting between a client and a virtual machine in a noVNC environment in the embodiment of the present invention. The processor 21 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and modules stored in the memory 22, that is, implements the method for interacting between a client and a virtual machine in a noVNC environment in the above method embodiment.
[0128] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0129] One or more modules are stored in the memory 22, and when executed by one or more processors 21, the interaction method between the client and the virtual machine based on the noVNC environment in any of the above method embodiments is executed, for example, the above described Figure 2 The steps shown.
[0130] In an embodiment of the present application, in a NoVNC environment, by configuring the OpenSSH service and implementing file upload and download between the client and virtual machines of different platforms through the SFTP protocol in the OpenSSH service, it is possible to monitor the user's operating behavior on the virtual machine and implement authorization of applications in the virtual machine. The client does not need to install any plug-in tools, reducing the security risks caused by local plug-ins or tools, and achieving efficient, convenient and secure interaction between users and virtual machines, thereby improving the user experience.
[0131] An embodiment of the present application also provides a computer program product, which includes one or more program codes, which are stored in a non-volatile computer-readable storage medium. A processor of an electronic device reads the program code from the non-volatile computer-readable storage medium, and the processor executes the program code to complete the steps of the method for interaction between a client and a virtual machine based on the noVNC environment provided in the above embodiment.
[0132] Through the description of the above implementation methods, ordinary technicians in this field can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or by hardware related to program code, and the program can be stored in a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc.
[0133] Through the description of the above implementation methods, a person of ordinary skill in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the non-volatile computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as mentioned above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for interaction between a client and a virtual machine in a noVNC environment, characterized in that: The method comprises: Configure the OpenSSH service and remotely access the virtual machine on the browser of the client; A transmission channel between the client and the virtual machine is established through the SFTP protocol in the OpenSSH service; Based on the transmission channel, a video log file is obtained from the virtual machine, the video log file is analyzed, and the client is monitored.
2. The method according to claim 1, characterized in that The method further comprises: Receiving a transmission request from the client, wherein the transmission request includes a file download request and a file upload request; If the transmission request is a file download request, obtaining a file corresponding to the file download request from the virtual machine, and transmitting the file corresponding to the file download request to the client; If the transmission request is a file upload request, the file corresponding to the file upload request is obtained from the client, and the file corresponding to the file upload request is transmitted to the virtual machine.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining an authorization file of the application from the client; Sending the authorization file of the application to the virtual machine; Monitor the startup status of the application corresponding to the authorization file.
4. The method according to claim 1, characterized in that: The transmission channel is implemented by a class library, and the class library includes a JSch library in Java.
5. The method according to claim 1, characterized in that The virtual machine includes at least one of a Linux virtual machine and a Windows virtual machine.
6. A backend server, characterized in that: include at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for interaction between a client and a virtual machine in a noVNC environment as described in any one of claims 1 to 5.
7. An interactive system between a client and a virtual machine based on a noVNC environment, characterized in that: include: A client, used for remotely accessing the virtual machine; A virtual machine server, used for running the virtual machine; The back-end server as described in claim 6 is used to establish a file upload and download channel between the client and the virtual machine.
8. The system according to claim 7, characterized in that The virtual machine server is further used to start the virtual machine recording function, record the operation of the client in the desktop of the virtual machine, and save the recorded video log file to a designated location.
9. The system according to claim 8, characterized in that The virtual machine server is further used to start the application and read the authorization file of the application to start the application through the authorization file.
10. The system according to claim 9, characterized in that The back-end server is also used to obtain the authorization file of the application from the client, send the authorization file of the application to the virtual machine, and monitor the startup status of the application by the authorization file.
Citation Information
Cited By
Processing method, device, equipment and system for remote access based on browser
CN120670399A