Method for operating multiple operating systems by using virtual disk

By loading the module that parses virtual disk files and mounting the virtual disk when grub starts, the problem of multi-operating system deployment and inconvenient disk space usage is solved, and the effects of rapid deployment and disk space sharing are achieved.

CN118656129APending Publication Date: 2024-09-17XIAN LEIFENG ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410697468.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The existing technology requires independent system partitions and a long installation process when running multiple operating systems on the same computer, and is inconvenient for shared use of disk space.

Method used

When grub starts, load the module that parses the virtual disk file, mount the virtual disk file from the local disk, run the kernel in the virtual disk file, implement the operating system startup in the virtual disk file, configure grub.cfg to load, mount and Start the virtual disk file.

Benefits of technology

It realizes the rapid deployment of multiple operating systems and the shared use of disk space, which facilitates system maintenance and deployment. It only needs to provide virtual disk files to support new systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656129A
    Figure CN118656129A
Patent Text Reader

Abstract

The method for running the multiple operating systems by using the virtual disk comprises the following steps of: 1, loading a local disk when a grub is started; step 2, searching a virtual disk file in a local disk; step 3, loading a module for analyzing the virtual disk file; step 4, mounting a virtual disk file; 5, starting a kernel in the virtual disk file; 6, starting an operating system in the virtual disk file; 7, system starting is completed; the method has the characteristics that quick deployment can be realized, and multiple operating systems share local disk space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology, and in particular relates to a method for running multiple operating systems using a virtual disk. Background Art

[0002] When running multiple operating systems on the same computer, the following method is generally used: divide the local disk into multiple partitions, and use different partitions when installing different operating systems. The current method has the following disadvantages:

[0003] Each operating system requires a complete installation process, which takes a long time and is not convenient for deployment on multiple computers.

[0004] The system partitions of different operating systems must be independent, and sufficient space must be reserved for subsequent system operations, which is inconvenient for the use of disk space. Summary of the invention

[0005] In order to overcome the deficiencies of the above-mentioned prior art, the purpose of the present invention is to provide a method for running multiple operating systems using a virtual disk. When grub is started, a module for parsing the virtual disk file is loaded, the virtual disk file is mounted from the local disk, and then the kernel in the virtual disk file is run to start the operating system in the virtual disk file. The method has the characteristics of rapid deployment and multiple operating systems sharing the use of local disk space.

[0006] To achieve the above object, the technical solution adopted by the present invention is: a method for running multiple operating systems using a virtual disk, comprising the following steps:

[0007] Step 1: When grub starts, load the local disk;

[0008] Step 2, search for the virtual disk file in the local disk;

[0009] Step 3, load the module for parsing the virtual disk file;

[0010] Step 4, mount the virtual disk file;

[0011] Step 5, start the kernel in the virtual disk file;

[0012] Step 6, start the operating system in the virtual disk file;

[0013] Step 7: System startup is complete.

[0014] In step 2, configure the save path of the virtual disk file in grub.cfg.

[0015] In step 3, a module for loading and parsing the virtual disk file is configured in grub.cfg.

[0016] In step 4, configure the mount virtual disk file in grub.cfg.

[0017] In step 5, the kernel in the boot virtual disk file is configured in grub.cfg.

[0018] In step 6, after the kernel is started, the operating system in the virtual disk that has been mounted in step 4 will be booted.

[0019] The beneficial effects of the present invention are as follows: the present invention adds a module for parsing virtual disk files in grub, so that grub can directly read the kernel from the virtual disk file, and sets the path of the virtual disk file and the path of the kernel stored in the virtual disk file in the configuration of grub. When the computer starts, grub mounts the virtual disk file, so that grub accesses the virtual disk file like accessing a local disk, and uses the kernel in the virtual disk file to start the system. During the operation of the system, updates to the system and the kernel are directly stored in the virtual disk file, which facilitates the maintenance of the system. When a new system needs to be supported, only the corresponding virtual disk file needs to be provided.

