Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Blog post about using QEMU/KVM with latest macOS versions (#28)
Browse files Browse the repository at this point in the history
---------
Co-authored-by: Kirill Taran <[email protected]>
  • Loading branch information
shubertm authored Nov 25, 2024
1 parent 6c77e6d commit 71b46b6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ public
.vs
.vscode
sass/bootstrap
.idea
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions content/blog/02-run-new-macos-in-qemu-kvm.md
Original file line number Diff line number Diff line change
@@ -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/)

0 comments on commit 71b46b6

Please sign in to comment.