arighi / virtme-ng

Quickly build and run kernels inside a virtualized snapshot of your live system
GNU General Public License v2.0
417 stars 45 forks source link

qemu-opts cmdline arg does not seem to be working properly #88

Open jpirko opened 6 months ago

jpirko commented 6 months ago

With original virtme, I can pass cmdline options to qemu like this: $ virtme-run --kdir . --qemu-opts -m 1G I would expect vng should behave the same with this cmdline arg. However, it is not: $ vng -v --disable-microvm --qemu-opts -m 1G usage: vng [-h] [--version] [--run [RUN] | --build | --clean | --dump DUMP] [--dry-run] [--skip-config] [--no-virtme-ng-init] [--snaps] [--debug] [--kconfig] [--skip-modules] [--commit COMMIT] [--config CONFIG] [--compiler COMPILER] [--busybox PATH_TO_BUSYBOX] [--qemu QEMU] [--name NAME] [--user USER] [--root ROOT] [--root-release ROOT_RELEASE] [--rw] [--force-9p] [--disable-microvm] [--disable-kvm] [--cwd CWD] [--pwd] [--rodir RODIR] [--rwdir RWDIR] [--overlay-rwdir OVERLAY_RWDIR] [--cpus CPUS] [--memory MEMORY] [--numa MEM[,cpus=FIRST_CPU1[-LAST_CPU1]][,cpus=FIRST_CPU2[-LAST_CPU2]]...] [--balloon] [--network user|bridge] [--disk PATH] [--exec EXEC] [--append APPEND] [--force-initramfs] [--sound] [--graphics] [--verbose] [--quiet] [--qemu-opts QEMU_OPTS] [--build-host BUILD_HOST] [--build-host-exec-prefix BUILD_HOST_EXEC_PREFIX] [--build-host-vmlinux] [--arch ARCH] [--force] [envs ...] vng: error: argument --qemu-opts/-o: expected one argument

Btw, I know I can use "--memory" directly :) I need to pass something else, "-m" is just an example.

arighi commented 6 months ago

Try vng --qemu-opts="-m 1024".

Keep in mind that virtiofsd has some special memory requirements (therefore it's always recommended to use --memory, unless you go with 9pfs using --force-9p).

Any other qemu-specific option can be passed via --qemu-opts="...".

jpirko commented 6 months ago

Try vng --qemu-opts="-m 1024".

Keep in mind that virtiofsd has some special memory requirements (therefore it's always recommended to use --memory, unless you go with 9pfs using --force-9p).

Any other qemu-specific option can be passed via --qemu-opts="...".

Could this be documented somewhere please? Works for me.