mirror of https://github.com/kholia/OSX-KVM.git
Batch Update 1 - August 2023
Changes: - Update to OpenCore 0.9.1 - Switch around the emulated video device (required for Ventura) - Change default resolution to 1920x1080 - Include ventura in shortname CLI help - Add notes on 'bridged networking' -Better networking documentation (thomaspaulb)
This commit is contained in:
parent
1184c09bc6
commit
7e885b8bae
Binary file not shown.
|
@ -37,11 +37,12 @@ args=(
|
||||||
# -device usb-mouse,bus=ehci.0
|
# -device usb-mouse,bus=ehci.0
|
||||||
-device nec-usb-xhci,id=xhci
|
-device nec-usb-xhci,id=xhci
|
||||||
-global nec-usb-xhci.msi=off
|
-global nec-usb-xhci.msi=off
|
||||||
|
# -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
|
||||||
# -device usb-host,vendorid=0x8086,productid=0x0808 # 2 USD USB Sound Card
|
# -device usb-host,vendorid=0x8086,productid=0x0808 # 2 USD USB Sound Card
|
||||||
# -device usb-host,vendorid=0x1b3f,productid=0x2008 # Another 2 USD USB Sound Card
|
# -device usb-host,vendorid=0x1b3f,productid=0x2008 # Another 2 USD USB Sound Card
|
||||||
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
|
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
|
||||||
-drive if=pflash,format=raw,readonly=on,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
|
-drive if=pflash,format=raw,readonly=on,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
|
||||||
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
|
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1920x1080.fd"
|
||||||
-smbios type=2
|
-smbios type=2
|
||||||
-device ich9-intel-hda -device hda-duplex
|
-device ich9-intel-hda -device hda-duplex
|
||||||
-device ich9-ahci,id=sata
|
-device ich9-ahci,id=sata
|
||||||
|
@ -52,10 +53,10 @@ args=(
|
||||||
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
|
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
|
||||||
-device ide-hd,bus=sata.4,drive=MacHDD
|
-device ide-hd,bus=sata.4,drive=MacHDD
|
||||||
# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
||||||
-netdev user,id=net0 -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
-netdev user,id=net0,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
||||||
# -netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 # Note: Use this line for High Sierra
|
# -netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 # Note: Use this line for High Sierra
|
||||||
-monitor stdio
|
-monitor stdio
|
||||||
-device VGA,vgamem_mb=128
|
-device vmware-svga
|
||||||
)
|
)
|
||||||
|
|
||||||
qemu-system-x86_64 "${args[@]}"
|
qemu-system-x86_64 "${args[@]}"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
OpenCore
|
|
@ -0,0 +1 @@
|
||||||
|
Disabled
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
89
README.md
89
README.md
|
@ -9,6 +9,8 @@ instructions are included!).
|
||||||
:green_heart: Looking for **commercial** support with this stuff? I am [available
|
:green_heart: Looking for **commercial** support with this stuff? I am [available
|
||||||
over email](mailto:dhiru.kholia@gmail.com?subject=[GitHub]%20OSX-KVM%20Commercial%20Support%20Request&body=Hi%20-%20We%20are%20interested%20in%20purchasing%20commercial%20support%20options%20for%20your%20project.) for a chat for **commercial support options only**. Note: Project sponsors get access to the `Private OSX-KVM` repository, and direct support.
|
over email](mailto:dhiru.kholia@gmail.com?subject=[GitHub]%20OSX-KVM%20Commercial%20Support%20Request&body=Hi%20-%20We%20are%20interested%20in%20purchasing%20commercial%20support%20options%20for%20your%20project.) for a chat for **commercial support options only**. Note: Project sponsors get access to the `Private OSX-KVM` repository, and direct support.
|
||||||
|
|
||||||
|
Struggling with `Content Caching` stuff? We can help.
|
||||||
|
|
||||||
Working with `Proxmox` and macOS? See [Nick's blog for sure](https://www.nicksherlock.com/).
|
Working with `Proxmox` and macOS? See [Nick's blog for sure](https://www.nicksherlock.com/).
|
||||||
|
|
||||||
Yes, we support offline macOS installations now 🎉
|
Yes, we support offline macOS installations now 🎉
|
||||||
|
@ -51,43 +53,22 @@ help (pull-requests!) with the following work items:
|
||||||
|
|
||||||
* A CPU with AVX2 support is required for >= macOS Mojave
|
* A CPU with AVX2 support is required for >= macOS Mojave
|
||||||
|
|
||||||
Note: Older AMD CPU(s) are known to be problematic. AMD FX-8350 works but
|
Note: Older AMD CPU(s) are known to be problematic but modern AMD Ryzen
|
||||||
Phenom II X3 720 does not. Ryzen processors work just fine.
|
processors work just fine.
|
||||||
|
|
||||||
|
|
||||||
### Installation Preparation
|
### Installation Preparation
|
||||||
|
|
||||||
* KVM may need the following tweak on the host machine to work.
|
|
||||||
|
|
||||||
```
|
|
||||||
echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
|
|
||||||
```
|
|
||||||
|
|
||||||
To make this change permanent, you may use the following command.
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo cp kvm.conf /etc/modprobe.d/kvm.conf # for intel boxes only, after cloning the repo below
|
|
||||||
```
|
|
||||||
|
|
||||||
* Install QEMU and other packages.
|
* Install QEMU and other packages.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt-get install qemu uml-utilities virt-manager git \
|
sudo apt-get install qemu uml-utilities virt-manager git \
|
||||||
wget libguestfs-tools p7zip-full make dmg2img -y
|
wget libguestfs-tools p7zip-full make dmg2img tesseract-ocr \
|
||||||
|
tesseract-ocr-eng -y
|
||||||
```
|
```
|
||||||
|
|
||||||
This step may need to be adapted for your Linux distribution.
|
This step may need to be adapted for your Linux distribution.
|
||||||
|
|
||||||
* Add user to the `kvm` and `libvirt` groups (might be needed).
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo usermod -aG kvm $(whoami)
|
|
||||||
sudo usermod -aG libvirt $(whoami)
|
|
||||||
sudo usermod -aG input $(whoami)
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: Re-login after executing this command.
|
|
||||||
|
|
||||||
* Clone this repository on your QEMU system. Files from this repository are
|
* Clone this repository on your QEMU system. Files from this repository are
|
||||||
used in the following steps.
|
used in the following steps.
|
||||||
|
|
||||||
|
@ -107,6 +88,30 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
|
||||||
|
|
||||||
This repository uses rebase based workflows heavily.
|
This repository uses rebase based workflows heavily.
|
||||||
|
|
||||||
|
* KVM may need the following tweak on the host machine to work.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo modprobe kvm; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
|
||||||
|
```
|
||||||
|
|
||||||
|
To make this change permanent, you may use the following command.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo cp kvm.conf /etc/modprobe.d/kvm.conf # for intel boxes only
|
||||||
|
|
||||||
|
sudo cp kvm_amd.conf /etc/modprobe.d/kvm.conf # for amd boxes only
|
||||||
|
```
|
||||||
|
|
||||||
|
* Add user to the `kvm` and `libvirt` groups (might be needed).
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo usermod -aG kvm $(whoami)
|
||||||
|
sudo usermod -aG libvirt $(whoami)
|
||||||
|
sudo usermod -aG input $(whoami)
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: Re-login after executing this command.
|
||||||
|
|
||||||
* Fetch macOS installer.
|
* Fetch macOS installer.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -127,9 +132,9 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
|
||||||
1. High Sierra (10.13)
|
1. High Sierra (10.13)
|
||||||
2. Mojave (10.14)
|
2. Mojave (10.14)
|
||||||
3. Catalina (10.15)
|
3. Catalina (10.15)
|
||||||
4. Big Sur (11.7) - RECOMMENDED
|
4. Big Sur (11.7)
|
||||||
5. Monterey (12.6)
|
5. Monterey (12.6)
|
||||||
6. Ventura (13)
|
6. Ventura (13) - RECOMMENDED
|
||||||
|
|
||||||
Choose a product to download (1-6): 4
|
Choose a product to download (1-6): 4
|
||||||
```
|
```
|
||||||
|
@ -165,7 +170,7 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
|
||||||
./OpenCore-Boot.sh
|
./OpenCore-Boot.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: This same script works for Big Sur, Catalina, Mojave, and High Sierra.
|
Note: This same script works for all recent macOS versions.
|
||||||
|
|
||||||
- Use the `Disk Utility` tool within the macOS installer to partition, and
|
- Use the `Disk Utility` tool within the macOS installer to partition, and
|
||||||
format the virtual disk attached to the macOS VM.
|
format the virtual disk attached to the macOS VM.
|
||||||
|
@ -202,6 +207,15 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
|
||||||
- Launch `virt-manager` and start the `macOS` virtual machine.
|
- Launch `virt-manager` and start the `macOS` virtual machine.
|
||||||
|
|
||||||
|
|
||||||
|
### Headless macOS
|
||||||
|
|
||||||
|
- Use the provided [boot-macOS-headless.sh](./boot-macOS-headless.sh) script.
|
||||||
|
|
||||||
|
```
|
||||||
|
./boot-macOS-headless.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Setting Expectations Right
|
### Setting Expectations Right
|
||||||
|
|
||||||
Nice job on setting up a `Virtual Hackintosh` system! Such a system can be used
|
Nice job on setting up a `Virtual Hackintosh` system! Such a system can be used
|
||||||
|
@ -220,24 +234,7 @@ work, patience, and a bit of luck (perhaps?).
|
||||||
|
|
||||||
### Post-Installation
|
### Post-Installation
|
||||||
|
|
||||||
* See [networking notes](networking-qemu-kvm-howto.txt) to setup guest networking.
|
* See [networking notes](networking-qemu-kvm-howto.txt) on how to setup networking in your VM, outbound and also inbound for remote access to your VM via SSH, VNC, etc.
|
||||||
|
|
||||||
I have the following commands present in `/etc/rc.local`.
|
|
||||||
|
|
||||||
```
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
sudo ip tuntap add dev tap0 mode tap
|
|
||||||
sudo ip link set tap0 up promisc on
|
|
||||||
sudo ip link set dev virbr0 up
|
|
||||||
sudo ip link set dev tap0 master virbr0
|
|
||||||
```
|
|
||||||
|
|
||||||
This has been enough for me so far.
|
|
||||||
|
|
||||||
Note: You may need to enable the `rc.local` functionality manually on modern
|
|
||||||
Ubuntu versions. Check out the [notes](notes.md) included in this repository
|
|
||||||
for details.
|
|
||||||
|
|
||||||
* To passthrough GPUs and other devices, see [these notes](notes.md#gpu-passthrough-notes).
|
* To passthrough GPUs and other devices, see [these notes](notes.md#gpu-passthrough-notes).
|
||||||
|
|
||||||
|
|
|
@ -23,16 +23,12 @@
|
||||||
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
|
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# Changelog:
|
|
||||||
# - Add support for 'savevm'
|
|
||||||
# - Fix cpuid related warning on EPYC
|
|
||||||
# - Fix 'savevm' support
|
|
||||||
|
|
||||||
MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
|
MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
|
||||||
|
|
||||||
# This script works for Catalina as well as Mojave. Tested with macOS 10.14.6 and macOS 10.15.6.
|
# This script works for Big Sur, Catalina, Mojave, and High Sierra. Tested with
|
||||||
|
# macOS 10.15.6, macOS 10.14.6, and macOS 10.13.6.
|
||||||
|
|
||||||
ALLOCATED_RAM="3072" # MiB
|
ALLOCATED_RAM="7192" # MiB
|
||||||
CPU_SOCKETS="1"
|
CPU_SOCKETS="1"
|
||||||
CPU_CORES="2"
|
CPU_CORES="2"
|
||||||
CPU_THREADS="4"
|
CPU_THREADS="4"
|
||||||
|
@ -40,32 +36,36 @@ CPU_THREADS="4"
|
||||||
REPO_PATH="."
|
REPO_PATH="."
|
||||||
OVMF_DIR="."
|
OVMF_DIR="."
|
||||||
|
|
||||||
# for snapshots
|
|
||||||
export TMPDIR=$PWD
|
|
||||||
|
|
||||||
# shellcheck disable=SC2054
|
# shellcheck disable=SC2054
|
||||||
args=(
|
args=(
|
||||||
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
|
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
|
||||||
-machine q35
|
-machine q35
|
||||||
-usb -device usb-kbd -device usb-tablet
|
-usb -device usb-kbd -device usb-tablet
|
||||||
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
|
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
|
||||||
|
-device usb-ehci,id=ehci
|
||||||
|
# -device usb-kbd,bus=ehci.0
|
||||||
|
# -device usb-mouse,bus=ehci.0
|
||||||
|
-device nec-usb-xhci,id=xhci
|
||||||
|
-global nec-usb-xhci.msi=off
|
||||||
|
-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
|
||||||
|
# -device usb-host,vendorid=0x8086,productid=0x0808 # 2 USD USB Sound Card
|
||||||
|
# -device usb-host,vendorid=0x1b3f,productid=0x2008 # Another 2 USD USB Sound Card
|
||||||
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
|
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
|
||||||
-drive if=pflash,format=raw,snapshot=off,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
|
-drive if=pflash,format=raw,readonly=on,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
|
||||||
-drive if=pflash,format=raw,snapshot=on,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
|
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1920x1080.fd"
|
||||||
-smbios type=2
|
-smbios type=2
|
||||||
-device ich9-ahci,id=sata
|
-device ich9-ahci,id=sata
|
||||||
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore/OpenCore.qcow2"
|
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore/OpenCore.qcow2"
|
||||||
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
|
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
|
||||||
-device ide-hd,bus=sata.3,drive=InstallMedia
|
-device ide-hd,bus=sata.3,drive=InstallMedia
|
||||||
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
|
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
|
||||||
# -drive id=MacHDD,if=none,snapshot=on,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
|
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
|
||||||
-drive id=MacHDD,if=none,snapshot=off,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
|
|
||||||
-device ide-hd,bus=sata.4,drive=MacHDD
|
-device ide-hd,bus=sata.4,drive=MacHDD
|
||||||
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
-netdev user,id=net0,hostfwd=tcp::2222-:22 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
||||||
-monitor stdio
|
-monitor stdio
|
||||||
-vga vmware
|
-device vmware-svga
|
||||||
-display none
|
-display none
|
||||||
-vnc 0.0.0.0:1,password -k en-us
|
-vnc 0.0.0.0:1,password=on -k en-us
|
||||||
)
|
)
|
||||||
|
|
||||||
qemu-system-x86_64 "${args[@]}"
|
qemu-system-x86_64 "${args[@]}"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
allow virbr0
|
allow br0
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/connecting-to-mac/
|
||||||
|
|
||||||
|
# Special thanks to:
|
||||||
|
# https://github.com/Leoyzen/KVM-Opencore
|
||||||
|
# https://github.com/thenickdude/KVM-Opencore/
|
||||||
|
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt
|
||||||
|
#
|
||||||
|
# qemu-img create -f qcow2 mac_hdd_ng.img 128G
|
||||||
|
#
|
||||||
|
# echo 1 | sudo tee -a /sys/module/kvm/parameters/ignore_msrs # this is required
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# $ boot-macOS-headless.sh
|
||||||
|
#
|
||||||
|
# (qemu) change vnc password
|
||||||
|
# Password: ********
|
||||||
|
#
|
||||||
|
# Note: Using RealVNC client, connect to `<localhost:5901>`.
|
||||||
|
# E.g. `vncviewer localhost:5901`
|
||||||
|
#
|
||||||
|
# If using Nested-KVM (running macOS guest under a Ubuntu guest), use socat
|
||||||
|
# and/or bridged network to exposed the macOS ports.
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+aes,+xsave,+xsaveopt,check"
|
||||||
|
|
||||||
|
# This script works for Big Sur, Catalina, Mojave, and High Sierra. Tested with
|
||||||
|
# macOS 10.15.6, macOS 10.14.6, and macOS 10.13.6.
|
||||||
|
|
||||||
|
ALLOCATED_RAM="4096" # MiB
|
||||||
|
CPU_SOCKETS="1"
|
||||||
|
CPU_CORES="2"
|
||||||
|
CPU_THREADS="4"
|
||||||
|
|
||||||
|
REPO_PATH="."
|
||||||
|
OVMF_DIR="."
|
||||||
|
|
||||||
|
# shellcheck disable=SC2054
|
||||||
|
args=(
|
||||||
|
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,vmware-cpuid-freq=on,"$MY_OPTIONS"
|
||||||
|
-machine q35
|
||||||
|
-usb -device usb-kbd -device usb-tablet
|
||||||
|
-smp 2
|
||||||
|
-device usb-ehci,id=ehci
|
||||||
|
# -device usb-kbd,bus=ehci.0
|
||||||
|
# -device usb-mouse,bus=ehci.0
|
||||||
|
-device nec-usb-xhci,id=xhci
|
||||||
|
-global nec-usb-xhci.msi=off
|
||||||
|
# -device usb-host,vendorid=0x8086,productid=0x0808 # 2 USD USB Sound Card
|
||||||
|
# -device usb-host,vendorid=0x1b3f,productid=0x2008 # Another 2 USD USB Sound Card
|
||||||
|
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
|
||||||
|
-drive if=pflash,format=raw,readonly=on,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
|
||||||
|
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1920x1080.fd"
|
||||||
|
-smbios type=2
|
||||||
|
-device ich9-ahci,id=sata
|
||||||
|
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore/OpenCore.qcow2"
|
||||||
|
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
|
||||||
|
-device ide-hd,bus=sata.3,drive=InstallMedia
|
||||||
|
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
|
||||||
|
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
|
||||||
|
-device ide-hd,bus=sata.4,drive=MacHDD
|
||||||
|
# Note: Shift the host's ssh port some somewhere else!
|
||||||
|
-netdev user,id=net0,hostfwd=tcp::22-:22 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
|
||||||
|
-monitor stdio
|
||||||
|
-device vmware-svga
|
||||||
|
-display none
|
||||||
|
-vnc 0.0.0.0:1,password=on -k en-us
|
||||||
|
)
|
||||||
|
|
||||||
|
qemu-system-x86_64 "${args[@]}"
|
|
@ -434,7 +434,7 @@ def main():
|
||||||
help='use specified os type, defaults to default ' + MLB_ZERO)
|
help='use specified os type, defaults to default ' + MLB_ZERO)
|
||||||
parser.add_argument('-diag', '--diagnostics', action='store_true', help='download diagnostics image')
|
parser.add_argument('-diag', '--diagnostics', action='store_true', help='download diagnostics image')
|
||||||
parser.add_argument('-s', '--shortname', type=str, default='',
|
parser.add_argument('-s', '--shortname', type=str, default='',
|
||||||
help='available options: high-sierra, mojave, catalina, big-sur, monterey')
|
help='available options: high-sierra, mojave, catalina, big-sur, monterey, ventura')
|
||||||
parser.add_argument('-v', '--verbose', action='store_true', help='print debug information')
|
parser.add_argument('-v', '--verbose', action='store_true', help='print debug information')
|
||||||
parser.add_argument('-db', '--board-db', type=str, default=os.path.join(SELF_DIR, 'boards.json'),
|
parser.add_argument('-db', '--board-db', type=str, default=os.path.join(SELF_DIR, 'boards.json'),
|
||||||
help='use custom board list for checking, defaults to boards.json')
|
help='use custom board list for checking, defaults to boards.json')
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
options kvm_amd nested=1
|
||||||
|
options kvm ignore_msrs=1 report_ignored_msrs=0
|
|
@ -44,7 +44,7 @@
|
||||||
<type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
|
<type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
|
||||||
<!-- We don't need patched OVMF anymore when using latest OpenCore, stock one is okay -->
|
<!-- We don't need patched OVMF anymore when using latest OpenCore, stock one is okay -->
|
||||||
<loader readonly='yes' type='pflash'>/home/CHANGEME/OSX-KVM/OVMF_CODE.fd</loader>
|
<loader readonly='yes' type='pflash'>/home/CHANGEME/OSX-KVM/OVMF_CODE.fd</loader>
|
||||||
<nvram>/home/CHANGEME/OSX-KVM/OVMF_VARS-1024x768.fd</nvram>
|
<nvram>/home/CHANGEME/OSX-KVM/OVMF_VARS.fd</nvram>
|
||||||
</os>
|
</os>
|
||||||
<features>
|
<features>
|
||||||
<acpi/>
|
<acpi/>
|
||||||
|
@ -161,7 +161,7 @@
|
||||||
<listen type='address'/>
|
<listen type='address'/>
|
||||||
</graphics>
|
</graphics>
|
||||||
<video>
|
<video>
|
||||||
<model type="vga" vram="65536" heads="1" primary="yes"/>
|
<model type="vmvga" vram="131072" heads="1" primary="yes"/>
|
||||||
</video>
|
</video>
|
||||||
<!-- If you wanna passthrough GPU, make sure the gfx and audio are in the same bus (like 0x01) but different function (0x00 and 0x01)-->
|
<!-- If you wanna passthrough GPU, make sure the gfx and audio are in the same bus (like 0x01) but different function (0x00 and 0x01)-->
|
||||||
<!-- <hostdev mode='subsystem' type='pci' managed='yes'>
|
<!-- <hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
|
|
|
@ -30,14 +30,27 @@ MacOS.
|
||||||
|
|
||||||
To use this adapter, replace network_adapter with e1000-82545em
|
To use this adapter, replace network_adapter with e1000-82545em
|
||||||
|
|
||||||
vmxnet3 - An alternative solution to e1000 is to use vmxnet3 instead. Unlike
|
vmxnet3,virtio-net-pci - An alternative solution to e1000. Instead of emulating
|
||||||
the e1000, vmxnet3 is a paravirtualized NIC, which can allow for better
|
the e1000, these are paravirtualized NICs, which can allow for better
|
||||||
performance (in theory). The only catch is that the you need to have a recent
|
performance (in theory). The only catch is that the you need to have a recent
|
||||||
version of MacOS (10.11 or later).
|
version of MacOS (10.11 or later).
|
||||||
|
|
||||||
To use this adapter, replace network_adapter with vmxnet3
|
To use these adapters, replace network_adapter with vmxnet3 or virtio-net-pci.
|
||||||
|
|
||||||
|
|
||||||
|
SSH access in user mode
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Although the IP address of the VM is not visible to the outside, it is possible
|
||||||
|
to use port forwarding to access the VM's ports from your host, eg the SSH port.
|
||||||
|
To achieve that:
|
||||||
|
|
||||||
|
- In MacOS, turn on SSH under System Preferences > Sharing > Remote Login.
|
||||||
|
- Modify the startup script to include `-netdev user,id=net0,hostfwd=tcp::10022-:22`
|
||||||
|
- Use `ssh localhost -p10022` to get in.
|
||||||
|
|
||||||
|
You can use the same for VNC.
|
||||||
|
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
Tap Networking (Better Performance)
|
Tap Networking (Better Performance)
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
@ -62,6 +75,25 @@ virsh net-autostart default
|
||||||
Add "-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \"
|
Add "-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \"
|
||||||
to your qemu-system-x86_64 command.
|
to your qemu-system-x86_64 command.
|
||||||
|
|
||||||
|
|
||||||
|
Using an rc.local startup script
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
I have the following commands present in `/etc/rc.local`.
|
||||||
|
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
sudo ip tuntap add dev tap0 mode tap
|
||||||
|
sudo ip link set tap0 up promisc on
|
||||||
|
sudo ip link set dev virbr0 up
|
||||||
|
sudo ip link set dev tap0 master virbr0
|
||||||
|
|
||||||
|
This has been enough for me so far.
|
||||||
|
|
||||||
|
Note: You may need to enable the `rc.local` functionality manually on modern
|
||||||
|
Ubuntu versions. Check out the [notes](notes.md) included in this repository
|
||||||
|
for details.
|
||||||
|
|
||||||
|
|
||||||
QEMU networking tip
|
QEMU networking tip
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
@ -96,3 +128,30 @@ to work, it needs to be setuid root. This can be accomplished with this command:
|
||||||
|
|
||||||
Note that this is sometimes viewed as a security hole. Be careful and understand
|
Note that this is sometimes viewed as a security hole. Be careful and understand
|
||||||
what you are doing before running this command.
|
what you are doing before running this command.
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------
|
||||||
|
Bridged Networking 2023
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
sudo mkdir -p /etc/qemu
|
||||||
|
|
||||||
|
sudo cp bridge.conf /etc/qemu
|
||||||
|
|
||||||
|
sudo chmod u+s /usr/lib/qemu/qemu-bridge-helper
|
||||||
|
|
||||||
|
sudo ip link add name br0 type bridge
|
||||||
|
|
||||||
|
sudo ip link set dev br0 up
|
||||||
|
|
||||||
|
sudo ip link set enx00e04c680a67 master br0 && sudo dhclient br0
|
||||||
|
|
||||||
|
$ brctl show
|
||||||
|
bridge name bridge id STP enabled interfaces
|
||||||
|
br0 8000.ead0ee60b7c1 yes enx00e04c680a67
|
||||||
|
tap0
|
||||||
|
Use the following network device in scripts:
|
||||||
|
|
||||||
|
-netdev bridge,id=net0,br=br0,"helper=/usr/lib/qemu/qemu-bridge-helper" -device virtio-net-pci,netdev=net0,id=net0,mac=00:16:CB:00:11:34
|
||||||
|
|
||||||
|
Also see https://dortania.github.io/OpenCore-Post-Install/universal/iservices.html to tweak the config.plist file.
|
||||||
|
|
169
notes.md
169
notes.md
|
@ -3,20 +3,24 @@
|
||||||
Do you see the "Your device or computer could not be verified" message when you
|
Do you see the "Your device or computer could not be verified" message when you
|
||||||
try to login to the App Store? If yes, here are the steps to fix it.
|
try to login to the App Store? If yes, here are the steps to fix it.
|
||||||
|
|
||||||
* Make sure that your wired ethernet connection is called "en0" (and not "en1" or
|
- Make sure that your wired ethernet connection is called "en0" (and not "en1"
|
||||||
something else). Use "ifconfig" command to verify this.
|
or something else). Use "ifconfig" command to verify this.
|
||||||
|
|
||||||
* If the wired ethernet connection is not called "en0", then then go to Network
|
- If the wired ethernet connection is not called "en0", then then go to Network
|
||||||
in System Preferences and delete all the devices, and apply the changes. Next,
|
in System Preferences and delete all the devices, and apply the changes.
|
||||||
go to the console and type in `sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist`.
|
Next, go to the console and type in `sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist`.
|
||||||
Finally reboot, and then use the App Store without problems.
|
Finally reboot, and then use the App Store without problems.
|
||||||
|
|
||||||
This fix was found by `Glnk2012` of https://www.tonymacx86.com/ site.
|
This fix was found by `Glnk2012` of https://www.tonymacx86.com/ site.
|
||||||
|
|
||||||
Also tweaking the `smbios.plist` file can help (?).
|
Also tweaking the `smbios.plist` file can help (?).
|
||||||
|
|
||||||
|
### Resolution in Ventura
|
||||||
|
|
||||||
### Resolution in Ventura (WIP)
|
Update: Switching to `vmware-svga` device seems to have "fixed" the following
|
||||||
|
problem!
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
From https://superuser.com: macOS Ventura screen resolution settings includes
|
From https://superuser.com: macOS Ventura screen resolution settings includes
|
||||||
only 3 predefined options but choosing any of them breaks my installation (I'm
|
only 3 predefined options but choosing any of them breaks my installation (I'm
|
||||||
|
@ -39,7 +43,6 @@ Reboot the macOS Ventura VM.
|
||||||
Note: Running `displayplacer "id:FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF mode:10"`
|
Note: Running `displayplacer "id:FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF mode:10"`
|
||||||
doesn't help with this resolution problem on macOS Ventura.
|
doesn't help with this resolution problem on macOS Ventura.
|
||||||
|
|
||||||
|
|
||||||
### Change resolution in OpenCore
|
### Change resolution in OpenCore
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
|
@ -64,8 +67,8 @@ Note: The macOS VM's resolution can be changed via `Settings -> Displays`
|
||||||
option easily.
|
option easily.
|
||||||
|
|
||||||
Note: After changing the `config.plist` file, please regenerate the
|
Note: After changing the `config.plist` file, please regenerate the
|
||||||
`OpenCore.qcow2` file using the instructions included in this repository.
|
`OpenCore.qcow2` file using the [instructions](./OpenCore/README.md#notes)
|
||||||
|
included in this repository.
|
||||||
|
|
||||||
### GPU passthrough notes
|
### GPU passthrough notes
|
||||||
|
|
||||||
|
@ -76,7 +79,7 @@ for general-purpose guidance and details.
|
||||||
I am running Ubuntu 20.04.2 LTS on Intel i5-6500 + ASUS Z170-AR motherboard +
|
I am running Ubuntu 20.04.2 LTS on Intel i5-6500 + ASUS Z170-AR motherboard +
|
||||||
AMD RX 570 GPU (May 2021).
|
AMD RX 570 GPU (May 2021).
|
||||||
|
|
||||||
* Blacklist the required kernel modules.
|
- Blacklist the required kernel modules.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cat /etc/modprobe.d/blacklist.conf
|
$ cat /etc/modprobe.d/blacklist.conf
|
||||||
|
@ -86,7 +89,7 @@ AMD RX 570 GPU (May 2021).
|
||||||
blacklist radeon
|
blacklist radeon
|
||||||
```
|
```
|
||||||
|
|
||||||
* Find details of the PCIe devices to passthrough.
|
- Find details of the PCIe devices to passthrough.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ lspci -nnk | grep AMD
|
$ lspci -nnk | grep AMD
|
||||||
|
@ -94,7 +97,7 @@ AMD RX 570 GPU (May 2021).
|
||||||
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0]
|
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0]
|
||||||
```
|
```
|
||||||
|
|
||||||
* Enable IOMMU support and configure VFIO.
|
- Enable IOMMU support and configure VFIO.
|
||||||
|
|
||||||
Append the given line to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.
|
Append the given line to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`.
|
||||||
|
|
||||||
|
@ -106,7 +109,7 @@ AMD RX 570 GPU (May 2021).
|
||||||
|
|
||||||
`iommu=pt amd_iommu=on <remaining-line-from-above...>`
|
`iommu=pt amd_iommu=on <remaining-line-from-above...>`
|
||||||
|
|
||||||
* Tweak module configuration a bit according to the following output (thanks to Mathias Hueber).
|
- Tweak module configuration a bit according to the following output (thanks to Mathias Hueber).
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cat /etc/modprobe.d/vfio.conf
|
$ cat /etc/modprobe.d/vfio.conf
|
||||||
|
@ -117,18 +120,19 @@ AMD RX 570 GPU (May 2021).
|
||||||
softdep drm pre: vfio-pci
|
softdep drm pre: vfio-pci
|
||||||
```
|
```
|
||||||
|
|
||||||
* Update GRUB, initramfs, and then reboot.
|
- Update GRUB, initramfs, and then reboot.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo update-grub2
|
sudo update-grub2
|
||||||
$ sudo update-initramfs -k all -u
|
|
||||||
|
sudo update-initramfs -k all -u
|
||||||
```
|
```
|
||||||
|
|
||||||
* In the BIOS setup, set the `Primary Display` to `IGFX` (aka CPU graphics / onboard graphics).
|
- In the BIOS setup, set the `Primary Display` to `IGFX` (aka CPU graphics / onboard graphics).
|
||||||
|
|
||||||
Tip: Update the BIOS!
|
Tip: Update the BIOS!
|
||||||
|
|
||||||
* Verify that the IOMMU ("VT-d" for Intel) is enabled, and `vfio-pci` is
|
- Verify that the IOMMU ("VT-d" for Intel) is enabled, and `vfio-pci` is
|
||||||
working as expected. Verify that the expected devices are using `vfio-pci` as
|
working as expected. Verify that the expected devices are using `vfio-pci` as
|
||||||
their kernel driver.
|
their kernel driver.
|
||||||
|
|
||||||
|
@ -169,7 +173,7 @@ AMD RX 570 GPU (May 2021).
|
||||||
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0] (rev ff)
|
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0] (rev ff)
|
||||||
```
|
```
|
||||||
|
|
||||||
* Fix permissions for the `/dev/vfio/1` device (modify as needed):
|
- Fix permissions for the `/dev/vfio/1` device (modify as needed):
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo cp vfio-kvm.rules /etc/udev/rules.d/vfio-kvm.rules
|
sudo cp vfio-kvm.rules /etc/udev/rules.d/vfio-kvm.rules
|
||||||
|
@ -178,7 +182,7 @@ AMD RX 570 GPU (May 2021).
|
||||||
sudo udevadm trigger
|
sudo udevadm trigger
|
||||||
```
|
```
|
||||||
|
|
||||||
* Open `/etc/security/limits.conf` file and add the following lines:
|
- Open `/etc/security/limits.conf` file and add the following lines:
|
||||||
|
|
||||||
```
|
```
|
||||||
@kvm soft memlock unlimited
|
@kvm soft memlock unlimited
|
||||||
|
@ -189,10 +193,10 @@ AMD RX 570 GPU (May 2021).
|
||||||
|
|
||||||
Thanks to `Heiko Sieger` for this solution.
|
Thanks to `Heiko Sieger` for this solution.
|
||||||
|
|
||||||
* Confirm the contents of `boot-passthrough.sh` and run it to boot macOS with
|
- Confirm the contents of `boot-passthrough.sh` and run it to boot macOS with
|
||||||
GPU passthrough.
|
GPU passthrough.
|
||||||
|
|
||||||
* To reuse the keyboard and mouse devices from the host, setup "Automatic
|
- To reuse the keyboard and mouse devices from the host, setup "Automatic
|
||||||
login" in System Preferences in macOS and configure Synergy software.
|
login" in System Preferences in macOS and configure Synergy software.
|
||||||
|
|
||||||
Note: On `Pop!_OS`, use the `kernelstub` command to change the kernel boot
|
Note: On `Pop!_OS`, use the `kernelstub` command to change the kernel boot
|
||||||
|
@ -211,12 +215,11 @@ work in a rugged, consistent manner.
|
||||||
|
|
||||||
[Link to a list of supported GPUs](https://dortania.github.io/GPU-Buyers-Guide/modern-gpus/amd-gpu.html).
|
[Link to a list of supported GPUs](https://dortania.github.io/GPU-Buyers-Guide/modern-gpus/amd-gpu.html).
|
||||||
|
|
||||||
|
|
||||||
### USB passthrough notes
|
### USB passthrough notes
|
||||||
|
|
||||||
These steps will need to be adapted for your particular setup.
|
These steps will need to be adapted for your particular setup.
|
||||||
|
|
||||||
* Isolate the passthrough PCIe devices with vfio-pci, with the help of `lspci
|
- Isolate the passthrough PCIe devices with vfio-pci, with the help of `lspci
|
||||||
-nnk` command.
|
-nnk` command.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -228,13 +231,13 @@ These steps will need to be adapted for your particular setup.
|
||||||
Add `1b21:1242` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub` file
|
Add `1b21:1242` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub` file
|
||||||
in the required format. See `GPU passthrough notes` (above) for details.
|
in the required format. See `GPU passthrough notes` (above) for details.
|
||||||
|
|
||||||
* Update initramfs, and then reboot.
|
- Update initramfs, and then reboot.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo update-initramfs -k all -u
|
sudo update-initramfs -k all -u
|
||||||
```
|
```
|
||||||
|
|
||||||
* Use the helper scripts to isolate the USB controller.
|
- Use the helper scripts to isolate the USB controller.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ scripts/lsgroup.sh
|
$ scripts/lsgroup.sh
|
||||||
|
@ -249,19 +252,18 @@ These steps will need to be adapted for your particular setup.
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
$ scripts/vfio-group.sh 13
|
scripts/vfio-group.sh 13
|
||||||
```
|
```
|
||||||
|
|
||||||
* Add `-device vfio-pci,host=03:00.0,bus=pcie.0` line to `boot-passthrough.sh`.
|
- Add `-device vfio-pci,host=03:00.0,bus=pcie.0` line to `boot-passthrough.sh`.
|
||||||
|
|
||||||
* Boot the VM, and devices attached to the ASMedia USB controller should just work under macOS.
|
- Boot the VM, and devices attached to the ASMedia USB controller should just work under macOS.
|
||||||
|
|
||||||
[Here is a link to a list of recommended USB PCIe cards](http://blog.greggant.com/posts/2018/05/07/definitive-mac-pro-upgrade-guide.html).
|
[Here is a link to a list of recommended USB PCIe cards](http://blog.greggant.com/posts/2018/05/07/definitive-mac-pro-upgrade-guide.html).
|
||||||
|
|
||||||
|
|
||||||
### Synergy Notes
|
### Synergy Notes
|
||||||
|
|
||||||
* Get Synergy from https://sourceforge.net/projects/synergy-stable-builds.
|
- Get Synergy from https://sourceforge.net/projects/synergy-stable-builds.
|
||||||
|
|
||||||
I installed "synergy-v1.8.8-stable-MacOSX-x86_64.dmg" on the macOS guest and
|
I installed "synergy-v1.8.8-stable-MacOSX-x86_64.dmg" on the macOS guest and
|
||||||
configured it as a client.
|
configured it as a client.
|
||||||
|
@ -270,11 +272,10 @@ These steps will need to be adapted for your particular setup.
|
||||||
System Preferences -> Users & Groups -> Select your user account -> Login Items
|
System Preferences -> Users & Groups -> Select your user account -> Login Items
|
||||||
-> Add a login item
|
-> Add a login item
|
||||||
|
|
||||||
* On the Linux host machine, install "synergy-v1.8.8-stable-Linux-x86_64.deb"
|
- On the Linux host machine, install "synergy-v1.8.8-stable-Linux-x86_64.deb"
|
||||||
or newer, configure `~/.synergy.conf` and run `synergys` command.
|
or newer, configure `~/.synergy.conf` and run `synergys` command.
|
||||||
|
|
||||||
* The included `.synergy.conf` will need to be adapted according to your setup.
|
- The included `.synergy.conf` will need to be adapted according to your setup.
|
||||||
|
|
||||||
|
|
||||||
### Virtual Sound Device
|
### Virtual Sound Device
|
||||||
|
|
||||||
|
@ -296,7 +297,6 @@ present.
|
||||||
This cheap(est) USB sound card works pretty well on macOS *without* requiring
|
This cheap(est) USB sound card works pretty well on macOS *without* requiring
|
||||||
USB-controller-passthrough.
|
USB-controller-passthrough.
|
||||||
|
|
||||||
|
|
||||||
### Building QEMU from source
|
### Building QEMU from source
|
||||||
|
|
||||||
See http://wiki.qemu-project.org/Hosts/Linux for help.
|
See http://wiki.qemu-project.org/Hosts/Linux for help.
|
||||||
|
@ -314,7 +314,6 @@ $ ../configure --prefix=/home/$(whoami)/QEMU --enable-trace-backend=simple \
|
||||||
$ make -j8; make install
|
$ make -j8; make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Connect iPhone / iPad to macOS guest
|
### Connect iPhone / iPad to macOS guest
|
||||||
|
|
||||||
iDevices can be passed through in two ways: USB or USB OTA.
|
iDevices can be passed through in two ways: USB or USB OTA.
|
||||||
|
@ -329,7 +328,6 @@ VFIO USB Passthrough:
|
||||||
|
|
||||||
https://github.com/Silfalion/Iphone_docker_osx_passthrough
|
https://github.com/Silfalion/Iphone_docker_osx_passthrough
|
||||||
|
|
||||||
|
|
||||||
### Exposing AES-NI instructions to macOS
|
### Exposing AES-NI instructions to macOS
|
||||||
|
|
||||||
Add `+aes` argument to the `-cpu` option in `boot-macOS.sh` file.
|
Add `+aes` argument to the `-cpu` option in `boot-macOS.sh` file.
|
||||||
|
@ -355,7 +353,7 @@ Other host CPU features can be similarly exposed to the macOS guest.
|
||||||
The following command can be used on macOS to verify that AES-NI instructions are exposed,
|
The following command can be used on macOS to verify that AES-NI instructions are exposed,
|
||||||
|
|
||||||
```
|
```
|
||||||
sysctl -a | grep machdep.features
|
sysctl -a | grep machdep.cpu.features
|
||||||
```
|
```
|
||||||
|
|
||||||
On machines with OpenSSL installed, the following two commands can be used to
|
On machines with OpenSSL installed, the following two commands can be used to
|
||||||
|
@ -367,7 +365,6 @@ openssl speed aes-128-cbc
|
||||||
openssl speed -evp aes-128-cbc # uses AES-NI
|
openssl speed -evp aes-128-cbc # uses AES-NI
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Exposing AVX and AVX2 instructions to macOS
|
### Exposing AVX and AVX2 instructions to macOS
|
||||||
|
|
||||||
Exposing AVX and AVX2 instructions to macOS requires support for these
|
Exposing AVX and AVX2 instructions to macOS requires support for these
|
||||||
|
@ -396,7 +393,6 @@ machdep.cpu.leaf7_features: SMEP BMI1 AVX2 BMI2
|
||||||
machdep.cpu.leaf7_feature_bits: 424
|
machdep.cpu.leaf7_feature_bits: 424
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Enabling Hypervisor.Framework (Nested Virtualization / Docker for Mac / Android Emulator / etc)
|
### Enabling Hypervisor.Framework (Nested Virtualization / Docker for Mac / Android Emulator / etc)
|
||||||
|
|
||||||
Docker for Mac, the Android Emulator and other virtualization products require
|
Docker for Mac, the Android Emulator and other virtualization products require
|
||||||
|
@ -418,18 +414,17 @@ If the `VMX` flag is missing, use the following steps to enable it:
|
||||||
- Make sure the VM is booted with VMX support passed through using one of the
|
- Make sure the VM is booted with VMX support passed through using one of the
|
||||||
two below strategies:
|
two below strategies:
|
||||||
|
|
||||||
- You may add `vmx,rdtscp` arguments to the `-cpu` option in `boot-macOS.sh`
|
You may add `vmx,rdtscp` arguments to the `-cpu` option in `boot-macOS.sh`
|
||||||
file (easier option).
|
file (easier option).
|
||||||
|
|
||||||
- You may add `+vmx,` to the front of `MY_OPTIONS` in the boot script while
|
You may add `+vmx,` to the front of `MY_OPTIONS` in the boot script while
|
||||||
changing `-cpu Penryn` to `-cpu Skylake-Client` or [any other suitable supported CPU](https://manpages.ubuntu.com/manpages/disco/man7/qemu-cpu-models.7.html).
|
changing `-cpu Penryn` to `-cpu Skylake-Client` or [any other suitable supported CPU](https://manpages.ubuntu.com/manpages/disco/man7/qemu-cpu-models.7.html).
|
||||||
|
|
||||||
Note: Host CPU passthrough is troublesome and not generally recommended.
|
Note: Host CPU passthrough is troublesome and not generally recommended.
|
||||||
|
|
||||||
Note: You may need to `Reset NVRAM` on the next reboot, but after that you
|
Note: You may need to `Reset NVRAM` on the next reboot, but after that you
|
||||||
should see a `1` when you re-check `sysctl kern.hv_support`.
|
should see a `1` when you re-check `sysctl kern.hv_support`.
|
||||||
|
|
||||||
|
|
||||||
### Using virtio-blk-pci with macOS
|
### Using virtio-blk-pci with macOS
|
||||||
|
|
||||||
Newer macOS (namely Mojave+) have support for some virtio drivers.
|
Newer macOS (namely Mojave+) have support for some virtio drivers.
|
||||||
|
@ -442,8 +437,7 @@ get some performance gain.
|
||||||
+ -device virtio-blk-pci,drive=MacHDD \
|
+ -device virtio-blk-pci,drive=MacHDD \
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Permission problems with libvirt / qemu
|
||||||
### Permission problems with libvirt / qemu?
|
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo setfacl -m u:libvirt-qemu:rx /home/$USER
|
sudo setfacl -m u:libvirt-qemu:rx /home/$USER
|
||||||
|
@ -454,12 +448,11 @@ In general,
|
||||||
sudo setfacl -R -m u:libvirt-qemu:rx <path> # fix virt-manager perm problems
|
sudo setfacl -R -m u:libvirt-qemu:rx <path> # fix virt-manager perm problems
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Extract .pkg files
|
### Extract .pkg files
|
||||||
|
|
||||||
* http://mackyle.github.io/xar/ is unmaintained and may fail for many `.pkg` files.
|
- http://mackyle.github.io/xar/ is unmaintained and may fail for many `.pkg` files.
|
||||||
|
|
||||||
* Use a modern version of `7-Zip` instead.
|
- Use a modern version of `7-Zip` instead.
|
||||||
|
|
||||||
```
|
```
|
||||||
7z l example.pkg
|
7z l example.pkg
|
||||||
|
@ -469,21 +462,18 @@ sudo setfacl -R -m u:libvirt-qemu:rx <path> # fix virt-manager perm problems
|
||||||
gunzip -c <something>.pkg/Payload | cpio -i
|
gunzip -c <something>.pkg/Payload | cpio -i
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### QEMU quits with `gtk initialization failed`
|
### QEMU quits with `gtk initialization failed`
|
||||||
|
|
||||||
Append the `display=none` argument to your QEMU execution script (this has
|
Append the `display=none` argument to your QEMU execution script (this has
|
||||||
already been done for `boot-passthrough.sh`)
|
already been done for `boot-passthrough.sh`)
|
||||||
|
|
||||||
|
|
||||||
### ISO/DMG (`createinstallmedia` generated) install medium not detected
|
### ISO/DMG (`createinstallmedia` generated) install medium not detected
|
||||||
|
|
||||||
In OpenCore's `config.plist` and set `ScanPolicy` to `0` ([For more information, check the Dortania Troubleshooting Guide](https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/troubleshooting.html#can-t-see-macos-partitions))
|
In OpenCore's `config.plist` and set `ScanPolicy` to `0` ([For more information, check the Dortania Troubleshooting Guide](https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/troubleshooting.html#can-t-see-macos-partitions))
|
||||||
|
|
||||||
|
|
||||||
### Attach physical drive to QEMU VM
|
### Attach physical drive to QEMU VM
|
||||||
|
|
||||||
*Note: If using NVMe, passing the controller may be a better option then passing it as a block device*
|
Note: If using NVMe, passing the controller may be a better option then passing it as a block device.
|
||||||
|
|
||||||
Run `ls -la /dev/disk/by-id/` to get the unique mapping for the device you want to attach to the VM (like `sda`, `sdb`, `nvme0n1`, while you can attach only a partition like `sda1`, this is not recommended)
|
Run `ls -la /dev/disk/by-id/` to get the unique mapping for the device you want to attach to the VM (like `sda`, `sdb`, `nvme0n1`, while you can attach only a partition like `sda1`, this is not recommended)
|
||||||
|
|
||||||
|
@ -515,30 +505,27 @@ block device without `root` permissions)
|
||||||
-device ide-hd,bus=sata.4,drive=NVMeDrive \
|
-device ide-hd,bus=sata.4,drive=NVMeDrive \
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Run the Virtual Machine on Boot
|
### Run the Virtual Machine on Boot
|
||||||
|
|
||||||
* Edit your QEMU launch script and set the absolute path of `OSX-KVM` as the
|
- Edit your QEMU launch script and set the absolute path of `OSX-KVM` as the
|
||||||
value of `REPO_PATH`
|
value of `REPO_PATH`
|
||||||
|
|
||||||
* Edit `/etc/rc.local` and add the absolute path of the script (with or without
|
- Edit `/etc/rc.local` and add the absolute path of the script (with or without
|
||||||
`sudo` depending on your needs) to the bottom of the script.
|
`sudo` depending on your needs) to the bottom of the script.
|
||||||
|
|
||||||
|
|
||||||
### Setup SSH for internal remote access
|
### Setup SSH for internal remote access
|
||||||
|
|
||||||
Presuming your network interface has a statically defined internal IP (on Ubuntu).
|
Presuming your network interface has a statically defined internal IP (on Ubuntu).
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo apt install openssh-server -y
|
sudo apt install openssh-server -y
|
||||||
$ sudo ufw allow ssh
|
sudo ufw allow ssh
|
||||||
$ sudo update-rc.d ssh defaults
|
sudo update-rc.d ssh defaults
|
||||||
$ sudo systemctl enable ssh
|
sudo systemctl enable ssh
|
||||||
$ sudo systemctl enable ssh.socket
|
sudo systemctl enable ssh.socket
|
||||||
$ sudo systemctl enable ssh.service
|
sudo systemctl enable ssh.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### AMD GPU Notes
|
### AMD GPU Notes
|
||||||
|
|
||||||
- https://www.nicksherlock.com/2020/11/working-around-the-amd-gpu-reset-bug-on-proxmox/
|
- https://www.nicksherlock.com/2020/11/working-around-the-amd-gpu-reset-bug-on-proxmox/
|
||||||
|
@ -546,7 +533,6 @@ $ sudo systemctl enable ssh.service
|
||||||
- Consider using CMMChris's [RadeonBoost.kext](https://forums.macrumors.com/threads/tired-of-low-geekbench-scores-use-radeonboost.2231366/)
|
- Consider using CMMChris's [RadeonBoost.kext](https://forums.macrumors.com/threads/tired-of-low-geekbench-scores-use-radeonboost.2231366/)
|
||||||
for the RX480, RX580, RX590 and Radeon VII GPUs.
|
for the RX480, RX580, RX590 and Radeon VII GPUs.
|
||||||
|
|
||||||
|
|
||||||
### USB passthrough notes
|
### USB passthrough notes
|
||||||
|
|
||||||
#### USB 3.0 flash drive
|
#### USB 3.0 flash drive
|
||||||
|
@ -554,38 +540,45 @@ $ sudo systemctl enable ssh.service
|
||||||
The following USB configuration works for usb passthrough of a USB 3.0 flash
|
The following USB configuration works for usb passthrough of a USB 3.0 flash
|
||||||
drive to Fedora 25 guest.
|
drive to Fedora 25 guest.
|
||||||
|
|
||||||
-device nec-usb-xhci,id=xhci \
|
```
|
||||||
-device usb-host,bus=xhci.0,vendorid=0x0781,productid=0x5590 \
|
-device nec-usb-xhci,id=xhci \
|
||||||
-usb -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 \
|
-device usb-host,bus=xhci.0,vendorid=0x0781,productid=0x5590 \
|
||||||
...
|
-usb -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 \
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
#### Moto G3 phone
|
#### Moto G3 phone
|
||||||
|
|
||||||
The following USB configuration works for usb passthrough of a Moto G3 phone to
|
The following USB configuration works for usb passthrough of a Moto G3 phone to
|
||||||
Fedora 25 guest.
|
Fedora 25 guest.
|
||||||
|
|
||||||
|
```
|
||||||
-device usb-host,bus=usb-bus.0,vendorid=0x22b8,productid=0x002e \
|
-device usb-host,bus=usb-bus.0,vendorid=0x22b8,productid=0x002e \
|
||||||
-usb -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 \
|
-usb -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 \
|
||||||
...
|
...
|
||||||
|
```
|
||||||
|
|
||||||
#### CoolerMaster keyboard
|
#### CoolerMaster keyboard
|
||||||
|
|
||||||
The following USB configuration works for usb passthrough of a CoolerMaster
|
The following USB configuration works for usb passthrough of a CoolerMaster
|
||||||
keyboard to macOS Sierra guest!
|
keyboard to macOS Sierra guest!
|
||||||
|
|
||||||
|
```
|
||||||
-device usb-host,bus=usb-bus.0,vendorid=0x2516,productid=0x0004 \
|
-device usb-host,bus=usb-bus.0,vendorid=0x2516,productid=0x0004 \
|
||||||
-usb -device usb-tablet,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 \
|
-usb -device usb-tablet,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 \
|
||||||
...
|
...
|
||||||
|
```
|
||||||
|
|
||||||
#### Virtual USB disk
|
#### Virtual USB disk
|
||||||
|
|
||||||
The following USB configuration works for attaching a virtual USB disk to macOS
|
The following USB configuration works for attaching a virtual USB disk to macOS
|
||||||
Sierra guest. Use "qemu-img" to create "disk.raw" virtual disk.
|
Sierra guest. Use "qemu-img" to create "disk.raw" virtual disk.
|
||||||
|
|
||||||
|
```
|
||||||
-drive if=none,id=usbstick,file=disk.raw,format=raw \
|
-drive if=none,id=usbstick,file=disk.raw,format=raw \
|
||||||
-device usb-storage,bus=usb-bus.0,drive=usbstick \
|
-device usb-storage,bus=usb-bus.0,drive=usbstick \
|
||||||
...
|
...
|
||||||
|
```
|
||||||
|
|
||||||
However USB passthrough of EHCI, and XHCI (USB 3.0) devices does not work with
|
However USB passthrough of EHCI, and XHCI (USB 3.0) devices does not work with
|
||||||
macOS Sierra. See https://bugs.launchpad.net/qemu/+bug/1509336 for
|
macOS Sierra. See https://bugs.launchpad.net/qemu/+bug/1509336 for
|
||||||
|
@ -597,8 +590,7 @@ It seems that this problem can be fixed by using OVMF + Clover.
|
||||||
Update: OVMF + Clover doesn't help. It seems that macOS is missing the required
|
Update: OVMF + Clover doesn't help. It seems that macOS is missing the required
|
||||||
drivers for the EHCI, and XHCI controllers that are exposed by QEMU.
|
drivers for the EHCI, and XHCI controllers that are exposed by QEMU.
|
||||||
|
|
||||||
|
### Generate macOS Mojave / Catalina installation ISO
|
||||||
### Generate macOS Mojave / Catalina installation ISO.
|
|
||||||
|
|
||||||
This step currently needs to be run on an existing macOS system.
|
This step currently needs to be run on an existing macOS system.
|
||||||
|
|
||||||
|
@ -608,21 +600,19 @@ drivers for the EHCI, and XHCI controllers that are exposed by QEMU.
|
||||||
./create_dmg_catalina.sh
|
./create_dmg_catalina.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Tweaks for macOS
|
### Tweaks for macOS
|
||||||
|
|
||||||
1. Disable `Energy Saver` in `System Preferences`.
|
- Disable `Energy Saver` in `System Preferences`.
|
||||||
|
|
||||||
2. Disable `Screen Saver` in `System Preferences -> Desktop & Screen Saver`.
|
- Disable `Screen Saver` in `System Preferences -> Desktop & Screen Saver`.
|
||||||
|
|
||||||
3. Turn off indexing using the following command.
|
- Turn off indexing using the following command.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo mdutil -a -i off
|
sudo mdutil -a -i off
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Enable `Remote Login` (aka SSH) via `System Preferences -> Sharing`.
|
|
||||||
|
|
||||||
|
- Enable `Remote Login` (aka SSH) via `System Preferences -> Sharing`.
|
||||||
|
|
||||||
### Snapshot Debugging Tips
|
### Snapshot Debugging Tips
|
||||||
|
|
||||||
|
@ -635,7 +625,6 @@ drivers for the EHCI, and XHCI controllers that are exposed by QEMU.
|
||||||
|
|
||||||
Ensure that you have plenty of free space in `/var/tmp` and `/`.
|
Ensure that you have plenty of free space in `/var/tmp` and `/`.
|
||||||
|
|
||||||
|
|
||||||
To use a separate storage location for storing snapshots, use the following
|
To use a separate storage location for storing snapshots, use the following
|
||||||
trick (from `zimbatm`):
|
trick (from `zimbatm`):
|
||||||
|
|
||||||
|
@ -643,14 +632,12 @@ drivers for the EHCI, and XHCI controllers that are exposed by QEMU.
|
||||||
export TMPDIR=$PWD/tmp
|
export TMPDIR=$PWD/tmp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 'Fix' weird boot problems
|
### 'Fix' weird boot problems
|
||||||
|
|
||||||
```
|
```
|
||||||
cp OVMF_VARS-1024x768.fd.bak OVMF_VARS-1024x768.fd
|
cp OVMF_VARS-1024x768.fd.bak OVMF_VARS-1024x768.fd
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 'Fix' time drift problems
|
### 'Fix' time drift problems
|
||||||
|
|
||||||
Run the following command periodically from root's crontab:
|
Run the following command periodically from root's crontab:
|
||||||
|
@ -659,7 +646,6 @@ Run the following command periodically from root's crontab:
|
||||||
sntp -S pool.ntp.org
|
sntp -S pool.ntp.org
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Pass through all CPU cores / threads
|
### Pass through all CPU cores / threads
|
||||||
|
|
||||||
macOS requires a core count that is a power of 2, but some modern CPUs have odd
|
macOS requires a core count that is a power of 2, but some modern CPUs have odd
|
||||||
|
@ -688,12 +674,10 @@ The `-smp line` should read something like the following:
|
||||||
-smp "$CPU_TOTAL",cores="$CPU_CORES",sockets="$CPU_SOCKETS",threads="$CPU_THREADS",maxcpus="$CPU_TOTAL"
|
-smp "$CPU_TOTAL",cores="$CPU_CORES",sockets="$CPU_SOCKETS",threads="$CPU_THREADS",maxcpus="$CPU_TOTAL"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Troubles with iMessage
|
||||||
### Trouble with iMessage?
|
|
||||||
|
|
||||||
Check out [this Dortania article on this topic](https://dortania.github.io/OpenCore-Post-Install/universal/iservices.html#using-gensmbios).
|
Check out [this Dortania article on this topic](https://dortania.github.io/OpenCore-Post-Install/universal/iservices.html#using-gensmbios).
|
||||||
|
|
||||||
|
|
||||||
### Fix 'guest boots to UEFI shell' problem (stuck at startup.nsh problem)
|
### Fix 'guest boots to UEFI shell' problem (stuck at startup.nsh problem)
|
||||||
|
|
||||||
Use a fresh copy of the `OVMF_VARS-1024x768.fd` file.
|
Use a fresh copy of the `OVMF_VARS-1024x768.fd` file.
|
||||||
|
@ -702,7 +686,6 @@ Use a fresh copy of the `OVMF_VARS-1024x768.fd` file.
|
||||||
git checkout OVMF_VARS-1024x768.fd
|
git checkout OVMF_VARS-1024x768.fd
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Enable rc.local functionality on modern Ubuntu versions
|
### Enable rc.local functionality on modern Ubuntu versions
|
||||||
|
|
||||||
Create `/etc/rc.local` file with the following content, if it doesn't exist:
|
Create `/etc/rc.local` file with the following content, if it doesn't exist:
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 213 KiB |
Binary file not shown.
After Width: | Height: | Size: 238 KiB |
Binary file not shown.
After Width: | Height: | Size: 215 KiB |
Binary file not shown.
After Width: | Height: | Size: 890 KiB |
Binary file not shown.
After Width: | Height: | Size: 398 KiB |
Loading…
Reference in New Issue