From 71b46b652464bd0103a3ac11c4ee225166ff59b9 Mon Sep 17 00:00:00 2001 From: Shubert Munthali Date: Mon, 25 Nov 2024 05:44:30 -0500 Subject: [PATCH] Blog post about using QEMU/KVM with latest macOS versions (#28) --------- Co-authored-by: Kirill Taran --- .gitignore | 1 + config.toml | 2 +- content/blog/02-run-new-macos-in-qemu-kvm.md | 39 ++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 content/blog/02-run-new-macos-in-qemu-kvm.md diff --git a/.gitignore b/.gitignore index c09f8ea..7e07de1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ public .vs .vscode sass/bootstrap +.idea \ No newline at end of file diff --git a/config.toml b/config.toml index 706a191..e5aa24a 100644 --- a/config.toml +++ b/config.toml @@ -11,7 +11,7 @@ default_language = "en" compile_sass = true # Whether to generate a feed file for the site -generate_feed = true +generate_feeds = true # When set to "true", the generated HTML files are minified. minify_html = false diff --git a/content/blog/02-run-new-macos-in-qemu-kvm.md b/content/blog/02-run-new-macos-in-qemu-kvm.md new file mode 100644 index 0000000..2b03762 --- /dev/null +++ b/content/blog/02-run-new-macos-in-qemu-kvm.md @@ -0,0 +1,39 @@ ++++ +title = "Run Latest Versions of macOS on Kernel Virtual Machines (KVM)" +date = 2024-09-24 +template = "blog/page.html" +description="Virtual machines (VMs) are a powerful tool that enables the emulation of various operating systems on a single physical computer, ranging from Windows to Linux to macOS, depending on the VM's configuration. Software like VirtualBox and QEMU/KVM facilitates the creation and management of VMs. However, the latest versions of macOS, such as Ventura, pose certain challenges for emulation within a Virtual Machine... In this post, we will explain how to get the latest versions of macOS running on Linux physical machine using QEMU/KVM." +[extra] + +author = "Shubert" ++++ + +## Why QEMU/KVM? + +The main reason to use QEMU/KVM is that it works better with the newest macOS versions, like Ventura, which often have problems running on VirtualBox. We can't run a macOS in QEMU right away though, but here really cool project [OSX-KVM](https://github.com/kholia/OSX-KVM) comes into play. We'll use macOS Sonoma as our example to show how it works. + +## How to use OSX-KVM? + +First of all, clone [OSX-KVM](https://github.com/kholia/OSX-KVM) and follow the instructions in the `README`. Chances are that, if you had followed all the steps from that repo, you already have a VM ready to run macOS Sonoma. + +However, if your machine cannot boot up to Sonoma, the explanation could be in the [Requirements](https://github.com/kholia/OSX-KVM#requirements) section of the OSX-KVM repo’s `README`. There is a requirement of a “CPU with AVX2 support” to run macOS Ventura or a later version. + +## Latest macOS versions and AVX2 support + +Now you need to check if your machine supports AVX2. To do this open terminal and run this command: + +``` +grep -o 'avx[^ ]*' /proc/cpuinfo +``` + +If your machine has AVX2 support it will print `avx avx2` for each core in the machine’s CPU. + +Then navigate to `OSX-KVM` folder, open `OpenCoreBoot.sh` file and do some edits: +1. Locate the line where `MY_OPTIONS` is declared, and add `+avx2` to it’s values. +2. Edit `-cpu` value to `host` entry. + +Save the script and run it. Sonoma should load now. + +### References +- [OSX-KVM](https://github.com/kholia/OSX-KVM/pull/207) +- [ostechnix](https://ostechnix.com/check-if-linux-system-supports-avx-and-avx2/)