CN110837405A - Multi-instance graphic desktop running and switching method based on container technology - Google Patents

Multi-instance graphic desktop running and switching method based on container technology Download PDF

Info

Publication number
CN110837405A
CN110837405A CN201911066670.2A CN201911066670A CN110837405A CN 110837405 A CN110837405 A CN 110837405A CN 201911066670 A CN201911066670 A CN 201911066670A CN 110837405 A CN110837405 A CN 110837405A
Authority
CN
China
Prior art keywords
container
instance
desktop
switching
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911066670.2A
Other languages
Chinese (zh)
Inventor
巨魔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Lei Feng Electronic Technology Co Ltd
Original Assignee
Xi'an Lei Feng Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Lei Feng Electronic Technology Co Ltd filed Critical Xi'an Lei Feng Electronic Technology Co Ltd
Priority to CN201911066670.2A priority Critical patent/CN110837405A/en
Publication of CN110837405A publication Critical patent/CN110837405A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a multi-instance graphic desktop running and switching method based on a container technology, which comprises the following steps: manufacturing a desktop based on containers, and starting a plurality of containers to realize a multi-instance desktop; the graphical interfaces of the multiple desktops are configured on different vt of the host machine, the multi-instance graphical desktops are achieved, and switching and simultaneous operation of the multi-instance graphical desktops are achieved through switching of vt. The invention can save the performance of the host machine to the maximum extent by using the container technology to realize the desktop virtualization, the configurability of the client machine is strong, and the switching of the multi-instance graphic desktop can be equal to the multi-instance switching of the traditional IDV virtualization.

Description

