I have the following command line successfully starting QEMU and booting the VM on a macOS x86_64 host:
Code: Select all
#!/bin/bash
cd "$(dirname "$0")"
port=45002
qemu-system-x86_64 \
-L /usr/local/share/qemu \
-nodefaults \
-vga none \
-device e1000,mac=0A:AD:47:06:D2:2C,netdev=net0 \
-netdev user,id=net0 \
-device vmware-svga \
-cpu Penryn,+sse4.1,+sse4.2,+ssse3 \
-smp cpus=1,sockets=1,cores=1,threads=1 \
-machine q35,vmport=off,i8042=off,hpet=off \
-accel hvf \
-global ICH9-LPC.disable_s3=1 \
-drive if=pflash,format=raw,unit=0,file.filename=/usr/local/share/qemu/edk2-x86_64-code.fd,file.locking=off,readonly=on \
-drive "if=pflash,unit=1,file=./Drives/efi_vars.fd" \
-m 4096 \
-usb \
-device usb-tablet,bus=usb-bus.0 \
-device usb-mouse,bus=usb-bus.0 \
-device usb-kbd,bus=usb-bus.0 \
-device nec-usb-xhci,id=usb-controller-0 \
-device ide-hd,bus=ide.0,drive=EFI,bootindex=0 \
-drive "if=none,media=disk,id=EFI,file=./Drives/efi.qcow2,discard=unmap,detect-zeroes=unmap" \
-device ide-hd,bus=ide.1,drive=SLHD,bootindex=1 \
-drive "if=none,media=disk,id=SLHD,file=./Drives/Snow Leopard.qcow2,discard=unmap,detect-zeroes=unmap" \
-name "- Snow Leopard - Port $port" \
-monitor tcp:localhost:$port,server,nowait \
-uuid AE26E2AD-E73B-482E-BD6B-AD01BAA3BFFC \
-device virtio-rng-pci
Now I've installed QEMU on a Windows host and copied the folder with the QEMU command and a subfolder "Drives" with "Snow Leopard.qcow2", "efi.qcow2", and "efi_vars.fd" in it onto the Windows machine. I've amended the QEMU command as follows to hopefully meet the required syntax and different paths on the Windows host:
Code: Select all
"C:\Program Files\qemu\qemu-system-x86_64.exe" ^
-L "C:\Program Files\qemu\share" ^
-nodefaults ^
-vga none ^
-device e1000,mac=0A:AD:47:06:D2:2C,netdev=net0 ^
-netdev user,id=net0 ^
-device vmware-svga ^
-cpu Penryn,+sse4.1,+sse4.2,+ssse3 ^
-smp cpus=1,sockets=1,cores=1,threads=1 ^
-machine q35,vmport=off,i8042=off,hpet=off ^
-accel whpx ^
-global ICH9-LPC.disable_s3=1 ^
-drive if=pflash,format=raw,unit=0,file.filename="C:\Program Files\qemu\share\edk2-x86_64-code.fd",file.locking=off,readonly=on ^
-drive "if=pflash,unit=1,file=C:\Users\boe\Documents\mabam\Drives\efi_vars.fd" ^
-m 4096 ^
-usb ^
-device usb-tablet,bus=usb-bus.0 ^
-device usb-mouse,bus=usb-bus.0 ^
-device usb-kbd,bus=usb-bus.0 ^
-device nec-usb-xhci,id=usb-controller-0 ^
-device ide-hd,bus=ide.0,drive=EFI,bootindex=0 ^
-drive "if=none,media=disk,id=EFI,file=C:\Users\boe\Documents\mabam\Drives\efi.qcow2,discard=unmap,detect-zeroes=unmap" ^
-device ide-hd,bus=ide.1,drive=SLHD,bootindex=1 ^
-drive "if=none,media=disk,id=SLHD,file=C:\Users\boe\Documents\mabam\Drives\Snow Leopard.qcow2,discard=unmap,detect-zeroes=unmap" ^
-name "- Snow Leopard - Port 45002" ^
-monitor tcp:localhost:45002,server,nowait ^
-uuid AE26E2AD-E73B-482E-BD6B-AD01BAA3BFFC ^
-device virtio-rng-pci
I'm sure something is wrong with the command in my .bat file. But I'm not very familar with Windows systems so I'd appreciate any help on this.