Gathering detailed insights and metrics for @oomol-lab/ovm
Gathering detailed insights and metrics for @oomol-lab/ovm
Gathering detailed insights and metrics for @oomol-lab/ovm
Gathering detailed insights and metrics for @oomol-lab/ovm
npm install @oomol-lab/ovm
Typescript
Module System
Node Version
NPM Version
56.2
Supply Chain
95.4
Quality
96.2
Maintenance
100
Vulnerability
100
License
Cumulative downloads
Total Downloads
Last day
51.1%
133
Compared to previous day
Last week
40.2%
230
Compared to previous week
Last month
-7.7%
1,018
Compared to previous month
Last year
971.1%
7,830
Compared to previous year
Manage OOMOL Virtual Machines(OVM).
1# pnpm 2pnpm add @oomol-lab/ovm 3 4# yarn 5yarn add @oomol-lab/ovm 6 7# npm 8npm install @oomol-lab/ovm
1import { createDarwinOVM, OVMStatusName } from "@oomol-lab/ovm" 2 3function async main() { 4 const ovm = await createDarwinOVM({ 5 cpu: 4, 6 memory: 6144, 7 name: "test", 8 logDir: "/example/log", 9 socketDir: "/example/socket", 10 sshKeyDir: "/example/ssh", 11 targetDir: "/example/target", 12 linuxPath: { 13 ovm: "/example/ovm", 14 initrd: "/example/initrd", 15 kernel: "/example/bzImage", // If it is an arm64 system, then it is `Image`. 16 rootfs: "/example/rootfs.erofs", 17 }, 18 versions: { 19 initrd: "1.0.0", 20 kernel: "1.0.0", 21 rootfs: "1.0.0", 22 dataImg: "1.0.0", 23 }, 24 }); 25 26 ovm.on("status", (datum) => { 27 switch(datum.name) { 28 case OVMStatusName.Initializing: 29 console.log("Initializing"); 30 break; 31 case OVMStatusName.GVProxyReady: 32 console.log("GVProxyReady"); 33 break; 34 case OVMStatusName.IgnitionProgress: 35 console.log("IgnitionProgress"); 36 break; 37 case OVMStatusName.IgnitionDone: 38 console.log("IgnitionDone"); 39 break; 40 case OVMStatusName.VMReady: 41 console.log("VMReady"); 42 break; 43 case OVMStatusName.Exit: 44 console.log("Exit"); 45 break; 46 case OVMStatusName.Error: 47 console.log("Error:", datum.message); 48 break; 49 } 50 }) 51 52 ovm.start(); 53}
The number of CPUs allocated to the virtual machine.
The amount of memory allocated to the virtual machine (in MB).
The name of the virtual machine.
We request to provide a directory to store the logs of the latest 3 instances, for the purpose of troubleshooting.
The format of the log file name is as follows:
During the startup process of the virtual machine, ovm will create some socket files. To facilitate management, we request a directory to store these socket files. Each time the .start()
method is called, the program will first delete the existing socket files and then recreate them.
Store the SSH key pairs required to connect to the virtual machine.
In order to address the issues that may occur when some files are damaged or other malfunctions happen, the program will first copy the files from the linuxPath
to this directory.
The initrd
, kernel
, and rootfs
can be obtained from the ovm-core project.
The directory where the ovm program is located.
Regarding the kernel
field, if the system is Mac ARM64 (M series), the kernel file needs to be uncompressed (not bzImage). For more information on this, please refer to: kernel arm64 booting
It is used to manage whether a file should be overwritten. For example, when upgrading initrd
, it is necessary to overwrite the original initrd
to ensure the upgrade takes effect.
Enable power save mode.
Pause the guest when the Mac goes to sleep, resume the guest when the Mac wakes up, and synchronize the time.
.start()
Start the virtual machine.
Return: void
.requestStop()
Request to stop the virtual machine.
.stop()
Stop the virtual machine. (FORCE SHUTDOWN)
Return: Promise<void>
.pause()
Pause the virtual machine.
Return: Promise<void>
.resume()
Resume the virtual machine.
Return: Promise<void>
.info
Get the host socket file for podman.
Return: { podmanSocketPath: string }
.state()
Get the current status of the virtual machine and the values that can be changed.
Return: Promise<{ state: "state", canStart: boolean, canPause: boolean, canResume: boolean, canRequestStop: boolean, canStop: boolean }>
state values are as follows:
.on("status", listener)
Add a listener function for the status event.
(datum: OVMEventData["status"]) => void
No vulnerabilities found.
No security vulnerabilities found.