Multi-instance graphic desktop running and switching method based on container technology
Technical Field
The invention relates to the technical field of container technology and virtualization desktops, in particular to a multi-instance graphics desktop running and switching method based on the container technology.
Background
In the field of virtualization, container technology is generally used for centrally deploying applications on a server, and in the field of idv (intelligentdesktop virtualization), desktop virtualization is implemented by using container technology, which inevitably involves a graphical interface and multiple instances.
On the linux system, a plurality of virtual terminals (vt) can be started, which are commonly the console terminals of tty 1-6 and the graphic terminal of tty 7. In fact, the linux system can run more virtual terminals, and can also start a plurality of X11(X Window system) graphical interfaces on different virtual terminals.
In the IDV field, desktop virtualization is typically implemented using virtual machine technology. That is, whenever a virtual desktop is added, a new virtual machine is generated by the virtualization hypervisor and one or more virtual disk files are created for it, which are run by a particular virtualization program (e.g., qemu, vmware, etc.). Within these virtual desktops, it is often necessary to install a client agent for performing specific management actions performed by the virtualization hypervisor. The switching of the multi-instance desktop is an interface (or window) switching action executed by the virtualization management program through communication between the client agent program and the virtualization management program.
Because the traditional IDV desktop uses the virtual disk file, the disk space of the virtual desktop is determined in advance, and even if the disk capacity expansion can be carried out, a plurality of steps are needed and are respectively operated inside and outside the virtual machine; the safety of the data depends on the management of the virtual disk file, and once the virtual disk file is damaged, the data can not be found out; the virtual disk file generally grows along with the use of the virtual machine, and the migration of the virtual machine can cause a large amount of data transmission, so that transmission media such as a network are tested. In addition, the traditional IDV desktop needs a host to support CPU virtualization, so that there is a hard requirement for the device, and the host configured at the low end may not be used as an IDV terminal. Meanwhile, when the traditional IDV desktop is started, predefined memory can be applied, even if the desktop does not need much memory during running, the waste of memory resources is caused, one IDV terminal can only run 1-2 desktops and is easy to compete for the memory with a host machine.
Disclosure of Invention
The invention aims to provide a multi-instance graphic desktop running and switching method based on a container technology, and solves the technical problem that in the prior art, when a low-configuration host is used as an IDV terminal, the terminal performance is not enough to support a multi-instance desktop.
In order to achieve the purpose, the invention provides the following technical scheme:
the multi-instance graphic desktop running and switching method based on the container technology comprises the following steps:
s1, manufacturing a container-based desktop, and starting a plurality of containers to realize a multi-instance desktop;
s2, configuring the graphical interfaces of the multiple desktops on different vt of the host machine to realize the multiple-instance graphical desktops, and realizing the mutual switching and the simultaneous operation of the multiple-instance graphical desktops by switching vt.
Further, in S1, the creating a container-based desktop specifically includes first packaging a file system as an image file, then using a container engine, importing the image file as a container image, and finally using the container engine to create a desktop based on the container image.
Further, in S1, the step of starting multiple containers to implement the multi-instance desktop specifically includes:
s101, configuring specific options or parameters for each container by a virtualization management program, and configuring a graphical interface to different vt of a host machine;
s102, operating a plurality of container instances by using a container engine, and switching vt to vt appointed by any container instance;
s103, each desktop instance is independently displayed by using the respective vt, and a plurality of instances run simultaneously.
Further, in S2, the switching between the multiple-instance graphics desktops specifically includes:
s201, running a client agent program in each desktop instance, wherein the program takes a local socket file as a communication interface;
s202, before calling a container engine to run a desktop instance, a virtualization management program creates a local socket file and monitors the file to provide service for a client; and the directory where the socket file is located is configured in a container option as a configuration item, so that a container instance can read and write the file;
s203, in the container example, after receiving a command for switching by clicking of a user, a client agent program interface writes a switching command into the local socket file through a predefined communication protocol;
and S204, when the virtualization management program receives the switching command, switching the current vt to the vt where the specified desktop instance is positioned by using the system command.
The virtualization management program (desktop management program) needs to have the following functions: calling a container engine tool to start a container instance; calling a container engine to perform other operations on the container; managing Virtual Terminals (VTs) of hosts and configuring which VT each instance should use; managing local sockets communicating with the client agent, creating a monitoring; processing commands and requests from the client agent; sending a server management command to the client agent; and so on.
The client agent described above needs to have the following functions: actively connecting a local socket for communicating with the virtualization hypervisor; providing a user interface for indicating desktop instances to which a user is switchable; processing a management command sent by a virtualization management program; and so on.
The multi-instance graphic desktop running and switching method based on the container technology has the advantages that: the container technology is used to enable the desktop to only occupy the required memory, so that the application is applied as required, the memory resource is saved, the performance of the host machine can be saved to the maximum extent by the realized desktop virtualization, the configurability of the client machine is strong, and the switching of the multi-instance graphics desktop can be equal to the multi-instance switching of the traditional IDV virtualization.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a virtual desktop and vt of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a preferred embodiment, shown in fig. 1, the multi-instance graphics desktop running and switching method based on container technology of the present invention comprises the following steps:
s1, manufacturing a container-based desktop, and starting a plurality of containers to realize a multi-instance desktop;
specifically, in S1, creating a container-based desktop includes:
a. first, a file system is packaged as an image file. For example, the file system of the current operating system may be packaged into a file package with the suffix tar using the system command as the image file.
The most basic method for packaging the file system is to operate a linux system and execute the following commands under the system to package files: tar-cvpf/tmp/system-tar-direction-excclude-proc-excclude-system-exclude-dev-excclude-run-excclude-boot.
The system tar file that is printed at this time is the mirror image file, and can be used for importing as the container mirror image. Other packaging modes can also be as follows: decompressing live system files (system. quashfs) in an operating system optical disc, modifying and adapting the live system files, and then, using a system command to pack the live system files into tar file packets; manufacturing a basic file system by using a buildroot tool, manually adding required related files, and then, using a system command to print the files into a tar file packet; file system directories and related files are created manually, packages of files are typed into tar using system commands, and so on.
b. And then using the container engine to import the mirror image file into a container mirror image.
For example, taking a docker engine as an example, the following commands are used to import the image file as a docker container image:
docker import/path/to/exampleimage.tar
c. finally, a container, i.e., a desktop, is created based on the container image using a container engine.
As an example of a docker engine, a desktop is created using the following commands:
docker create image-name-name desktop-name
in S1, the step of starting a plurality of containers to implement the multi-instance desktop specifically includes:
s101, configuring specific options or parameters for each container by a virtualization management program, and configuring a graphical interface to different vt of a host machine;
specifically, the steps above, and the steps below, should be encapsulated by the virtualization hypervisor. After the desktop is successfully created, option parameters of the desktop need to be configured, and the option parameters are enabled to display the graphical interface on the designated vt of the host machine.
Taking a docker engine as an example, a docker-init directory should be created for each desktop, and a vt information configuration file is created, where the file name is usually 60_ xvt4docker.
[LightDM]
minimum-vt=19
The intention is to write a configuration file of Light Display Manager (Light Display Manager), for which the vt number where the first vt is located is specified.
S102, operating a plurality of container instances by using a container engine, and switching vt to vt appointed by any container instance;
the virtualization manager runs the configured container using a container running command, such as docker, for example, a linux client, and starts the desktop using the following command:
docker run desktop-id/sbin/init-v/path/to/docker-init:/usr/lib/docker-init
the/sbin/init is a starting process of a normal linux system, the container instance runs the process, namely a linux system is run in the container, and the configuration directory is mounted in the container instance. When the container instance internal lightdm is started, the graphical interface of the container instance internal lightdm is displayed on the specified vt through the description of the configuration file. Other parameters are omitted here. These are encapsulated inside the virtualization hypervisor, including creating containers, importing images, etc. as described above, not necessarily in the form of command lines, but also programming interfaces of the corresponding container engines.
After the desktop is started, the virtualization management program switches the display to the vt of the corresponding desktop using a system command such as chvt 19. According to common usage logic, a user will first enter one desktop, then work on that desktop, and then back up the administrative interface and enter another desktop. In this process, both the fallback management interface and the multi-instance switch described below use the capabilities described in the multi-instance switch section.
S103, each desktop instance is independently displayed by using the respective vt, and a plurality of instances run simultaneously.
The user can return back to the management interface for multiple times and restart the new desktop until the system resources do not allow the new desktop to be restarted, and at the moment, the multi-instance desktop runs successfully.
Because the configured vt of each desktop instance is different, the graphical interface display of each desktop is not influenced mutually, and the graphical interface display is also in complementary interference with the management interface of the host machine.
S2, configuring the graphical interfaces of the multiple desktops on different vt of the host machine to realize the multiple-instance graphical desktops, and realizing the mutual switching and the simultaneous operation of the multiple-instance graphical desktops by switching vt.
Further, in S2, the switching between the multiple-instance graphics desktops specifically includes:
s201, running a client agent program in each desktop instance, wherein the program takes a local socket file as a communication interface;
each desktop runs a client agent program to connect with a local socket file under a fixed directory, and the socket file is mounted to the client in a mounting mode. The client agent may typically act as a daemon, leaving only one icon in the notification area of the client operating system interface, through outgoing menus and user interaction to provide services. The client agent needs to have at least two items of functionality, namely a fallback management interface and a switching desktop, which needs to be able to list the currently switchable desktop, this information informing the client agent when each new desktop instance is started by the virtualization manager of the host.
S202, before calling a container engine to run a desktop instance, a virtualization management program creates a local socket file and monitors the file to provide service for a client; and the directory where the socket file is located is configured in a container option as a configuration item, so that a container instance can read and write the file;
as with the configuration file for the vt information, the virtualization management program should create a local socket file for each desktop instance and monitor separately.
S203, in the container example, after receiving a command for switching by clicking of a user, a client agent program interface writes a switching command into the local socket file through a predefined communication protocol;
and S204, when the virtualization management program receives the switching command, switching the current vt to the vt where the specified desktop instance is positioned by using the system command.
The above local socket: i.e., UNIX domain sockets, as a means to communicate between processes via socket files.
In the invention, when the CPU and the memory resources of the host are enough, a plurality of containers can be operated. And each container runs a sbin/init process respectively, and the graphical interface is configured on different VTs of the host machine, so that the multi-instance graphical desktop can be realized.
On linux, the chvt command can be switched to each VT, and the chvt command is sent to the host machine through client matched software, so that the switching of the multi-instance graphic desktop and the capability of switching to a host machine management interface can be realized.
In the present invention, the mirror image: refers to a file system for running an operating system. The mirror image file refers to that the file system is stored in a file mode; the container image is a file system stored in a manner defined by a container engine, and is usually a container image.
The container engine is a software tool for creating and operating a container.
The container means: an operating system runs on the basis of a mirror (or snapshot) file system, and changes to the file system during running are saved in specific locations. The container can be submitted as a container mirror or saved as a container snapshot at non-run time, and the user data is saved as a container image or a container tag when the container is submitted or saved as a snapshot.
Examples of the container are: the process instance, i.e., the desktop instance, is launched by the container engine.
The snapshot refers to: and solidifying and saving the current state of the container as a container tag.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (4)

