diff --git a/README.md b/README.md index 9048901..cda4073 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,17 @@ Create an empty hard disk using `qemu-img`, changing the name and size to prefer qemu-img create -f qcow2 MyDisk.qcow2 64G ``` -and add it to the end of `basic.sh`: -``` - -drive id=SystemDisk,if=none,file=MyDisk.qcow2 \ - -device ide-hd,bus=sata.4,drive=SystemDisk \ -``` -> Note: If you're running on a headless system (such as on Cloud providers), you will need `-nographic` and `-vnc :0 -k en-us` for VNC support. +> Note: If you're running on a headless system (such as on Cloud providers), you will need to add `-nographic` and `-vnc :0 -k en-us` (for VNC support) to the end of `basic.sh`. -Then run `basic.sh` to start the machine and install macOS. Remember to partition in Disk Utility first! +Then run `basic.sh` to start the machine and install macOS, setting the +`SYSTEM_DISK` environment variable to the path to your freshly created +system disk image: + +``` +SYSTEM_DISK=MyDisk.qcow2 ./basic.sh +``` + +Remember to partition in Disk Utility first! ## Step 2a (Virtual Machine Manager) If instead of QEMU, you'd like to import the setup into Virt-Manager for further configuration, just run `make.sh --add`. @@ -43,4 +46,4 @@ If instead of QEMU, you'd like to import the setup into Virt-Manager for further You're done! -To fine-tune the system and improve performance, look in the `docs` folder for more information on [adding memory](docs/guide-performance.md), seting up [bridged networking](docs/guide-networking.md), adding [passthrough hardware (for GPUs)](docs/guide-passthrough.md), and enabling sound features. \ No newline at end of file +To fine-tune the system and improve performance, look in the `docs` folder for more information on [adding memory](docs/guide-performance.md), seting up [bridged networking](docs/guide-networking.md), adding [passthrough hardware (for GPUs)](docs/guide-passthrough.md), and enabling sound features. diff --git a/basic.sh b/basic.sh index 5902877..12343b7 100755 --- a/basic.sh +++ b/basic.sh @@ -6,6 +6,16 @@ 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 \ @@ -26,3 +36,5 @@ qemu-system-x86_64 \ -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