A convenient CLI tool to quickly spin up DragonflyBSD virtual machines using QEMU with sensible defaults.

Add CPU, memory, and disk options to VM start command

+36 -1
+36 -1
main.ts
··· 133 }) 134 .command("start", "Start a virtual machine") 135 .arguments("<vm-name:string>") 136 - .option("--detach, -d", "Run VM in the background and print VM name") 137 .action(async (options: unknown, vmName: string) => { 138 await start(vmName, Boolean((options as { detach: boolean }).detach)); 139 })
··· 133 }) 134 .command("start", "Start a virtual machine") 135 .arguments("<vm-name:string>") 136 + .option("-c, --cpu <type:string>", "Type of CPU to emulate", { 137 + default: "host", 138 + }) 139 + .option("-C, --cpus <number:number>", "Number of CPU cores", { 140 + default: 2, 141 + }) 142 + .option("-m, --memory <size:string>", "Amount of memory for the VM", { 143 + default: "2G", 144 + }) 145 + .option("-i, --image <path:string>", "Path to VM disk image") 146 + .option( 147 + "--disk-format <format:string>", 148 + "Disk image format (e.g., qcow2, raw)", 149 + { 150 + default: "raw", 151 + }, 152 + ) 153 + .option( 154 + "--size <size:string>", 155 + "Size of the VM disk image to create if it doesn't exist (e.g., 20G)", 156 + { 157 + default: "20G", 158 + }, 159 + ) 160 + .option( 161 + "-b, --bridge <name:string>", 162 + "Name of the network bridge to use for networking (e.g., br0)", 163 + ) 164 + .option( 165 + "-d, --detach", 166 + "Run VM in the background and print VM name", 167 + ) 168 + .option( 169 + "-p, --port-forward <mappings:string>", 170 + "Port forwarding rules in the format hostPort:guestPort (comma-separated for multiple)", 171 + ) 172 .action(async (options: unknown, vmName: string) => { 173 await start(vmName, Boolean((options as { detach: boolean }).detach)); 174 })