[0020] Since the present invention adopts the mode of mounting the virtual disk in grub, it has the characteristic of rapid deployment. The virtual disk file is copied to the local disk, and then the grub configuration is edited to complete the deployment.

[0021] Since the present invention adopts the method of directly starting the operating system in the virtual disk, the use of the local disk space is convenient. Different virtual disk files can be stored in the same partition of the local disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 The present invention is a flow chart of the method.

[0023] Figure 2 The message flow chart of the method of the present invention. DETAILED DESCRIPTION

[0024] The present invention is further described in detail below with reference to the accompanying drawings and embodiments.

[0025] The method for running multiple operating systems using a virtual disk includes the following steps:

[0026] Step 1: When grub starts, load the local disk;

[0027] Step 2, search for the virtual disk file in the local disk;

[0028] Step 3, load the module for parsing the virtual disk file;

[0029] Step 4, mount the virtual disk file;

[0030] Step 5, start the kernel in the virtual disk file;

[0031] Step 6, start the operating system in the virtual disk file;

[0032] Step 7: The system starts successfully.

[0033] In the step 2, the saving path of the virtual disk file is configured in grub.cfg, search--no-floppy-f--set=vd iskFile / vd iskOS.

[0034] In step 3, configure in grub.cfg to load a module for parsing the virtual disk file, i nsmod vdisk.

[0035] In step 4, configure the mount virtual disk file in grub.cfg, set root=${vd iskFile}.

[0036] In step 5, the kernel in the boot virtual disk file is configured in grub.cfg, linux / vml inuz root=${vd iskFile}initrd / initrd.img.

[0037] In step 6, after the kernel is started, the operating system in the virtual disk that has been mounted in step 4 will be booted.

[0038] Example:

[0039] When the computer is powered on, it first runs grub and mounts the local disk. Then, according to the configuration of grub.cfg, it loads the module for parsing the virtual disk file, mounts the virtual disk file from the local disk, runs the kernel in the virtual disk file, and then starts the operating system in the virtual disk file.

[0040] The relevant configuration in the grub.cfg file is as follows:

[0041] search--no-f l oppy-f--set=vd i skFi le / vd i skOS

[0042] i nsmod vd i sk

[0043] root=${vd iskFile}

[0044] li nux / vml i nuz root=${vd i skFi le}

[0045] in itrd / initrd.img.

[0046] Terminology explanation, explain the full Chinese name of the English abbreviations that appear in the plan:

[0047] grub: A multi-operating system boot program that allows users to select a deployed operating system when the computer starts.

[0048] Kernel: The most basic part of the operating system, used to mount the root file system and start running.

[0049] Virtual disk file: A virtual storage device that stores all the files required to run the operating system and is stored on a physical disk as a single file. Commonly used formats include vpc, vmdk, and qcow2.

Claims

1. A method for running multiple operating systems using a virtual disk, characterized in that: The following steps are involved: Step 1: When grub starts, load the local disk; Step 2, search for the virtual disk file in the local disk; Step 3, load the module for parsing the virtual disk file; Step 4, mount the virtual disk file; Step 5, start the kernel in the virtual disk file; Step 6, start the operating system in the virtual disk file; Step 7: System startup is complete.

2. The method for running multiple operating systems using a virtual disk according to claim 1, characterized in that: In step 2, configure the save path of the virtual disk file in grub.cfg.

3. The method for running multiple operating systems using a virtual disk according to claim 1, characterized in that: In step 3, a module for loading and parsing the virtual disk file is configured in grub.cfg.

4. The method for running multiple operating systems using a virtual disk according to claim 1, characterized in that: In step 4, configure the mount virtual disk file in grub.cfg.

5. The method for running multiple operating systems using a virtual disk according to claim 1, characterized in that: In step 5, the kernel in the boot virtual disk file is configured in grub.cfg.

6. The method for running multiple operating systems using a virtual disk according to claim 1, characterized in that: In step 6, after the kernel is started, the operating system in the virtual disk that has been mounted in step 4 will be booted.