Documentation to set up a simple macOS VM in QEMU, accelerated by KVM.
By: notAperson535
Tools to set up a easy, quick macOS VM in QEMU, accelerated by KVM. Works on Linux AND Windows.
Home Page: https://notAperson535.github.io/OneClick-macOS-Simple-KVM
License: MIT License
Documentation to set up a simple macOS VM in QEMU, accelerated by KVM.
By: notAperson535
Describe the bug
On running the setup.sh it downloads the mac image but after wards directly spits out Unable to init server: Could not connect: Connection refused
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Download mac image and setup the dependencies and VM
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
had teh same with the simple mac os kvm git
Apparently I made a mistake by buying an 5900X for things like this since it seems like Hyper-V doesn't really like AMD with nested virtualization / KVM and stuff or something, but is there a workaround for this?
The issue is that kvm-ok
returns that my processor isn't supported, which I know isn't true since Ryzen processors do actually support virtualization.
If there's no workaround I'll try to run this inside of a VMware machine, and if that doesn't work I'll probably have to dual boot which is really inconvenient.
Sorry for asking such an uneducated question, so my apologies if it's a bit unclear.
Describe the bug
I am unable to install or upgrade to Monterey on my system. It always hangs at the beginning of selecting the installation medium (this is trying a fresh install, or even an upgrade from inside BigSur)
I think this is an accurate description of what I am experiencing:
https://www.reddit.com/r/hackintosh/comments/ud7b6r/stuck_on_boot_for_monterey_on_optiplex_7050/
I get this when using a default install from the repo. When I try using a fixed EFI in this thread:
I get this issue instead (which I assume is further along).
https://www.reddit.com/r/hackintosh/comments/u8ukbx/opencore_080_monterey_installation_stalling/
https://www.tonymacx86.com/threads/big-sur-installer-error-in-opening-usr-standalone-os-dmg-root_hash.306845/
Some other links I had up in researching this issue:
https://github.com/acidanthera/CpuTscSync
https://www.reddit.com/r/hackintosh/comments/us9wog/update_legion_5_with_rx6600m_gpu_acceleration/
I feel it may be because of lack of tsc_adjust support but I have not tried single CPU yet. I could test more but need to learn how to build OpenCore. There is a repo I found with a make file but requires MacOS so gotta figure that one out first.
Desktop
OpenSUSE Tumbleweed
./basic.sh
warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
qxl_send_events: spice-server bug: guest stopped, ignoring
gtk initialization failed
Why do you advise to use macOS Extended Journaled to format the hard disk instead of APFS?
Mac big sur os closes on the setting up mac os screen, this is using the oneclick method fedora 64x
I'm getting the following error when attempting to import into Virt Manager. I'm running Fedora 35 GNOME desktop.
./make.sh --add
template.xml has been generated in /home/aia832003/Documents/notAperson535-OneClick-macOS-Simple-KVM-61657ee
[sudo] password for aia832003:
error: Failed to define domain from template.xml
error: Cannot check QEMU binary /run/current-system/sw/bin/qemu-system-x86_64: No such file or directory
Please make same thing but with macOS and OpenCore ISO that you flash into a USB and the whole Hackintosh is ready and working.
That'll solve all of the problems with creating a Hackintosh, It will be much easier.
Which operating system are you trying to install?
e.g. macOS Ventura
Describe the bug
Warning message by running ./basic.sh
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
But the VM starts.
And in virt-manager, same messages but as errors, and the VM does not start.
To Reproduce
Steps to reproduce the behavior:
Follow the documentation to create a fresh new VM
Run ./make.sh --add
Try to run the VM from virt-manager
Expected behavior
The VM to boot normally, like by running basic.sh
Desktop (please complete the following information):
Currently the docs are written keeping linux in mind but gpu support is also need in wsl method.
The problem is that the doc states pci port number but in the case of gwsl or wsl this is not constant so we cannot have it in kernel parameter in where vfio pci id's are placed
Same goes for VNC viewer, it don't have any docs for that
EDIT: sry for not being able to give it a better title
Which operating system are you trying to install?
macOS Big Sur
Describe the bug
Stuck on the macOS installation/configuration screen. The guide says to be patient at this stage of the process (with about 1 minute remaining), but it is like this for two hours. The CPU and RAM consumption on the host also dropped to almost 0.
To Reproduce
HEADLESS=1 ./basic.sh
Went through the disc partitioning and mac installation utility, performed the first stage of the installation while rebooting a few times, now it is running from the "Macintosh Disk"
Screenshots
Desktop (please complete the following information):
The host linux is VM running on VMWare
I install Bigsur
And I need Vscode in bigsur for my office work but when i install vscode and start its not working fine not Complete Ui laggy and so on
Please help me how to resolve this Tanks
Which operating system are you trying to install?
e.g. macOS Mojave
Describe the bug
Tried mojave and HS , it seems qemu cannot handle the dmg correctly
To Reproduce
Steps to reproduce the behavior:
qemu: module block-block-dmg-bz2 not found, do you want to install qemu-block-extra package?
qemu: module block-block-dmg-lzfse not found, do you want to install qemu-block-extra package?
ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
qemu-system-x86_64: failed to initialize kvm: Device or resource busy
Expected behavior
install does not stop
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Which operating system are you trying to install?
e.g. macOS Ventura
Describe the bug
When i try to simple open the BaseSystem file, it runs to certain point that gives me that error: "couldn't alloc class applekeystoretest"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Go through the verbose until start the recovery mode
Desktop (please complete the following information):
In my reasearch:
"-cpu Haswell,vendor=GenuineIntel" is a must, i dont know if this could cause performance issues....
" -smp cores=4,threads=2,sockets=1" - more than that the BaseSystem wont open
Which operating system are you trying to install?
macOS Big sur
Describe the bug
I have this error when trying to run the oneclick installer for opensuse:
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
gtk initialization failed
Desktop (please complete the following information):
macOS "Big Sur"
*Description
I could follow your tutotial of how to change the resollution of the VM (in my, for my laptop), but, when I do this, the VM shows stretched screen, and I can not work with that.
Steps to reproduce the behavior:
Expected behavior
The resollution would have been changed without any problem, proportionally.
Desktop
Which operating system are you trying to install?
Transfer from macOS-Simple-KVM to upgrade to Monterey
Describe the bug
After following the instruction getting the following error:
root@maul:/mnt/kvm/OneClick-macOS-Simple-KVM# ./make.sh --add
template.xml has been generated in /mnt/kvm/OneClick-macOS-Simple-KVM
error: Failed to define domain from template.xml
error: Cannot check QEMU binary /run/current-system/sw/bin/qemu-system-x86_64: No such file or directory
To Reproduce
All you have to do is place the BaseSystem file and the file that has macOS installed into the OneClick-macOS-Simple-KVM folder. Then rename the file that has macOS installed (usually MyDisk.qcow2) to macOS.qcow2. Then run ./basic.sh a
Expected behavior
Adding VM to KVM
Screenshots
Attached
Desktop (please complete the following information):
This is the following information about my system:
OS: Pop!_OS 22.04 LTS x86_64
Kernel: 5.19.0-76051900-generic
Uptime: 10 hours, 16 mins
Packages: 2493 (dpkg), 58 (flatpak)
Shell: bash 5.1.16
Resolution: 1920x1080, 1920x1080, 3440x1440, 3840x2160
Terminal: gnome-terminal
CPU: AMD Ryzen 9 5950X (32) @ 3.4GHz [60.6°C]
GPU: AMD ATI Radeon RX 6800/6800 XT / 6900 XT
Memory: 11231MiB / 128730MiB (8%)
Additional context
Add any other context about the problem here.
@notAperson535, Hi, I wanna copy a large file that takes forever to download (Especially on a VM) and I have the file on my PC so please add an option to access the computer's root folder from the VM.
qemu-system-x86_64: -drive id=InstallMedia,format=raw,if=none,file=BaseSystem.img: Could not open 'BaseSystem.img': No such file or directory
Running setup.sh doesn't seem to download BaseSystem.dmg. The script throws that error after the fact
when I tried to install MacOS High Sierra, it kernel panics, my device is a Sony VAIO, with a dual core athlon, p.s I have a 27GB SWAP partition OS: Debian 11.5 (amd64), steps to reproduce download High Sierra's DMG, then turn it into an img, then try to install, should I use another MacOS version?
Please specify that in the netctl settings the device name should go inside the parenthesis (DEVICENAME). I thought you were supposed to remove the parenthesis and just write the device name. There is no clear error message for this.
This occurs after shutting down the system. When trying to start the VM up again:
Requested operation is not valid: Setting different DAC user or group on OVMF_VARS-1024x768.fd which is already in use
I'm having the same issue with SELinux, its the exact same error except replace DAC with "SELinux Attribute". I attempted to rectify the issue by setting remember_owner = 0
in /etc/libvirt/qemu.conf
as specified in https://bugzilla.redhat.com/show_bug.cgi?id=1774373
I also found a chinese-language forum post talking about a similar issue, and their fix was again to set the remember_owner = 0 .
see https://bbs.huaweicloud.com/forum/thread-69587-1-1.html
I attempted to use this, and the machine was unbootable, instead going into a UEFI shell, but the error disappeared and the machine at least started.
I have the problem that the setup constantly fails. I don't even know if it really crashes or if it "just" reboots. Everything works fine until the 12 minute mark and suddenly the system reboots.
I tried to make some use of the install log but it's gone the moment the setup reboots, so I don't know to get info there.
I ran the setup on two different machines, both Intel i7. The system on both machines is arch, at the moment I don't have any other machine at hand. The systems are up to date.
I tried with install images downloaded with fetch-macOS-v2.py, both Big Sur and Monterey and I tried a full Bug Sur installation medium generated on a mac, the result is always the same.
My main problem is that I don't know where else to look for information or what else to try. Any hint or help would be appreciated.
$ ./tools/debug.sh
== Distro Info ==
LSB Version: n/a
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
== Loaded Modules ==
kvm_intel 368640 0
kvm 1069056 1 kvm_intel
irqbypass 16384 1 kvm
== Installed Binaries ==
QEMU emulator version 6.2.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
virt-manager version 3.2.0
Python 3.10.2
pip 20.3.4 from /usr/lib/python3.10/site-packages/pip (python 3.10)
$ cat /sys/module/kvm/parameters/ignore_msrs
Y
Is your feature request related to a problem? Please describe.
A Community Discord where you have the basic Channels like community-support, general and an GitHub Update Channel
Thank you for your awesome work !
It works fine, but unfortunately the keyboard layout is definitely broken and I couldn't find any solution on the web for it.
Maybe related to VNC, I'm using an AZERTY (FR) keyboard and I can't type numbers or special characters on Mac.
I used your project to use XCode on Windows, not having the possibility to use [
,]
,{
,}
,(
,)
,,
and .
is a bit annoying.
Probably not related to your project but if you have an idea where it came from, it would be really nice to share it on the tutorial.
The installation process restarts from the beginning when its about to complete, but when I use Clover, the installation completes successfully and I am able to boot into macOS. This issue only occurs with OpenCore, not with Clover.
Describe the bug
Cannot get past the setup step for Monterey install.
To Reproduce
HEADLESS=1 ./basic.sh
and connect via vnc./basic.sh: line 41: 173 Segmentation fault qemu-system-x86_64 "${args[@]}"
Expected behavior
For install OS to succeed and create a bootable partition.
Desktop (please complete the following information):
$: uname -r
4.19.104-microsoft-standard
Additional context
Getting a bunch of ALSA related errors as well - I have no ALSA support currently so this is not weird.
$: HEADLESS=1 ./basic.sh
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to opendefault': alsa: Reason: No such file or directory ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default alsa: Could not initialize DAC alsa: Failed to open
default':
alsa: Reason: No such file or directory
audio: Failed to create voice `dac'
BdsDxe: loading Boot0001 "UEFI QEMU HARDDISK QM00017 " from PciRoot(0x0)/Pci(0x4,0x0)/Sata(0x2,0xFFFF,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU HARDDISK QM00017 " from PciRoot(0x0)/Pci(0x4,0x0)/Sata(0x2,0xFFFF,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
qemu-system-x86_64: warning: guest updated active QH
qemu-system-x86_64: warning: guest updated active QH
BdsDxe: loading Boot0001 "UEFI QEMU HARDDISK QM00017 " from PciRoot(0x0)/Pci(0x4,0x0)/Sata(0x2,0xFFFF,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU HARDDISK QM00017 " from PciRoot(0x0)/Pci(0x4,0x0)/Sata(0x2,0xFFFF,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
*./basic.sh: line 41: 173 Segmentation fault qemu-system-x86_64 "${args[@]}" *
OS
macOS Ventura
Describe the bug
Macos installer runs to about 16 minutes more and the apple logo disapears and the next screen is "failed to apply update" at update assistance
To Reproduce
On Laption with WIFI, (dont know if this matters)
Host machine = Fedora
Qemu version = QEMU emulator version 7.0.0 (qemu-7.0.0-12.fc37)
manual installation so i can increase the disk to 90gb and i used defaults including the disk name
Runs the first 2hrs counting and restarts
selected MacOs installer
failed at applying updates
Expected behavior
To complete the installation
Desktop (please complete the following information):
I'm trying to install Monterey on windows but when I get to the point where I have to check if the KVM actually works in wsl it comes back as your cpu does not support KVM extensions. I've ran KVM on the same PC before on different distros on bare metal but never had this issue. Cpu i5-3320m (I have all virtualization settings enabled in bios)
Hi, I'm trying to install macOS on KVM on my laptop, it takes forever to install! It was stuck at 2 hours and 17 minutes left, and now it's 4 hours and 28 minutes!!
How do I fix this?
Describe the bug
QEMU does not launch at all when trying to run ./basic.sh
To Reproduce
Follow the instructions in the manual install or use the one click option and reach the point at which ./basic.sh is ran
Expected behavior
QEMU runs and the vm boots
Desktop:
Additional context
Using the awesome window manager and no desktop environment
VM is laggy and unusable when using brigde network
MacOS Monterey
I switched to -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \ option in basic.sh but the problem still persist
After sudo ./make.sh --add
I get errors related to the template.xml
containing the wrong path to the QEMU binary. After correcting that I tried running virsh create template.xml
but I see:
error: Network not found: no network with matching name 'default'
Any ideas?
Can't sign in using an apple id. When I go to create a new one, It says that this mac has been used to create too many apple ids.
Which operating system are you trying to install?
Ventura (13)
Describe the bug
Received the following error after downloading OS.
No protocol specified
Unable to init server: Could not connect: Connection refused
Could not access KVM kernel module: No such file or directory
qumu-system-x86_64: failed to initialize kvm: No such file or directory
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Set up KVM
Desktop (please complete the following information):
When running ./setup.sh, I receive this message:
/usr/bin/env: ‘bash\r’: No such file or directory
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.8.2-0ubuntu2).
qemu-system is already the newest version (1:4.2-3ubuntu6.21).
qemu-utils is already the newest version (1:4.2-3ubuntu6.21).
python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/usr/bin/env: ‘python3\r’: No such file or directory
qemu-img: Could not open 'BaseSystem.dmg': Could not open 'BaseSystem.dmg': No such file or directory
/usr/bin/env: ‘bash\r’: No such file or directory
I've tried using dos2unix setup.sh, and sed $'s/\r$//' setup.sh before ./setup.sh, and still having issues. Any idea?
python: can't open file 'python': [Errno 2] No such file or directory
qemu-system-x86_64: -drive id=InstallMedia,format=raw,if=none,file=BaseSystem.img: Could not open 'BaseSystem.img': No such file or directory
I'm getting this error when I try to install MacOS Monterrey, as soon as I run ./setup.sh. I have used this project before the most recent updates and it has worked fine
macOS "Monterrey"
Bug desciption
Hi! The title says everthing.
Basically, I'm ussing my new Monterrey installation, but sometimes, the mouse doesn't work and I have to restart the VM.
To Reproduce
Steps to reproduce the behavior:
usb_desc_get_descriptor: 2 unknown type 33 (len 10) usb_desc_get_descriptor: 1 unknown type 33 (len 10)
Desktop:
Additional context
In Sosumi, this also happens.
Is your feature request related to a problem? Please describe.
In order to pair other apple devices, it would be nice to have Bluetooth available in the VM.
Describe the solution you'd like
Forward Bluetooth through a bridge? Or assign the user/group to the VM? (Sorry, I don't know what exactly is necessary to make this work)
Describe alternatives you've considered
None so far.
Additional context
Just started with macOS Catalina on a AMD linux system and it's awesome! Thank you for this easy way of installing macOS.
Is your feature request related to a problem? Please describe.
I would like to transfer files through SFTP connection from host machine to guest MacOS VM.
Describe the solution you'd like
A way to make port forwarding so that SSH connections are possible.
Describe alternatives you've considered
I have considered using external cloud services to move data, but it's much slower than SFTP, so I thought it would be a good feature / documented thing. (Sorry if this is not the correct issue template but I cannot find any that suite this)
The docs contain great instructions on how to install everything, but what are the most important / main steps to remove it if not needed anymore?
Describe the bug
It restart when i try to boot the installer
To Reproduce
Boot the installer image
Expected behavior
Boot
Desktop (please complete the following information):
Additional context
I added -vnc
:0 to the command that used for boot the vm.
Hello,
My Monterey is running (didn't do the post install yet), bur I have this error :
sudo ./make.sh --add template.xml has been generated in /home/jean-martin/OneClick-macOS-Simple-KVM error: Failed to define domain from template.xml error: Cannot check QEMU binary /run/current-system/sw/bin/qemu-system-x86_64: Aucun fichier ou dossier de ce type
How can I solve that ?
Which operating system are you trying to install?
macOS "Big Sur" in KDE Neon
Describe the bug
Hi! Thanks for your open source proyect! I need help with my installation of macOS "Big Sur" in KDE Neon. The installation was successfully with "setup.sh", and I could install Homebrew and audio driver. But when I close a window in the VM, it is "glitch" and takes time to close. Even changing from "Aladino" to Windows-like effect.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The window should have been closed smoothly.
Desktop (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.