Virtual machine controller and method for virtual machine controller to execute virtual machine
By modifying and restoring the execution state of virtual machines through the virtual machine controller, injecting processes, and performing fork operations, the problem of dynamic installation and execution of virtual machines in operation is solved, enabling seamless integration of new functions, reducing costs, and improving system flexibility and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
- Filing Date
- 2023-09-21
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for dynamically installing and executing processes in running virtual machines are costly, inflexible, and require pre-installed software managers and SSH connections, making it difficult to achieve seamless expansion and management.
By modifying the execution state of a virtual machine through the virtual machine controller, injecting computer code for forking operations, supporting the execution of the injected process, and restoring the execution state without interrupting the original process, new functions can be seamlessly integrated.
It reduces operating costs, improves the flexibility and reliability of virtual machine systems, supports automatic software installation and antivirus, simplifies the management process, and enhances security and ease of operation.
Smart Images

Figure CN121909451A_ABST
Abstract
Description
Technical Field
[0001] This invention generally relates to the fields of virtualization and cloud computing, and more specifically, to a virtual machine controller and a method for using the virtual machine controller to execute virtual machines. Background Technology
[0002] Virtualization and cloud computing have revolutionized the utilization and management of computing resources. Cloud computing technology enables efficient allocation, scalability, and flexibility of computing resources. However, seamlessly scaling and managing processes within running virtual machines (VMs) presents challenges, especially in scenarios involving cloud providers and enterprise administrators.
[0003] In the fields of virtualization and cloud computing, the ability to dynamically install, execute, and manage processes within a running virtual machine (VM) is crucial. Traditional methods for dynamically scaling and managing processes within a running VM involve pre-installation before taking a snapshot or modifying the VM image. More dynamic methods support on-the-fly installation, but require VM support and a typical Secure Shell (SSH) connection. Another approach involves processes running on the VM being granted the correct permissions by the operating system, which can modify another process to run its own. However, this approach is limited by the capabilities and permissions provided by the operating system, which is undesirable. Therefore, traditional methods lack support for user-supplied images, require advance VM preparation, and struggle with rollback installations, necessitating a more efficient solution.
[0004] Another approach to executing processes within a running virtual machine involves deploying pre-installed software managers capable of receiving commands from a remote server to execute specific processes. However, this approach is complex and severely limited, as it requires maintaining separate software managers for each platform and kernel version, and ensuring uninterrupted network connectivity is also undesirable. Therefore, a technical challenge exists: how to efficiently and dynamically mount and execute processes within a running virtual machine (VM), while minimizing cost and increasing flexibility without requiring additional client installations.
[0005] Therefore, based on the above discussion, it is necessary to overcome the aforementioned drawbacks associated with traditional methods of dynamically mounting and executing processes in a running VM. Summary of the Invention
[0006] This invention provides a virtual machine controller and a method for executing virtual machines using the virtual machine controller. The invention provides a solution to a prior art problem of how to efficiently and dynamically install and execute processes in a running virtual machine (VM), while reducing costs and improving flexibility without requiring additional client installation. The object of this invention is to provide a solution that at least partially overcomes the problems encountered in the prior art, and to provide an improved virtual machine controller and an improved method for executing virtual machines using the virtual machine controller, for example by providing a method for injecting processes into a running virtual machine.
[0007] One or more objects of the invention are achieved by means of the solutions provided in the appended independent claims. Advantageous implementations of the invention are further defined in the dependent claims.
[0008] In one aspect, the present invention provides a virtual machine controller for executing a virtual machine. The virtual machine is executing an original process having an execution state. The virtual machine controller is configured to modify the execution state of the original process to introduce computer code into the execution state of the original process. The computer code includes: computer instructions including execution details of the injected process; and computer instructions that, when executed, cause a forking operation to be performed. The virtual machine controller is further configured to: execute the original process in the modified execution state, thereby enabling the injected process to fork from the original process. The virtual machine controller is further configured to: restore the execution state of the original process based on the restored execution state so that the original process can continue uninterrupted.
[0009] The virtual machine controller of this invention significantly reduces operating costs by eliminating the need for deployment and maintenance of a pre-installed software manager. The cost-effectiveness of the virtual machine controller is combined with significant enhanced availability because it eliminates the need for additional client installation. Instead, the virtual machine controller supports the execution of injected processes within the virtual machine (VM) without requiring prior VM preparation. This breakthrough approach of supporting software execution within the virtual machine (VM) without prior VM preparation offers several benefits, including internal monitoring of the VM, automated software installation and configuration, and easy notification capabilities. Furthermore, the virtual machine controller can perform antivirus and anti-malware operations once and for all without leaving any trace, avoiding resource consumption during VM idle periods and preventing malware detection and damage. In addition, by improving operational efficiency, the virtual machine controller supports VM maintenance operations from external sources, such as cloud user interfaces.
[0010] Furthermore, the virtual machine controller introduces a universal paradigm shift, enabling any endpoint with running processes to serve as a means of deploying new add-on software onto a running VM. This transformative concept of deploying new add-on software onto a running VM ensures that the VM seamlessly interprets and executes the add-on code without requiring any prerequisites from the VM itself. In addition, the virtual machine controller establishes a centralized management center for managing injected applications. This centralized approach to managing injected applications simplifies the management process and enhances control and oversight. Therefore, the virtual machine controller in virtual machine management can improve performance, security, and operational simplicity.
[0011] The virtual machine controller (VM controller) is designed to operate within a virtual machine environment that runs a primitive process with a specific execution state. This execution state forms the basis for introducing computer code into the primitive process. The computer code encompasses computer instructions, which cover two key aspects: the execution details of the injected process and the computer instructions that trigger the forking operation. The VM controller can modify the execution state of the primitive process to introduce computer code, allowing new functionality and processes to be integrated into the existing VM ecosystem without interrupting the primitive process. Modifying the execution state of the primitive process enables the VM controller to fundamentally change the behavior and functionality of the VM while maintaining its operational integrity. Furthermore, executing the primitive process in the modified execution state allows the injected process to fork from the primitive process. This innovative concept of forking from the existing execution state changes the way injected processes are integrated into the VM. Forking the injected process into the primitive process provides a more seamless and efficient method, mitigating potential conflicts or inconsistencies that may arise from traditional process integration methods. Additionally, the VM controller restores the execution state of the primitive process. Restoring the execution state of the primitive process ensures that the primitive process continues its execution uninterrupted based on the restored execution state. The complex orchestration of modifying, executing, and restoring processes demonstrates the virtual machine controller's ability to achieve overall stability and functionality of VMs, contributing to the construction of more robust and efficient cloud computing environments.
[0012] In one implementation, the virtual machine controller is further configured to: suspend the original process before modifying its execution state. The virtual machine controller is further configured to: unsuspend the original process to support its execution in the modified execution state. The virtual machine controller is further configured to: suspend the original process before restoring its execution state. The virtual machine controller is further configured to: unsuspend the original process based on the restored execution state so that the execution of the original process can proceed uninterrupted.
[0013] In this implementation, pausing the original process allows modification of its execution state without interrupting its operations. Unpausing the original process ensures a seamless transition between the modified execution state and the continued execution of the original process.
[0014] In another implementation, the virtual machine controller is further configured to: read the execution state of the original process before modifying the execution state to the copied execution state. The virtual machine controller is also configured to: restore the execution state of the original process by setting the execution state to the copied execution state.
[0015] Advantageously, reading and restoring the execution state of the original process improves the efficiency and reliability of the virtual machine controller, thereby facilitating uninterrupted execution of processes within the virtual machine.
[0016] In another implementation, the virtual machine controller is also used to write the execution state by writing to the registers of the virtual processor and by writing to the associated memory pages.
[0017] By writing to the processor's registers and memory pages, the virtual machine controller ensures the accurate and efficient preservation of the execution state, thereby improving the overall performance and reliability of the virtual machine system.
[0018] In another implementation, the injection process is used to write binary instructions to memory and execute the binary instructions; write a binary file and invoke the binary file using the exec command; and / or invoke an existing binary file using specific input.
[0019] In this implementation, writing and calling binary files allows for the execution of custom code within the virtual machine, thus providing flexibility and adaptability to the virtual machine system. Furthermore, by calling existing binary files using specific inputs, the virtual machine controller can interact with external programs and utilize the functionality of those binary files.
[0020] In another aspect, the present invention provides a method for a virtual machine controller, the virtual machine controller being used to execute a virtual machine. The virtual machine is executing an original process, the original process having an execution state. The method includes: modifying the execution state of the original process to introduce computer code into the execution state of the original process. The computer code includes: computer instructions including execution details of the injected process; and computer instructions that, when executed, cause a forking operation to be performed. The method further includes: executing the original process in the modified execution state, thereby enabling the injected process to fork from the original process. The method further includes: restoring the execution state of the original process based on the restored execution state so that the original process can continue uninterrupted.
[0021] The disclosed method achieves all the advantages and technical effects of the virtual machine controller of the present invention.
[0022] It should be noted that all devices, elements, circuits, units, and modules described in this application can be implemented by software or hardware elements or any combination thereof. All steps performed by the various entities described in this application, and the functions to be performed by the various entities described, are intended to refer to the respective entities performing the respective steps and functions. Even in the description of the following specific embodiments, if a particular function or step to be performed by an external entity is not reflected in the description of the specific detailed elements of the entity performing that particular step or function, it will be clear to those skilled in the art that these methods and functions can be implemented in the corresponding software or hardware elements, or in any combination of such elements. It should be understood that the features of the present invention are readily combined in various combinations without departing from the scope of the invention as defined by the appended claims.
[0023] Additional aspects, advantages, features and objects of the invention will become apparent from the accompanying drawings and the detailed description of illustrative implementations as explained in conjunction with the following appended claims. Attached Figure Description
[0024] The above-described invention and the following detailed description of illustrative embodiments can be better understood when read in conjunction with the accompanying drawings. Exemplary structures of the invention are shown in the drawings to illustrate the invention. However, the invention is not limited to the specific methods and tools disclosed herein. Furthermore, those skilled in the art will understand that the drawings are not drawn to scale. Where possible, similar elements are represented by the same numbers.
[0025] The following figures will now be used as examples to describe embodiments of the present invention, wherein: Figure 1 This is a block diagram of a virtual machine controller for executing a virtual machine provided in an embodiment of the present invention; Figure 2 This is a flowchart of a method for a virtual machine controller provided in an embodiment of the present invention, wherein the virtual machine controller is used to execute a virtual machine; Figure 3 This is a diagram illustrating the architecture of a method for injecting a process into a virtual machine provided by an embodiment of the present invention; Figure 4 This is a diagram illustrating the sequence of the injection process provided in an embodiment of the present invention; Figure 5 This is a sequence diagram illustrating an exemplary implementation of reading the execution state of the original process before modifying the execution state of the original process, according to an embodiment of the present invention; Figure 6This is a sequence diagram illustrating an exemplary implementation of injecting a process from a forked source process according to an embodiment of the present invention.
[0026] In the accompanying diagrams, underlined numbers indicate the item in which the underlined number appears or the item adjacent to the underlined number. Ununderlined numbers are associated with the item identified by the line that links the ununderlined number to the item. When a number is ununderlined and accompanied by an associated arrow, the ununderlined number is used to identify the general item that the arrow points to. Detailed Implementation
[0027] The following detailed description illustrates embodiments of the present invention and ways in which these embodiments can be implemented. While some modes of implementing the invention have been disclosed, those skilled in the art will recognize that other embodiments for implementing or practicing the invention may also exist.
[0028] Figure 1 This is a block diagram of a virtual machine controller for executing a virtual machine, provided in an embodiment of the present invention. (See reference) Figure 1 A block diagram of a virtual machine system 100 is shown, illustrating a virtual machine controller 102 for executing a virtual machine 108. Further illustration shows the execution of a raw process 104 and an injected process 106 with execution states on the virtual machine 108 via a communication network 114.
[0029] Virtual machine controller 102 refers to a controller used to execute one or more virtual machines 108. Examples of implementations of virtual machine controller 102 may include, but are not limited to, a central data processing device, a microprocessor, a microcontroller, a complex instruction set computing (CISC) processor, an application-specific integrated circuit (ASIC) processor, a reduced instruction set (RISC) processor, a very long instruction word (VLIW) processor, a central processing unit (CPU), a state machine, a data processing unit, and other processors or circuits.
[0030] The original process 104 corresponds to the basic computing task or program currently being executed within the virtual machine 108. The original process 104 represents the core function or task that the virtual machine 108 is executing at a given moment. For example, in the context of a security patch injector, the original process 104 could be a web server handling user requests; in a real-time monitoring scenario, the original process 104 could be an application performing data analysis; and in the context of automated configuration, the original process 104 could be an e-commerce platform processing customer orders.
[0031] The injection process 106 corresponds to a new computing task or set of functions that is seamlessly introduced into the execution context of the original process 104 running within the virtual machine 108. For example, in the context of a security patch injector, the injection process 106 may include a security monitoring module for detecting and mitigating vulnerabilities; in a real-time monitoring scenario, the injection process 106 may include a monitoring agent for collecting performance metrics; and in an automatic configuration context, the injection process 106 may be a configuration updater that adjusts settings based on changing conditions. In one implementation, the injection process 106 may also be referred to as a process introduced into the virtual machine 108 via an injector, specifically designed to function as an antivirus program. In other words, the primary goal of the injection process 106 is to identify, reduce, and eliminate malware, such as viruses, malicious software, and other security threats. In one example, the virtual machine 108 is running a critical application that processes sensitive data, and an antivirus injector is used to ensure the security of the virtual machine 108. The injector introduces an antivirus process that continuously scans the files and processes of the virtual machine 108 for any signs of malicious activity. If the injected antivirus process detects any suspicious files or activity, the virtual machine controller 102 takes appropriate action, such as quarantining or deleting infected files, thereby enhancing the security posture of the virtual machine 108. In another example, an enterprise can leverage the virtual machine 108 to perform various tasks within the virtual machine environment. To maintain the integrity of the virtual machine 108, the injected antivirus process can be used. The injected antivirus process monitors the virtual machine 108 in real time, protecting it from potential threats that could compromise sensitive data or disrupt services.
[0032] A virtual machine (VM) 108 corresponds to the virtualization of a computer system. A VM 108 is based on a computer architecture and provides the functionality of a physical computer. The implementation of a VM 108 can involve dedicated hardware, software, or a combination of both. A VM 108 can also refer to a computer device or a group of computer devices capable of performing computational and processing tasks within a virtual machine system 100. The implementation of a VM 108 encompasses individual computing units and larger systems, such as servers, clusters, distributed computing nodes, or cloud computing instances. A VM 108 can be part of a local computing environment or geographically distributed across a network.
[0033] Virtual machine 108 includes virtual processor 112. Virtual processor 112 is used to execute the original process 104 and the injected process 106 in virtual machine 108. Examples of implementations of virtual processor 112 may include, but are not limited to, central data processing devices, microprocessors, microcontrollers, complex instruction set computing (CISC) processors, application-specific integrated circuit (ASIC) processors, reduced instruction set (RISC) processors, very long instruction word (VLIW) processors, state machines, and other processors or control circuits.
[0034] Virtual machine 108 also includes memory pages 110. Memory pages 110 refer to discrete units of memory within virtual machine 108. Memory pages 110 are used to store or retrieve data, including the execution state of the original process 104, instructions, or injected processes 106 introduced by an injector. Memory pages 110 can be described as volatile memory. Examples of implementations of memory pages 110 may include, but are not limited to, electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), read-only memory (ROM), hard disk drive (HDD), flash memory, solid-state drive (SSD), persistent memory, remote direct memory access (RDMA), or CPU cache memory.
[0035] Communication network 114 includes a medium (e.g., a communication channel) through which virtual machine controller 102 communicates with virtual machine 108. Communication network 114 can be a wired or wireless communication network. Examples of communication network 114 may include, but are not limited to, the Internet, local area network (LAN), wireless personal area network (WPAN), wireless local area network (WLAN), wireless wide area network (WWAN), cloud network, long-term evolution (LTE) network, plain old telephone service (POTS), metropolitan area network (MAN), and / or the Internet.
[0036] In operation, virtual machine controller 102 is used to execute virtual machine 108. Virtual machine 108 is used to execute raw process 104. Raw process 104 has an execution state. The execution state of raw process 104 refers to the collection of data and information that captures the current state and progress of raw process 104 within virtual machine 108. The collection of data and information encompasses various components, such as current memory contents, including cache memory that holds frequently accessed data, and pointers indicating the current position in the execution flow of raw process 104. Execution state is crucial because it encapsulates the context required for seamlessly resuming the raw process.
[0037] According to one embodiment, the virtual machine controller 102 is used to select the original process 104 as the currently executing process. The virtual machine controller 102 intelligently identifies and selects the original process 104 as the currently executing process. The selection of the original process 104 is based on various factors, such as process priority, resource availability, and system performance metrics. By dynamically selecting the original process 104, the virtual machine controller 102 optimizes the utilization of virtual machine system 100 resources and improves overall system efficiency.
[0038] According to one embodiment, the virtual machine controller 102 is used to suspend the original process 104 before modifying its execution state. In one implementation, the original process 104 is suspended by halting operations on the virtual processor 112 (vCPU) executing the original process 104. Suspending the original process 104 allows modification of its execution state without interrupting the original process 104.
[0039] According to one embodiment, the virtual machine controller 102 is used to write the execution state of the original process 104 by performing write operations on the registers and memory pages 110 of the virtual processor 112. In one implementation, the memory page 110 may include one or more associated memory pages. The write operations on the registers enable the virtual machine controller 102 to store relevant data related to the execution state of the original process 104, while the write operations on the memory pages 110 facilitate the persistent preservation of the execution state. Through the write operations on the registers and memory pages 110 of the virtual processor 112, the virtual machine controller 102 ensures the accurate and efficient preservation of the execution state, thereby improving the overall performance and reliability of the virtual machine system.
[0040] The virtual machine controller 102 is also used to modify the execution state of the original process 104. Modifying the execution state of the original process 104 introduces computer code into its execution state. By introducing the computer code into the execution state of the original process 104, the virtual machine controller 102 enables the execution of the injected process. The computer code includes computer instructions that include execution details regarding the injected process 106. The computer code also includes computer instructions that, when executed, cause a forking operation to be performed. In one implementation, a forking operation refers to the operation of a process generating an identical copy of itself. The forking operation supports the creation of the injected process 106, thereby enhancing the functionality and versatility of the virtual machine controller 102. The execution details regarding the injected process 106 confirm that the virtual machine controller 102 has successfully modified the execution state of the original process 104 and introduced computer code. Modifying the execution state of the original process 104 provides significant advantages by enabling the injected process 106 to execute within the virtual machine 108, thereby expanding its capabilities and improving the overall performance of the virtual machine system 100.
[0041] According to one embodiment, the virtual machine controller 102 is further configured to unsuspend the original process 104, thereby enabling the original process 104 to execute in the modified execution state. Unsuspending the original process 104 ensures a seamless transition between the modified execution state and the continued execution of the original process 104. This seamless transition between the modified execution state and the continued execution of the original process 104 indicates a significant reduction in virtual machine system 100 downtime and improved efficiency in managing the execution state of the original process 104.
[0042] The virtual machine controller 102 is also used to execute the original process 104 in a modified execution state. Executing the original process 104 in a modified execution state allows the injected process 106 to fork from the original process 104. By supporting the forking of the injected process 106 from the original process 104, the virtual machine controller 102 facilitates the creation of new processes that inherit the state of the original process 104, thereby providing a seamless and efficient execution environment. The forking operation supports improved resource utilization and enhanced performance of the virtual machine system 100. The ability to fork the injected process 106 from the original process 104 also enables the parallel execution of multiple processes, thereby improving productivity and scalability within the virtual machine 108.
[0043] The virtual machine controller 102 is also used to restore the execution state of the original process 104 based on the restored execution state, so that the original process 104 can continue without interruption.
[0044] The virtual machine controller 102 is used to restore the execution state of the original process 104, thereby enabling the original process 104 to seamlessly resume its operation. By restoring the execution state, the virtual machine controller 102 ensures that the original process 104 can continue uninterrupted without losing any data or progress. The virtual machine controller 102's restoration of the original process 104 provides significant advantages in maintaining the continuity and reliability of the original process 104, thereby improving the overall efficiency and effectiveness of the virtual machine system 100.
[0045] According to one embodiment, the virtual machine controller 102 is also configured to select the original process 104 as the currently not executed process. The selection of the original process 104 is based on specific criteria and is performed by the virtual machine controller 102 to optimize resource allocation within the virtual machine system 100.
[0046] According to one embodiment, the virtual machine controller 102 is used to suspend the original process 104 before resuming its execution state. Suspending the original process 104 allows for uninterrupted execution of the original process 104, and the original process 104 is unsuspended based on its resumed execution state. By combining the suspension and unsustainment of the original process 104 before and after resuming its execution state, the virtual machine controller improves the efficiency and reliability of the entire virtual machine system 100.
[0047] The virtual machine controller 102 is also used to restore the execution state of the original process 104 based on the restored execution state, so that the original process 104 can continue without interruption. By efficiently managing the restoration of the execution state, the virtual machine controller 102 ensures the uninterrupted continuity of the original process 104. The uninterrupted continuity of the original process 104 enables the virtual machine controller 102 to provide a reliable and seamless execution environment for the original process 104, thereby improving the overall efficiency and effectiveness of the virtual machine system 100. The restoration of the execution state by the virtual machine controller 102 greatly contributes to the stability and reliability of the virtual machine system 100, thereby ensuring the smooth and uninterrupted operation of the original process 104.
[0048] According to one embodiment, in order to restore the execution state of the original process 104, the virtual machine controller 102 retrieves the execution state before modifying the execution state of the original process 104 to a copied execution state. Subsequently, the virtual machine controller 102 can restore the execution state by setting the execution state of the original process 104 to a copied execution state. Restoring the execution state of the original process 104 ensures seamless transition and preservation of the execution state of the original process 104 during virtual machine operation. The ability to accurately read and restore the execution state of the original process 104 improves the efficiency and reliability of the virtual machine controller 102, thereby facilitating uninterrupted execution of processes within the virtual machine 108.
[0049] According to one embodiment, the virtual machine controller 102 is used to receive operating system function calls. The operating system function call indicates that the injection process 106 is running. In response to the indication that the injection process 106 is running, the virtual machine controller 102 restores the execution state of the original process 104. Restoring the execution state of the original process 104 enables seamless transition and continuity of the original process 104 and ensures uninterrupted operation within the virtual machine 108. By efficiently managing the execution state restoration process, the virtual machine controller 102 improves the overall performance and reliability of the virtual machine 108. According to this embodiment, the virtual machine controller 102 is also used to receive operating system function calls from the original process 104. According to this embodiment, the virtual machine controller 102 is also used to receive operating system function calls from the injection process 106. In this embodiment, the operating system function call is a hypercall. In one implementation, the hypercall is called an operating system function call, which represents a system-level request to the virtual machine monitor. The hypercall needs to be compatible with the operating system of the virtual machine 108, where specific code customized for the virtual machine monitor is crucial to facilitating the execution of the hypercall.
[0050] According to one embodiment, injection process 106 is used to write binary instructions to memory page 110 and subsequently execute the binary instructions. Executing the binary instructions enables virtual machine controller 102 to dynamically modify the behavior of virtual machine 108 by directly manipulating its memory contents. Injection process 106 is also used to write binary files and invoke the binary files using the exec command. Invoking the binary files supports the execution of custom code within virtual machine 108, thereby providing flexibility and adaptability to virtual machine system 100. Injection process 106 is also used to invoke existing binary files with specific input, thereby enabling virtual machine controller to interact with external programs and utilize the functionality of binary files.
[0051] According to one embodiment, injection process 106 is used to allocate memory space and subsequently execute additional operating system calls to obtain further instructions. By preparing memory space and requesting additional instructions via operating system calls, the injection process enhances the functionality of virtual machine controller 102. Executing additional operating system calls supports efficient resource utilization and enables virtual machine controller 102 to dynamically adapt to changing needs. The ability to allocate memory space and receive additional instructions in a controlled manner can significantly improve the overall performance and flexibility of virtual machine controller 102, thereby providing enhanced operational capabilities.
[0052] The virtual machine controller 102 of this invention significantly reduces operating costs by eliminating the need for pre-installed software managers during deployment and maintenance. The cost-effectiveness of the virtual machine controller 102 is combined with significant enhanced availability because it eliminates the need for additional client installation. Instead, the virtual machine controller 102 supports software execution within a virtual machine (VM) 108 without requiring prior VM preparation. This breakthrough approach of supporting software execution within a virtual machine (VM) 108 without prior VM preparation offers several benefits, including internal monitoring of the VM, automated software installation and configuration, and easy notification capabilities. Furthermore, the virtual machine controller 102 can perform antivirus and anti-malware operations once and for all without leaving any trace, avoiding resource consumption during VM idle periods and preventing malware detection and damage. Moreover, by improving operational efficiency, the virtual machine controller 102 supports VM maintenance operations from external sources, such as cloud user interfaces.
[0053] Furthermore, the virtual machine controller 102 introduces a general paradigm shift, enabling any endpoint with running processes to serve as a means of deploying new add-on software onto a running VM. This transformative concept of deploying new add-on software onto a running VM ensures that the VM 108 seamlessly interprets and executes the add-on code without requiring any prerequisites from the VM itself. Additionally, the virtual machine controller 102 establishes a centralized management center for managing injected applications. This centralized approach to managing injected applications simplifies the management process and enhances control and oversight. Therefore, the virtual machine controller 102 in the virtual machine system 100 improves performance, security, and ease of operation.
[0054] Figure 2 This is a flowchart of a method for a virtual machine controller provided by an embodiment of the present invention, wherein the virtual machine controller is used to execute a virtual machine. Figure 2 It is a combination Figure 1 The elements described in [the document / reference]. Figure 2 , shows the use of ( Figure 1 The flowchart of method 200 for virtual machine controller 102. Method 200 includes steps 202 to 206. Furthermore, ( Figure 1 The virtual machine controller 102 is used to execute method 200.
[0055] A method 200 is provided for a virtual machine controller 102, which executes a virtual machine 108. The virtual machine 108 is executing a raw process 104 that has an execution state.
[0056] According to one embodiment, method 200 includes pausing the original process 104 before modifying its execution state. Pausing the original process 104 allows modification of its execution state without interrupting the execution of the original process 104.
[0057] At step 202, method 200 includes modifying the execution state of the original process 104 to introduce computer code into the execution state of the original process 104. By introducing computer code into the execution state of the original process 104, the virtual machine controller 102 enables the execution of the injected process. The computer code includes computer instructions that include execution details regarding the injected process 106. The computer code also includes computer instructions that, when executed, cause a forking operation to be performed. In one implementation, a forking operation refers to the operation of a process generating an identical copy of itself. The forking operation supports the creation of the injected process 106, thereby enhancing the functionality and versatility of the virtual machine controller 102. The execution details regarding the injected process 106 confirm that the virtual machine controller 102 has successfully modified the execution state of the original process 104 and introduced computer code. Modifying the execution state of the original process 104 provides significant advantages by enabling the injected process 106 to execute within the virtual machine 108, thereby expanding its capabilities and improving the overall performance of the virtual machine system 100.
[0058] According to another embodiment, method 200 includes unpausing the original process 104, thereby enabling the original process 104 to execute in a modified execution state. Unpausing the original process 104 ensures a seamless transition between the modified execution state and the continued execution of the original process 104. This seamless transition between the modified execution state and the continued execution of the original process 104 indicates a significant reduction in virtual machine system 100 downtime and improved efficiency in managing the execution state of the original process 104.
[0059] At step 204, method 200 further includes executing the original process 104 in the modified execution state, thereby enabling the injected process 106 to fork from the original process 104. By supporting the forking of the injected process 106 from the original process 104, the virtual machine controller 102 facilitates the creation of new processes that inherit the state of the original process 104, thus providing a seamless and efficient execution environment. The forking operation supports improved resource utilization and enhanced performance of the virtual machine system 100. The ability to fork the injected process 106 from the original process 104 also enables the parallel execution of multiple processes, thereby improving productivity and scalability in the virtual machine 108.
[0060] At step 206, method 200 further includes restoring the execution state of the original process 104 based on the restored execution state, so that the original process 104 can continue uninterrupted. By efficiently managing the restoration of the execution state, the virtual machine controller 102 ensures the uninterrupted continuity of the original process 104. The uninterrupted continuity of the original process 104 enables the virtual machine controller 102 to provide a reliable and seamless execution environment for the original process 104, thereby improving the overall efficiency and effectiveness of the virtual machine system 100. The restoration of the execution state by the virtual machine controller 102 greatly contributes to the stability and reliability of the virtual machine system 100, thereby ensuring the smooth and uninterrupted operation of the original process 104.
[0061] According to one embodiment, method 200 includes pausing the original process 104 before restoring its execution state. Pausing the original process 104 allows for uninterrupted execution of the original process 104, and the original process 104 is unpaused based on its restored execution state. By combining the pausing and unpausing of the original process 104 before and after restoring its execution state, the virtual machine controller improves the efficiency and reliability of the entire virtual machine system 100.
[0062] Steps 202 to 206 are merely illustrative, and other alternatives may be provided, in which one or more steps are added, one or more steps are deleted, or one or more steps are provided in a different order, without departing from the scope of the claims herein.
[0063] A computer program product is also provided, including program instructions for executing method 200 when executed by one or more processors in virtual machine system 100. The computer program product is implemented as an algorithm and embedded in software stored in a non-transitory computer-readable storage medium. The non-transitory computer-readable storage module may include, but is not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. Examples of implementations of the computer-readable storage medium are, but are not limited to, electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), read-only memory (ROM), hard disk drive (HDD), flash memory, secure digital (SD) cards, solid-state drives (SSDs), computer-readable storage media, and / or CPU cache memory.
[0064] Figure 3This is a diagram illustrating the architecture of a method for injecting a process into a virtual machine, provided by an embodiment of the present invention. Figure 3 It is a combination Figure 1 The elements described in [the document / reference]. Figure 3 The diagram illustrates the architecture 300 for a method used by a virtual machine controller 102 to inject a process into a virtual machine 108. The virtual machine 108 is used to execute the original process 104 and the injected process 106.
[0065] A virtual machine monitor 302 for implementing virtual machine 108 is shown. In one implementation, virtual machine monitor 302 refers to the type of computer software, firmware, or hardware that creates and runs virtual machine 108. The computer on which virtual machine monitor 302 runs one or more virtual machines 108 is called the host, and each virtual machine 108 can be called a guest. Virtual machine monitor 302 can present a virtual operating platform to the guest operating system and manage the execution of the guest operating system. Examples of virtual machine monitor 302 may include, but are not limited to, virtual machine monitors (VMMs) or virtualizers.
[0066] Virtual machine 108 can also be implemented by injector 304. Injector 304 is used to inject process 106 into virtual machine 108. Injector 304 refers to the computational mechanism used to seamlessly introduce the execution state of the original process 104 into virtual machine 108. Embodiments of injector 304 may include, but are not limited to, security patch injectors, real-time monitoring injectors, auto-configuration injectors, resource optimization injectors, dynamic scaling injectors, feature extension injectors, A / B testing injectors, or debug injectors.
[0067] Figure 4 This is a diagram illustrating the sequence of the injection process provided in an embodiment of the present invention. Figure 4 It is a combination Figure 1 and Figure 3 The elements are described. (See reference.) Figure 4 An exemplary figure 400 is shown, illustrating a sequence stream of methods for a virtual machine controller 102, which is used to execute a virtual machine 108.
[0068] In an exemplary scenario, virtual machine 108 is shown running at least one process. Virtual machine 108 also runs with injector 304 via virtual machine monitor 302. Injector 304 is capable of pausing and reading virtual processor 112 of virtual machine 108, reading and modifying memory pages 110 of virtual machine 108, and reading and modifying process memory by extension.
[0069] At operation 402, injector 304 is used to pause the original process 104 before modifying its execution state. Pausing the original process 104 allows modification of its execution state without interrupting its execution.
[0070] At operation 404, injector 304 modifies the execution state of the original process 104. Modifying the execution state of the original process 104 introduces computer code into its execution state. By introducing the computer code into the execution state of the original process 104, virtual machine controller 102 enables the execution of the injected process. The computer code includes computer instructions that include execution details regarding the injected process 106. Before modifying the execution state of the original process 104, injector 304 writes the execution state of the original process 104 to registers and memory pages 110 of the virtual processor 112. In one implementation, memory pages 110 may include one or more associated memory pages. Write operations on registers allow virtual machine controller 102 to store relevant data related to the execution state of the original process 104, while write operations on memory pages 110 facilitate the persistent storage of the execution state. By writing to the registers of the virtual processor 112 and the memory pages 110, the virtual machine controller 102 ensures the accurate and efficient saving of the execution state, thereby improving the overall performance and reliability of the virtual machine system.
[0071] At operation 406, injector 304 is also used to unsuspend the original process 104, thereby enabling the original process 104 to execute in the modified execution state. Unsuspending the original process 104 ensures a seamless transition between the modified execution state and the continued execution of the original process 104. This seamless transition between the modified execution state and the continued execution of the original process 104 indicates a significant reduction in virtual machine system 100 downtime and improved efficiency in managing the execution state of the original process 104.
[0072] At operation 408, the injector 304 is also used to execute the original process 104 in the modified execution state, so that the injected process 106 can fork from the original process 104. By supporting the forking of the injected process 106 from the original process 104, the virtual machine controller 102 facilitates the creation of new processes that inherit the state of the original process 104, thereby providing a seamless and efficient execution environment. The forking operation supports improved resource utilization and enhanced performance of the virtual machine system 100. The ability to fork the injected process 106 from the original process 104 also enables the parallel execution of multiple processes, thereby improving productivity and scalability in the virtual machine 108.
[0073] At operation 410, injector 304 uses virtual machine controller 102 to suspend original process 104 before resuming the execution state of original process 104.
[0074] At operation 412, the injector 304 is also used to restore the execution state of the original process 104, thereby enabling the original process 104 to seamlessly resume its operation. By restoring the execution state, the injector 304 ensures that the original process 104 can continue uninterrupted without losing any data or progress. The virtual machine controller 102's restoration of the original process 104 provides significant advantages in maintaining the continuity and reliability of the original process 104, thereby improving the overall efficiency and effectiveness of the virtual machine system 100.
[0075] At operation 414, the injector 304 is used to unsuspend the original process 104 based on the restored execution state, so that the execution of the original process 104 can be uninterrupted. Furthermore, at operation 416, the virtual machine 108 is used to execute the injected process 106. Simultaneously, at operation 418, the virtual machine 108 is used to execute the original process 104.
[0076] Figure 5 This is a sequence diagram illustrating an exemplary implementation of reading the execution state of an original process before modifying the execution state of the original process, according to an embodiment of the present invention. Figure 5 It is a combination Figure 1 , Figure 2 , Figure 3 and Figure 4 The elements are described. (See reference.) Figure 5 Figure 500 illustrates an exemplary implementation of a sequence diagram used to read the execution state of the original process 104 before modifying its execution state.
[0077] In an exemplary scenario, virtual machine 108 is shown running at least one process. Virtual machine 108 runs in conjunction with injector 304 to execute the original process 104 and the injected process 106. Virtual machine system 100 starts by randomly selecting a process within virtual machine 108. In this exemplary scenario, the selected process is referred to as the original process 104. Subsequently, the memory associated with the original process 104 is modified by introducing a new instruction set. The introduction of the new instruction set lays the foundation for the operation of injecting new functionality / code into virtual machine 108.
[0078] At operation 502, the injector 304 suspends the execution of the original process 104 by halting the execution of the virtual processor 112 of the virtual machine 108. This pause operation is crucial to ensuring that the original process 104 and its corresponding memory can be accurately modified and analyzed without being affected by ongoing computations.
[0079] At operation 504, injector 304 selects a user-space process within virtual machine 108. The result of the user-space process selection can be communicated to injector 304 via any of operations (i.e., operations 506, 508, and 510).
[0080] At operation 506, injector 304 specifically targets a process with a specific process ID (PID). At operation 508, injector 304 can select a running application (user-space process) by examining the registers of the virtual processor 112 (vCPU) of virtual machine 108. If a suitable process is unavailable, or under certain circumstances, virtual processor 112 can temporarily resume, then pause again after a short interval, followed by another selection attempt. At operation 510, injector 310 can also select a currently suspended application by analyzing the memory used by the kernel. Operation 510 requires knowledge of the operating system and kernel version of virtual machine 108. It should be noted that the user-space selection process may require a combination of operations 506, 508, and 510.
[0081] At operations 512 and 514, after selecting a user-space process, injector 304 reads executable memory pages and identifies the memory page containing the currently executing instructions. Reading executable memory pages is crucial for accurately locating the exact segment of memory page 110 that needs to be modified to be introduced into injection process 106.
[0082] At operation 516, the injector 304 saves the selected memory page data by reading the executable memory page in memory page 110 of virtual machine 108.
[0083] At operation 518, injector 304 reads the current register value of virtual processor 112 of virtual machine 108.
[0084] At operation 520, injector 304 continues to save the current register value and the contents of the selected memory page associated with the selected user-space process. Saving the current register value and the contents of the selected memory page ensures that the state of the original process 104 is preserved, thereby supporting accurate recovery and restart after the injection process 106 completes.
[0085] At operation 522, injector 304 writes new instructions into the associated memory pages and registers of virtual processor 112 to modify the execution state of original process 104.
[0086] At operations 524 and 526, if injection process 106 spans multiple memory pages, additional memory pages can also be identified. Optionally, if no next memory page is mapped, a random memory page with executable permissions can be selected. Random selection of memory pages ensures correct execution of the injected code across memory segments. It should be noted that operations 524 and 526 can run in a loop.
[0087] Figure 6 This is a sequence diagram illustrating an exemplary implementation of injecting a process from a forked source process according to an embodiment of the present invention. Figure 6 It is a combination Figure 1 , Figure 2 and Figure 3 The elements are described. (See reference.) Figure 6 The diagram 600 illustrates an exemplary implementation of injecting process 106 by forking from the original process 104.
[0088] In the exemplary scenario, virtual machine 108 is shown running at least one process. Virtual machine 108 is run via injector 304 for executing the original process 104 and the injected process 106.
[0089] At operation 602, injector 304 injects new code into the execution state of the original process 104 starting from the position indicated by the instruction pointer, and cancels the suspension of the original process 104 in the modified execution state.
[0090] At operation 604, a fork operation is initiated. The fork operation results in the creation of a child process, which is a copy of the original process 104. The child process can be distinguished by a return register set to 0. In one implementation, the injected process 106 is referred to as the child process.
[0091] At operation 606, the contact / interaction has been modified to incorporate the memory page of injected process 106. Interaction with the modified memory page is typically achieved through memory write operations to ensure the modified page is adequately prepared for execution.
[0092] At operation 608, the injection process 106 executes a hypercall, and the memory is copied and owned by the injection process 106. Executing the hypercall initiates the injection process 106. The execution of the hypercall signifies the actual execution of the injection process 106 introduced through injection. The injection process 106 can directly execute binary instructions from memory. Executing binary instructions directly from memory page 110 grants the injection process 106 the ability to perform a range of functions defined by the injected binary code. The virtual machine 108 can also facilitate the creation of a binary file on disk and the execution of that binary file using the "exec" command. Executing the binary file supports performing more complex operations or tasks beyond the capabilities of memory execution. Alternatively, in one approach, the virtual machine 108 can prompt an existing binary file to run with specific input. This approach supports leveraging sophisticated binary tools or interpreters (such as "bash" or "python") to perform specialized operations. The virtual machine 108 can prepare additional memory space using the "mmap" call and then trigger another hypercall to receive further instructions. Dynamic memory allocation supports more granular process execution.
[0093] At operation 610, another super call is executed for the original process 104. This super call serves a specific purpose related to process management and control. Specifically, the super call is executed while the original process 104 is waiting for notification from the injected process 106.
[0094] At operation 612, injector 304 suspends the original process 104 before resuming its execution state.
[0095] At operation 614, the contents of the memory pages modified as part of the injection process are restored, so that the original data is written to the modified memory pages. Operation 614 can be run in a loop to write several memory pages.
[0096] At operation 616, injector 304 restores the execution state of the original process 104. Restoring the execution state of the original process 104 involves resetting the registers, including the instruction pointer, to their initial values.
[0097] At operation 618, the injector cancels the pause on the original process 104 based on the restored execution state, so that the execution of the original process 104 can be uninterrupted.
[0098] Virtual machine controller 102 enables virtual machine monitor system administrators to seamlessly extend the capabilities of running virtual machines (VMs) without requiring the installation of supplementary software or causing any operational downtime. Virtual machine controller 102 utilizes injector 304 to introduce and execute additional software within virtual machine system 100. Injector 304 ensures the dynamic expansion of virtual machine 108's capabilities without the complexities associated with traditional software installation processes or interrupting ongoing operations.
[0099] The virtual machine controller 102 is designed to operate within a virtual machine environment that runs a source process 104 with a specific execution state. This execution state forms the basis for introducing computer code into the source process 104. The computer code encompasses computer instructions, which cover two key aspects: execution details regarding the injected process 106 and computer instructions that trigger the forking operation. The virtual machine controller 102 can modify the execution state of the source process 104 to introduce computer code, allowing new functionality and processes to be integrated into the existing VM ecosystem without interrupting the source process 104. Modifying the execution state of the source process 104 enables the virtual machine controller 102 to fundamentally change the behavior and functionality of the virtual machine 108 while maintaining its operational integrity. Furthermore, executing the source process 104 in the modified execution state allows the injected process 106 to fork from the source process 104. This innovative concept of forking from an existing execution state changes the way injected processes are integrated into the virtual machine 108. Forking the injected process 106 into the source process 104 provides a more seamless and efficient method, mitigating potential conflicts or inconsistencies that may arise with traditional process integration methods. Furthermore, the virtual machine controller 102 restores the execution state of the original process 104. Restoring the execution state of the original process 104 ensures that the original process continues its execution uninterrupted based on the restored execution state. This complex orchestration of modifying, executing, and restoring processes demonstrates the virtual machine controller 102's ability to achieve overall stability and functionality of the virtual machine 108, contributing to a more robust and efficient virtual machine system 100.
[0100] Modifications to the embodiments of the invention described above may be made without departing from the scope of the invention as defined by the appended claims. Expressions such as “comprising,” “integrating,” “having,” “is / are,” etc., used to describe and claim the invention are intended to be interpreted in a non-exclusive manner, including items, components, or elements not explicitly described. Singular references should also be interpreted as relating to the plural. The term “exemplary” as used herein means “as an example, instance, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments, or does not exclude features in combination with other embodiments. The term “optionally” as used herein means “provided in some embodiments and not in others.” It should be understood that certain features of the invention described in the context of a single embodiment for clarity may also be provided in combination in a single embodiment. Conversely, various features of the invention described in the context of a single embodiment for brevity may also be provided individually or in any suitable combination or as embodiments of any other described aspect of the invention.
Claims
1. A virtual machine controller (102) for executing a virtual machine (108), characterized in that, The virtual machine (108) is executing a raw process (104) with an execution state, wherein the virtual machine controller (102) is further configured to: Modify the execution state of the original process (104) to introduce computer code into the execution state of the original process (104), wherein the computer code includes: Includes computer instructions regarding the execution details of the injection process (106), Computer instructions that, when executed, cause a fork operation to be performed. The original process (104) is executed in the modified execution state, thereby enabling the injected process (106) to fork from the original process (104). Based on the restored execution state, the execution state of the original process (104) is restored so that the original process (104) can continue without interruption.
2. The virtual machine controller (102) according to claim 1, characterized in that, The virtual machine controller (102) is also used for: Before modifying the execution state of the original process (104), the original process (104) is paused. Cancel pausing the original process (104) to support the execution of the original process (104) in the modified execution state, and The original process (104) is paused before its execution state is restored. Based on the restored execution state, the original process (104) is unsuspended so that the execution of the original process (104) can proceed without interruption.
3. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The virtual machine controller (102) is also used for: Before modifying the execution state to the copied execution state, read the execution state of the original process (104); The execution state of the original process (104) is restored by setting the execution state to the execution state of the copy.
4. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The virtual machine controller (102) is also used for: The execution state is written by writing to the registers of the virtual processor (112) and by writing to the associated memory page (110).
5. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The virtual machine controller (102) is also configured to receive operating system function calls that indicate that the injected process (106) is running, and in response, restore the execution state of the original process (104).
6. The virtual machine controller (102) according to claim 5, characterized in that, The virtual machine controller (102) is also used to receive operating system function calls from the original process (104).
7. The virtual machine controller (102) according to claim 5, characterized in that, The virtual machine controller (102) is also used to receive the operating system function calls from the injection process (106).
8. The virtual machine controller (102) according to any one of claims 5 to 7, characterized in that, The operating system function call is a super call.
9. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The virtual machine controller (102) is also used to select the original process (104) as the currently executing process.
10. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The virtual machine controller (102) is also used to select the original process (104) as the currently not executed process.
11. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The injection process (106) is used for: Write binary instructions into memory and execute the binary instructions; Write a binary file and invoke it using the exec command; and / or Use specific input to invoke an existing binary file.
12. The virtual machine controller (102) according to any one of the preceding claims, characterized in that, The injection process (106) is used to prepare memory space and then execute another operating system call to receive more instructions.
13. A method (200) for a virtual machine controller (102), characterized in that, The virtual machine controller (102) is used to execute a virtual machine (108), wherein the virtual machine (108) is executing a raw process (104) having an execution state, wherein the method (200) includes: Modify the execution state of the original process (104) to introduce computer code into the execution state of the original process (104), wherein the computer code includes: Includes computer instructions regarding the execution details of the injection process (106), Computer instructions that, when executed, cause a fork operation to be performed. The original process (104) is executed in the modified execution state, thereby enabling the injected process (106) to fork from the original process (104). Based on the restored execution state, the execution state of the original process (104) is restored so that the original process (104) can continue without interruption.
14. The method (200) according to claim 13, characterized in that, The method (200) further includes: Before modifying the execution state of the original process (104), the original process (104) is paused. Cancel pausing the original process (104) to support the execution of the original process (104) in the modified execution state, and The original process (104) is paused before its execution state is restored. Based on the restored execution state, the original process (104) is unsuspended so that the execution of the original process (104) can proceed without interruption.
15. A computer program product, characterized in that, Includes program instructions for performing the method (200) according to claim 13 or 14 when executed by one or more processors in the virtual machine system (100).