mirror of
https://github.com/foxlet/macOS-Simple-KVM.git
synced 2024-06-26 16:38:38 +02:00
b7f78be0c3
Currently users have to modify the basic.sh script by hand to add the path to the system disk image they created. Rather than having them modify the script, just grab it from the environment.
41 lines
1.3 KiB
Bash
Executable File
41 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
|
|
VMDIR=$PWD
|
|
OVMF=$VMDIR/firmware
|
|
#export QEMU_AUDIO_DRV=pa
|
|
#QEMU_AUDIO_DRV=pa
|
|
|
|
[[ -z "$SYSTEM_DISK" ]] && {
|
|
echo "Please set the SYSTEM_DISK environment variable"
|
|
exit 1
|
|
}
|
|
|
|
[[ -r "$SYSTEM_DISK" ]] || {
|
|
echo "Can't read system disk image: $SYSTEM_DISK"
|
|
exit 1
|
|
}
|
|
|
|
qemu-system-x86_64 \
|
|
-enable-kvm \
|
|
-m 2G \
|
|
-machine q35,accel=kvm \
|
|
-smp 4,cores=2 \
|
|
-cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
|
|
-device isa-applesmc,osk="$OSK" \
|
|
-smbios type=2 \
|
|
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
|
|
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
|
|
-vga qxl \
|
|
-device ich9-intel-hda -device hda-output \
|
|
-usb -device usb-kbd -device usb-mouse \
|
|
-netdev user,id=net0 \
|
|
-device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
|
|
-device ich9-ahci,id=sata \
|
|
-drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
|
|
-device ide-hd,bus=sata.2,drive=ESP \
|
|
-drive id=InstallMedia,if=none,file=BaseSystem.img \
|
|
-device ide-hd,bus=sata.3,drive=InstallMedia \
|
|
-drive id=SystemDisk,if=none,file="${SYSTEM_DISK}" \
|
|
-device ide-hd,bus=sata.4,drive=SystemDisk
|