Summary of the invention
In view of this, the technical matters that the present invention will solve is to provide a kind UNIX operating system and runs the method for virtual opetrating system, can start-up and operation virtual opetrating system smoothly when running class UNIX operating system.
One kind UNIX operating system runs the method for virtual opetrating system, comprising: when running the class UNIX operating system of LiveX form, starts virtual machine program, runs virtual opetrating system; Wherein, before the described virtual opetrating system of operation, obtain swapace, described swapace is mapped as the exchange partition in the virtual disk that described virtual opetrating system can access or swap file.
According to one embodiment of the method for the invention, further, before startup virtual machine program, host memory resource is detected; When host memory resource does not meet operation needs, base unit search exchange partition, swap file successively, as main frame exchange partition and swap file as described in not searching, then creates swap file, and activates described swap file.
According to one embodiment of the method for the invention, further, when creating swap file, under the state judging host hard drive free space abundance, dynamic creation file type swapace, and be supplied to the use of described virtual opetrating system in the mode of virtual hard disk.
According to one embodiment of the method for the invention, further, before startup virtual machine program, host memory resource is detected; When host memory resource does not meet operation needs, create swap file, and activate described swap file.
According to one embodiment of the method for the invention, further, when creating swap file, under the state judging host hard drive free space abundance, dynamic creation file type swapace, and be supplied to the use of described virtual opetrating system in the mode of virtual hard disk.
According to one embodiment of the method for the invention, further, when starting virtual machine program, automatically creating swap file, and activating; Or, when needs create swapace, by user's manual creation swap file, and activate; The memory device of described swap file comprises: host hard drive, portable hard drive or SSD.
According to one embodiment of the method for the invention, further, in the process that described virtual opetrating system is run, when the storage medium insufficient space at described swap file place, then first in other fdisks or storage medium, re-create new swap file, and activate, then forbid current swap file and deleted.
According to one embodiment of the method for the invention, further, described class UNIX operating system comprises: (SuSE) Linux OS; The storage medium of the class UNIX operating system of described LiveX form is USB flash disk or flash memory, starts class UNIX operating system by the USB interface of main frame; Described USB interface is USB2.0 or USB3.0 interface.
The technical matters that the present invention will solve is to provide a kind UNIX operating system and runs the device of virtual opetrating system, can start-up and operation virtual opetrating system smoothly when running class UNIX operating system.
One kind UNIX operating system runs the device of virtual opetrating system, comprising: virtual machine activation module, for when running the class UNIX operating system of LiveX form, starting virtual machine program, running virtual opetrating system; Swapace creation module, for obtaining swapace before the described virtual opetrating system of operation, is mapped as the exchange partition in the virtual disk that described virtual opetrating system can access or swap file by described swapace.
According to an embodiment of device of the present invention, further, internal memory detection module, for before startup virtual machine program, detects host memory resource; When host memory resource does not meet operation needs, base unit search exchange partition, swap file successively; As main frame exchange partition and swap file as described in not searching, then swapace creation module creates swap file, and activates described swap file.
According to an embodiment of device of the present invention, further, when creating swap file, described swapace creation module is under the state judging host hard drive free space abundance, dynamic creation file type swapace, and be supplied to the use of described virtual opetrating system in the mode of virtual hard disk.
According to an embodiment of device of the present invention, further, when starting virtual machine program, described swapace creation module creates swap file automatically, and activates; Or, when needs create swapace, by user's manual creation swap file, and activate; The memory device of described swap file comprises: host hard drive, portable hard drive or SSD.In the process that described virtual opetrating system is run, when the storage medium insufficient space at described swap file place, then described swapace creation module first re-creates new swap file in other fdisks or storage medium, and activate, then described swapace creation module is forbidden current swap file and is deleted.
Class UNIX operating system of the present invention runs the method and apparatus of virtual opetrating system, before operation virtual opetrating system, search for existing exchange partition, or search for existing swap file, or directly create swap file, swapace is obtained by one of these three kinds of modes, then the exchange partition or swap file for the treatment of the virtual disk that operation system can be accessed is mapped as, making at the same time can another virtual opetrating system of start-up and operation smoothly, improve in the class UNIX operating system of LiveX form is run, use virtual opetrating system convenience and dirigibility.
Embodiment
With reference to the accompanying drawings the present invention is described more fully, exemplary embodiment of the present invention is wherein described.Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Class unix system (UNIX-like) refers to various traditional unix system, the such as Solaris of FreeBSD, OpenBSD, SUN company, and the system that various and traditional UNIX is similar, such as Minix, Linux, QNX etc., all considerably inherit the characteristic of original UNIX, there are many resemblances, and observe POSIX specification all to a certain extent.
Virtual machine program, i.e. virtual machine (VirtualMachine), refer to by software simulation have complete hardware system function, the complete computer operated in a completely isolated environment.
By starting virtual machine program, can simulate two or the virtual computing machine of multiple stage on a physical computer, these virtual opetrating systems carry out work completely just as real computing machine, such as set up applications, accesses network resource etc.
Virtual opetrating system just operates in an application program on your physical computer, but for the application program run in virtual machine, it is exactly a real computing machine.Virtual machine program has VMware, VirtualPC2007 etc.
Fig. 1 is the process flow diagram of the embodiment running the method for virtual opetrating system according to class UNIX operating system of the present invention; As shown in Figure 1:
Step 101, when running the class UNIX operating system of LiveX form, starts virtual machine program.
Step 102, obtained swapace, swapace is mapped as the exchange partition in the virtual disk of virtual opetrating system before operation virtual opetrating system.
Class UNIX operating system, such as Linux are tree file systems, and root partition is exactly its root node, and any catalogue, file all can hang over below root node.SWAP is exactly the virtual memory subregion under LINUX, and its effect is after physical memory uses, and disk space (namely SWAP subregion) is invented internal memory to use.It is similar with the swap file effect of Windows system, but it is one section of continuous print disk space, and invisible to user.Operating system also can some for a long time inactive program jump in virtual memory, reserve more main memory give need program and disk buffering.
User uses the class UNIX operating system of LiveX form, does not usually have exchange partition.When user needs to use virtual opetrating system, if do not have enough internal memories, perhaps just can not run these large-scale softwares, solution on hard disk, marks a region to be used as interim internal memory, as the exchange partition of Linux.
According to one embodiment of present invention, before startup virtual machine, host memory resource is detected.When host memory resource does not meet operation needs, create swap file, and activate swap file.
According to one embodiment of present invention, when creating swap file, the exchange partition on base unit search hard disk and swap file, under the state judging host hard drive free space abundance, dynamic creation file type swapace, and be supplied to virtual opetrating system use in the mode of virtual hard disk.
According to one embodiment of present invention, before operation virtual opetrating system, search for existing exchange partition, or search for existing swap file, or directly create swap file, obtain swapace by one of these three kinds of modes, be then mapped as exchange partition or the swap file of the virtual disk treating operation system.Here virtual hard disk is for virtual machine, and hard disk is also virtual, videos do CD use to virtual opetrating system as providing an ISO, and this ISO reflection is exactly virtual optical disk.
According to one embodiment of present invention, when starting virtual opetrating system, automatically creating swap file, and activating.Or, when swapace distribution is carried out in needs establishment, by user's manual creation swap file, and activate.The memory device of swap file comprises: host hard drive, portable hard drive or SSD.SSD(solid state hard disc: SolidStateDisk), adopt solid-state electronic storage chip array and the hard disk made, be made up of control module and storage unit (FLASH chip, dram chip).
According to one embodiment of present invention, when in the process run in virtual opetrating system, the storage medium insufficient space at swap file place time, then forbid current swapace, delete swap file, and re-create new swap file in other fdisks or storage medium, and activate.
Method of the present invention is before operation virtual opetrating system, search for existing exchange partition, or search for existing swap file, or directly create swap file, swapace is obtained by one of these three kinds of modes, then be mapped as exchange partition or the swap file of the virtual disk treating operation system, making at the same time can another virtual opetrating system of start-up and operation smoothly
Can base unit search exchange partition, swap file (particularly the pagefile of Windows) successively automatically, as do not found, automatically create swap file, and mapped the exchange partition become in the virtual hard disk of virtual opetrating system.
According to one embodiment of present invention, further, class UNIX operating system comprises: UNIX operating system, (SuSE) Linux OS.The storage medium of the class UNIX operating system of LiveX form is USB flash disk or flash memory, starts class UNIX operating system by the USB interface of main frame.USB interface is USB2.0 or USB3.0 interface.
Fig. 2 is the process flow diagram of another embodiment running the method for virtual opetrating system according to class UNIX operating system of the present invention.As shown in Figure 2:
Step 201, enters LiveCDLinux system, and runs LiveCDLinux system.
Step 202, runs virtual machine management program.Virtual machine management program is the plug-in program of weak coupling
Step 203, judges that whether the internal memory running virtual opetrating system is sufficient, if so, enters step 204, if not, enter step 205.
Step 204, normally enters the program process starting virtual opetrating system.
Step 205, detects host hard drive exchange partition.
Step 206, base unit search hard disk swap file.
Step 207, host hard drive creates swap file.
Step 208, is supplied to virtual opetrating system with the exchange partition of virtual hard disk or swap file and uses.Before operation virtual opetrating system, search for existing exchange partition, or search for existing swap file, or directly create swap file, obtain swapace by one of these three kinds of modes.
Step 209, runs Windows virtual opetrating system with single task operational mode.
Fig. 3 is the schematic diagram of the embodiment running the device of virtual opetrating system according to class UNIX operating system of the present invention.As shown in Figure 3: the device 31 that class UNIX operating system runs virtual opetrating system comprises: virtual machine activation module 311, internal memory detection module 312, swapace creation module 313.
Virtual machine activation module 311, when running the class UNIX operating system of LiveX form, starts virtual machine program, adopts single task mode operation virtual opetrating system.
Swapace creation module 313, also can be called swapace acquisition module, obtains swapace, described swapace was mapped as the exchange partition in the virtual disk of described virtual opetrating system before the described virtual opetrating system of operation.
According to one embodiment of present invention, internal memory detection module 312, before startup virtual opetrating system, detects host memory resource.Swapace creation module 313, for when host memory resource does not meet operation needs, creates swap file, and activates swap file.
According to one embodiment of present invention, when creating swap file, exchange partition on swapace creation module 313 base unit search hard disk and swap file, under the state judging host hard drive free space abundance, dynamic creation file type swapace, and be supplied to virtual opetrating system use in the mode of virtual hard disk.
According to one embodiment of present invention, when starting virtual opetrating system, swapace creation module 313 creates swap file automatically, and activates.Or, when swapace distribution is carried out in needs establishment, by user's manual creation swap file, and activate.
The memory device of swap file comprises: host hard drive, portable hard drive, SSD etc.When in the process run in virtual opetrating system, the storage medium insufficient space at swap file place time, then first in other fdisks or storage medium, re-create new swap file, and activate, swapace creation module forbids current swap file, deletes current swap file.
Class UNIX operating system of the present invention runs the method and apparatus of virtual opetrating system, when running the class UNIX operating system of LiveX form, can virtual opetrating system be opened, and can be virtual operating system creation swapace dynamically, break through the application restriction of LiveX operating system.
LiveX operating system is mainly used in installing operating system, EMS memory occupation is larger, and do not prepare swapace, the computer run generally do not have exchange partition yet, be difficult to when limited memory start another virtual opetrating system more simultaneously, the method and apparatus that class UNIX operating system of the present invention runs virtual opetrating system solve when this limited can operation another one virtual opetrating system faster, improve in LiveX operating system, use virtual opetrating system feasibility and dirigibility, improve LiveX operating system to other operating system, the particularly compatibility of application function in Windows system.
Method and system of the present invention may be realized in many ways.Such as, any combination by software, hardware, firmware or software, hardware, firmware realizes method and system of the present invention.Said sequence for the step of method is only to be described, and the step of method of the present invention is not limited to above specifically described order, unless specifically stated otherwise.In addition, in certain embodiments, can be also record program in the recording medium by the invention process, these programs comprise the machine readable instructions for realizing according to method of the present invention.Thus, the present invention also covers the recording medium stored for performing the program according to method of the present invention.