1. The multi-instance graphic desktop running and switching method based on the container technology is characterized by comprising the following steps of:
s1, manufacturing a container-based desktop, and starting a plurality of containers to realize a multi-instance desktop;
s2, configuring the graphical interfaces of the multiple desktops on different vt of the host machine to realize the multiple-instance graphical desktops, and realizing the mutual switching and the simultaneous operation of the multiple-instance graphical desktops by switching vt.
2. The container technology based multi-instance graphics desktop running and switching method of claim 1, wherein: in S1, creating a container-based desktop specifically includes packaging a file system as an image file, using a container engine to import the image file as a container image, and using the container engine to create a desktop based on the container image.
3. The container technology based multi-instance graphics desktop running and switching method of claim 1, wherein: in S1, the step of starting a plurality of containers to implement the multi-instance desktop specifically includes:
s101, configuring specific options or parameters for each container by a virtualization management program, and configuring a graphical interface to different vt of a host machine;
s102, operating a plurality of container instances by using a container engine, and switching vt to vt appointed by any container instance;
s103, each desktop instance is independently displayed by using the respective vt, and a plurality of instances run simultaneously.
4. The container technology based multi-instance graphics desktop running and switching method of claim 1, wherein: in S2, the switching between the multiple-instance graphics desktops specifically includes:
s201, running a client agent program in each desktop instance, wherein the program takes a local socket file as a communication interface;
s202, before calling a container engine to run a desktop instance, a virtualization management program creates a local socket file and monitors the file to provide service for a client; and the directory where the socket file is located is configured in a container option as a configuration item, so that a container instance can read and write the file;
s203, in the container example, after receiving a command for switching by clicking of a user, a client agent program interface writes a switching command into the local socket file through a predefined communication protocol;
and S204, when the virtualization management program receives the switching command, switching the current vt to the vt where the specified desktop instance is positioned by using the system command.
CN201911066670.2A 2019-11-04 2019-11-04 Multi-instance graphic desktop running and switching method based on container technology Pending CN110837405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911066670.2A CN110837405A (en) 2019-11-04 2019-11-04 Multi-instance graphic desktop running and switching method based on container technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911066670.2A CN110837405A (en) 2019-11-04 2019-11-04 Multi-instance graphic desktop running and switching method based on container technology

Publications (1)

Publication Number Publication Date
CN110837405A true CN110837405A (en) 2020-02-25

Family

ID=69576063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911066670.2A Pending CN110837405A (en) 2019-11-04 2019-11-04 Multi-instance graphic desktop running and switching method based on container technology

Country Status (1)

Country Link
CN (1) CN110837405A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367609A (en) * 2020-03-06 2020-07-03 北京云创世联科技股份有限公司 Desktop switching method based on intelligent desktop virtualization IDV framework

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290858A1 (en) * 2012-04-25 2013-10-31 Vmware, Inc. User Interface Virtualization Profiles for Accessing Applications on Remote Devices
CN103677962A (en) * 2013-12-20 2014-03-26 上海电机学院 System and method for achieving desktop delivery device based on virtualization technology
CN104331319A (en) * 2014-11-14 2015-02-04 华为技术有限公司 Method and device for managing virtual desktop instances
CN104536802A (en) * 2014-12-19 2015-04-22 中兴通讯股份有限公司 Method for achieving calling of applications and virtual machine
CN109388454A (en) * 2018-09-14 2019-02-26 珠海国芯云科技有限公司 Virtual desktop method and system based on container

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290858A1 (en) * 2012-04-25 2013-10-31 Vmware, Inc. User Interface Virtualization Profiles for Accessing Applications on Remote Devices
CN103677962A (en) * 2013-12-20 2014-03-26 上海电机学院 System and method for achieving desktop delivery device based on virtualization technology
CN104331319A (en) * 2014-11-14 2015-02-04 华为技术有限公司 Method and device for managing virtual desktop instances
CN104536802A (en) * 2014-12-19 2015-04-22 中兴通讯股份有限公司 Method for achieving calling of applications and virtual machine
CN109388454A (en) * 2018-09-14 2019-02-26 珠海国芯云科技有限公司 Virtual desktop method and system based on container

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367609A (en) * 2020-03-06 2020-07-03 北京云创世联科技股份有限公司 Desktop switching method based on intelligent desktop virtualization IDV framework

Similar Documents

Publication Publication Date Title
US11687422B2 (en) Server clustering in a computing-on-demand system
US10642638B2 (en) Virtual machine placement with automatic deployment error recovery
CN111338854B (en) Kubernetes cluster-based method and system for quickly recovering data
CN108255497B (en) Application deployment method and device
US7992032B2 (en) Cluster system and failover method for cluster system
US20190250960A1 (en) Method, apparatus, and server for managing image across cloud servers
US11210132B2 (en) Virtual machine migration in virtualization environment having different virtualization systems
WO2011083673A1 (en) Configuration information management system, configuration information management method, and configuration information management-use program
JP2021524104A (en) Master / Standby Container System Switching
JP2008107966A (en) Computer system
CN110489305B (en) Server management method and device
JP2007323354A (en) Machine management system
CN110837405A (en) Multi-instance graphic desktop running and switching method based on container technology
JP2001290665A (en) Processor system
CN110471744B (en) Password modification method, device, equipment and computer readable storage medium
CN110795209B (en) Control method and device
CN105743696A (en) Cloud computing platform management method
CN115509563B (en) Mirror image file manufacturing method, device, equipment and medium
CN116339926B (en) Containerized deployment method of ATS software
EP4195021A1 (en) Online migration method and system for bare metal server
US11868769B1 (en) Automatically determining and modifying environments for running microservices in a performant and cost-effective manner
US20230325222A1 (en) Lifecycle and recovery for virtualized dpu management operating systems
CN116010017A (en) Interaction method, computer equipment and computer storage medium
CN117692359A (en) Port monitoring method, device, equipment and medium
CN117272285A (en) Unikernel operation method and device based on Kubernetes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination