Git Product home page Git Product logo

macos-simple-kvm's Introduction

macOS-Simple-KVM

Documentation to set up a simple macOS VM in QEMU, accelerated by KVM.

By @FoxletFox, and the help of many others. Find this useful? You can donate on Coinbase or Paypal!.

New to macOS and KVM? Check the FAQs.

Getting Started

You'll need a Linux system with qemu (3.1 or later), python3, pip and the KVM modules enabled. A Mac is not required. Some examples for different distributions:

sudo apt-get install qemu-system qemu-utils python3 python3-pip  # for Ubuntu, Debian, Mint, and PopOS.
sudo pacman -S qemu python python-pip python-wheel  # for Arch.
sudo xbps-install -Su qemu python3 python3-pip   # for Void Linux.
sudo zypper in qemu-tools qemu-kvm qemu-x86 qemu-audio-pa python3-pip  # for openSUSE Tumbleweed
sudo dnf install qemu qemu-img python3 python3-pip # for Fedora
sudo emerge -a qemu python:3.4 pip # for Gentoo

Step 1

Run jumpstart.sh to download installation media for macOS (internet required). The default installation uses Catalina, but you can choose which version to get by adding either --high-sierra, --mojave, or --catalina. For example:

./jumpstart.sh --mojave

Note: You can skip this if you already have BaseSystem.img downloaded. If you have BaseSystem.dmg, you will need to convert it with the dmg2img tool.

Step 2

Create an empty hard disk using qemu-img, changing the name and size to preference:

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.

Then run basic.sh to start the machine and install macOS. Remember to partition in Disk Utility first!

Step 2a (Virtual Machine Manager)

  1. If instead of QEMU, you'd like to import the setup into Virt-Manager for further configuration, just run sudo ./make.sh --add.
  2. After running the above command, add MyDisk.qcow2 as storage in the properties of the newly added entry for VM.

Step 2b (Headless Systems)

If you're using a cloud-based/headless system, you can use headless.sh to set up a quick VNC instance. Settings are defined through variables as seen in the following example. VNC will start on port 5900 by default.

HEADLESS=1 MEM=1G CPUS=2 SYSTEM_DISK=MyDisk.qcow2 ./headless.sh

Step 3

You're done!

To fine-tune the system and improve performance, look in the docs folder for more information on adding memory, setting up bridged networking, adding passthrough hardware (for GPUs), tweaking screen resolution, and enabling sound features.

macos-simple-kvm's People

Contributors

autra avatar deftdawg avatar evaan avatar foxlet avatar geckolinux avatar janniks avatar jeanfrancoisgratton avatar lewisdenny avatar lukaskalbertodt avatar macmcirish avatar pilo11 avatar ranomier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macos-simple-kvm's Issues

Apple ID doesn't work

Hi there, I tried to use the App Store and connect my Apple ID, but I can't get it to work. Every time I tried using the Apple ID module in the settings it says "account limit reached", but it shows a connected iMac in the Apple ID webpage under my account. (I don't own any real Apple devices.) When I try to connect my Apple ID from the App Store, it says this is the first time this account has been used on this machine, and asks me to verify my personal details, but it eventually fails:

5VK2F

Any other tips? Thanks!

how to make macOS VM run on macOS host with qemu

hello. I modified a few lines of basic.sh code to make the macOS VM run on the macOS host with qemu 4.0, it can boot up to the Clover boot UI, but it keeps going in a loop when start system. may I ask how to modify it?

the code is as follows:

#!/bin/bash

OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VMDIR=$PWD
OVMF=$VMDIR/firmware
#export QEMU_AUDIO_DRV=pa
#QEMU_AUDIO_DRV=pa

# qemu-img create -f qcow2 Sierra.qcow2 15G

qemu-system-x86_64 \
    -m 2G \
    -machine q35 \
    -smp 4,cores=2 \
    -cpu IvyBridge \
    -device isa-applesmc,osk="$OSK" \
    -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
    -drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
    -vga std \
    -device ich9-intel-hda -device hda-output \
    -usb -device usb-kbd -device usb-tablet \
    -netdev user,id=net0 \
    -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
    -device ich9-ahci,id=sata \
    -drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
    -device ide-hd,bus=sata.2,drive=ESP \
    -drive id=InstallMedia,if=none,format=raw,file=BaseSystem.img \
    -device ide-hd,bus=sata.3,drive=InstallMedia \
    -drive id=SystemDisk,if=none,file=Sierra.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk

Network passthrough

I did use the step via network manager but still it didn't conncet to internet.

Localizations

Is anyone interested in localizations for this project? I can do a Spanish translation of the documentation, but I just want to make sure this would get accepted before I translate it and create a pull request.

Suggestion: source for dmg2img

It's not nice that there's a precompiled binary in here. It would great if this repo had either a submodule pointing to the tool dmg2img or a copy of the source itself. It'll also be useful for people who want to tweak this to run on macOS itself (which obviously can't run ELFs natively).

PCIe Passtrhough iommu notifier

macOS is installed and works fine, trying the PCIe passthrough atm.
After lots of googling I gave up and decided to ask here :)
I get the following error message when trying to initialize my 750ti with the basic script:

qemu-system-x86_64: -device vfio-pci,host=20:00.0,bus=port.1,multifunction=on: device 00.00.0 requires iommu notifier which is not currently supported

My basic.sh:
`#!/bin/bash

OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VMDIR=$PWD
OVMF=$VMDIR/firmware
#export QEMU_AUDIO_DRV=pa
#QEMU_AUDIO_DRV=pa

qemu-system-x86_64
-enable-kvm
-m 2G
-machine q35,accel=kvm
-smp 4,cores=2
-cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc
-device isa-applesmc,osk="$OSK"
-smbios type=2
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd
-vga none
-device ich9-intel-hda -device hda-output
-usb -device usb-kbd -device usb-tablet
-netdev user,id=net0
-device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-device ich9-ahci,id=sata
-drive id=ESP,if=none,format=qcow2,file=ESP.qcow2
-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=MyDisk.qcow2
-device ide-hd,bus=sata.4,drive=SystemDisk
-device ioh3420,bus=pcie.0,multifunction=on,port=1,chassis=1,id=port.1
-device amd-iommu
-device vfio-pci,host=20:00.0,bus=port.1,multifunction=on
-device vfio-pci,host=20:00.1,bus=port.1 `

basic.sh fails with a number of 'host doesn't support requested feature' errors

I attempt to follow the installation steps in the readme on a DigitalOcean droplet and got the following errors. Is that environment not supported? Here are the errors:

root@catalina:~/macOS-Simple-KVM# ./basic.sh
WARNING: Image format was not specified for 'BaseSystem.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
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.0DH:EAX.xsavec [bit 1]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]
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.0DH:EAX.xsavec [bit 1]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]
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.0DH:EAX.xsavec [bit 1]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]
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.0DH:EAX.xsavec [bit 1]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_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:4528:(_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:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_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:4528:(_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:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(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'
Could not initialize SDL(No available video device) - exiting

These errors seem similar to what was reported in #26, although that also doesn't appear to have a resolution.

Sound only works with basic.sh, not virt-manager

Hi there,

Can anybody confirm or deny if sound (output) works with virt-manager? I can only get it work with basic.sh. There appears to be some difference in the virt-manager template.xml that make.sh generates. In the template.xml there is:

    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
    </controller>

Whereas basic.sh uses -device ich9-ahci,id=sata

Also, is there any way to a make integrated microphone input work with in macOS-Simple-KVM?

Thanks!

[Question] Sustainability of method?

Very cool project! So if I understand the fetch-macos.py script correctly, it seems to pull the macOS image directly from Apple's CDN? That is more robust than I expected, figured it would just be a third party server that Apple could quickly get taken down. But with that being said, I see the script needs a User-Agent to connect to the Apple CDN and SDS; couldn't Apple quickly revoke that apparently anonymous useragent?

basic.sh immediately closing

Went through the install instructions verbatim and when I got to run basic.sh, it quickly opened and closed a terminal without anything happening.

virt-manager start error

after make.sh --add
start virt-manager
error:internal error: process exited while connecting to monitor: 2019-06-21T07:59:27.954130Z qemu-system-x86_64: -machine pc-q35-3.0,accel=kvm,usb=off,vmport=off,dump-guest-core=off: unsupported machine type 'pc-q35-3.0'
Use -machine help to list supported machines

system:ubuntu18.04

click module in python2.7 and python 3.7

I am running Ubuntu 19.04 and have the requirements qemu python3 python3-pip including the python3.7 version of everything installed and when i try to run ./jumpstart -m I get this error:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Requirement already satisfied: requests in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 1)) (2.21.0) Requirement already satisfied: click in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2)) (7.0) Traceback (most recent call last): File "fetch-macos.py", line 9, in <module> import click ModuleNotFoundError: No module named 'click'

Getting this to work on Azure

The FAQ states that this project should work with Azure. I tried briefly to setup a VM, but failed on some permission issue.

It would be awesome with a guide that dictates exactly how to set everything up, eg:

  1. what image to use (Ubuntu 18, ...)
  2. what size of vm to use (as far as I understand, only newer generations are able to run a VM inside a VM)
  3. what packages to install, how to get vnc working, etc etc
  4. describe the limitations of running in Azure (sound not working? no gfx accel?)

Since the environment is exactly the same for everyone, it should be entirely possible to make a step-by-step guide that nails it :-)

Linux fails to boot after adding Kernel Flags

Distro: Xubuntu 19.04
Graphics: Intel UHD 620 (ASUS Zenbook UX330UAR)

After following the Guide Passthrough, adding the following to my kernel flags
iommu=pt intel_iommu=on vfio-pci.ids=8086:5917,1=8086:9d71
results in my kernel freezing around 3 seconds in. I'm not sure what debug files you need.
5917: GPU, 9d71: Sound Card

Getting rid of the kernel flags allowed the kernel to boot, but am I doing something wrong?

Might want to add the vfio-pci Module is loaded.

Could it be a missing kernel module or an incorrect one @foxlet ? Or an incompatibility with kernel 5.0?

spam in dmesg

this project is great but i'm getting a lot of spam in dmesg. could we fix this?

noob question

i did everything in the guide
got the other gpu passed through and working 👍
BUT
i cannot use my mouse and keyboard at all [stuck at clover]
tried passing them with
-device usb-host,hostbus=bus,hostaddr=addr
or
-device usb-host,hostbus=bus,hostport=port

they are disabled [i think passed] but then the gpu not working [not passed] :(
can you please guide me

qemu passthrough not starting when setting -vga to none

I had a similar issue at #9, where GPU passthrough were not working properly. When I run basic.sh, it will just launch QEMU monitor. The shell do not show any error messages.

lspci -nn | grep "VGA\|Audio"

00:1f.3 Audio device [0403]: Intel Corporation 200 Series PCH HD Audio [8086:a2f0]
21:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev e7)
21:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0]
41:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] [10de:1e07] (rev a1)
41:00.1 Audio device [0403]: NVIDIA Corporation TU102 High Definition Audio Controller [10de:10f7] (rev a1)

/etc/default/grub

I must add video=efifb:off as my AMD GPU is primary GPU, unless I add efifb:off, I cannot pass it to VM.

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=789a866c-d2de-4759-bf0c-99f2c83ecfdd intel_iommu=on iommu=pt vfio-pci.ids=1002:67df,1002:aaf0 video=efifb:off"

lspci -v

21:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev e7) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
        Flags: fast devsel, IRQ 135, NUMA node 0
        Memory at dfe0000000 (64-bit, prefetchable) [size=256M]
        Memory at dff0000000 (64-bit, prefetchable) [size=2M]
        I/O ports at 7000 [size=256]
        Memory at b5e00000 (32-bit, non-prefetchable) [size=256K]
        Expansion ROM at b5e40000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: vfio-pci
        Kernel modules: amdgpu

41:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti
 Rev. A] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: Micro-Star International Co., Ltd. [MSI] TU102 [GeForce RTX 2
080 Ti Rev. A]
        Flags: bus master, fast devsel, latency 0, IRQ 134, NUMA node 0
        Memory at d7000000 (32-bit, non-prefetchable) [size=16M]
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Memory at d0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at b000 [size=128]
        [virtual] Expansion ROM at d8000000 [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

lsmod | grep vfio

vfio_pci               53248  0
irqbypass              16384  2 vfio_pci,kvm
vfio_virqfd            16384  1 vfio_pci
vfio_iommu_type1       28672  0
vfio                   32768  2 vfio_iommu_type1,vfio_pci

qemu config:

qemu-system-x86_64 \
    -enable-kvm \
    -m 8G \
    -machine q35,accel=kvm \
    -smp 4,cores=4 \
    -cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
    -device isa-applesmc,osk="$OSK" \
    -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
    -drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
    -device ich9-intel-hda -device hda-output \
    -usb -device usb-kbd -device usb-mouse \
    -netdev user,id=net0 \
    -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
    -device ich9-ahci,id=sata \
    -drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
    -device ide-hd,bus=sata.2,drive=ESP \
    -drive id=InstallMedia,format=raw,if=none,file=BaseSystem.img \
    -device ide-hd,bus=sata.3,drive=InstallMedia \
    -drive id=SystemDisk,if=none,file=OS.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk \
    -vga none \
    -device pcie-root-port,bus=pcie.0,multifunction=on,port=1,chassis=1,id=port.1 \
    -device vfio-pci,host=21:00.0,bus=port.1,multifunction=on,romfile=./amd.rom  \
    -device vfio-pci,host=21:00.1,bus=port.1,multifunction=on

I spend hours try to figure it out but no luck, any pointer would be greatly appreciated.

unable to find any master var store for loader

I can run hackintosh with ./basic.sh. But in virt-manager I can't run it. Get output:

Error starting domain: operation failed: unable to find any master var store for loader: ~/hackintosh/macOS-Simple-KVM/firmware/OVMF_CODE.fd

Error during installation

After the restart, installation fails with this error :

An error occurred while extracting files from the package “Core.pkg”.

Tried with more ram, another mac version but nothing seems to be working.

What is the workaround for this issue?

cannot open vfio file

get output

qemu-system-x86_64: -device vfio-pci,host=00:02.0,bus=port.1,multifunction=on: vfio 0000:00:02.0: failed to open /dev/vfio/1: No such file or directory

when trying to launch basic.sh

iPadOS 13 w/ sidecar limited by iMac 2009 - give option to set this and resolution of VM

Hi,

I have the newest iPad Pro 12.9" that should have sidecar support with the following list of newer Mac models:

Late 2015 27" iMac or newer
2017 iMac Pro
Mid 2016 MacBook Pro or newer
Late 2018 Mac mini or newer
Late 2018 MacBook Air or newer
Early 2016 MacBook or newer
2019 Mac Pro

Taken from https://www.macrumors.com/2019/06/06/macos-catalina-sidecar-limited-to-newer-macs

There is a few terminal hack workarounds that seem to work on baremetal Macs, but I've tried entering the same commands with no luck. I also have my Catalina VM on a bridged network with my iPad on the same 192.168.0.* domain, so there shouldn't be any NAT issues. It seems as though the settings for setting the iMac model number and VM resolution are set in one of the .fd binary files from the firmware directory, but I can't modify those easily. I've also attempted to run hexdump -C on both files and grep for the resolution and iMac ASCII string with no luck.

Unable to install OS X 10.7.

Hi i am trying to run ./jumpstart.sh --lion.
It downloads the dmg file but when i run ./basic.sh the version is 10.15 beta

qemu not starting up

These were my exact commands:
sudo pacman -S qemu python python-pip
./jumpstart.sh --mojave
qemu-img create -f qcow2 MyDisk.qcow2 64G
nano basic.sh (and then added):

-drive id=SystemDisk,if=none,file=MyDisk.qcow2 \
-device ide-hd,bus=sata.4,drive=SystemDisk \

[root@nzxtarch macOS-Simple-KVM-master]# ./basic.sh qemu-system-x86_64: if=none,file=mac.qcow2: drive with bus=0, unit=0 (index=0) exists

Virtual machine is not starting when script is executed. running an Arch linux 2019 vm build. Executing script from GUI terminal, xfce4 environment. The Arch instillation itself is running in a virtualbox on a windows 10 build

State minimum version of QEMU

The macOS installer doesn't fully boot with QEMU on Debian Stable (stretch), which makes me think that the version in the repos is too old. Would be good to know which version has the necessary fixes for booting.

ModuleNotFoundError: No module named ''click''

On ubuntu18.04, I tried to do
$ ./jumpstart.sh
to download OSX, but it said ModuleNotFoundError: No module named 'click'

But I already ran "pip install click" to install module 'click'

Installation cannot find SystemDisk

2019-06-19_21-06

The installation is not able to find the SystemDisk for installation?

Directory listing:

~/D/m/macOS-Simple-KVM ❯❯❯ ls -ltr
total 2089492
drwxr-xr-x 2 mark mark       4096 Jun 19 20:47 docs
drwxr-xr-x 2 mark mark       4096 Jun 19 20:47 firmware
drwxr-xr-x 3 mark mark       4096 Jun 19 20:47 tools
-rw-r--r-- 1 mark mark   13172736 Jun 19 20:47 ESP.qcow2
-rw-r--r-- 1 mark mark       1876 Jun 19 20:47 README.md
-rwxr-xr-x 1 mark mark        586 Jun 19 20:47 make.sh
-rwxr-xr-x 1 mark mark        909 Jun 19 20:47 jumpstart.sh
-rw-r--r-- 1 mark mark 2128310272 Jun 19 20:48 BaseSystem.img
-rw-r--r-- 1 mark mark     197632 Jun 19 20:49 macos.qcow2
-rwxr-xr-x 1 mark mark       1146 Jun 19 21:03 basic.sh

and the basic.sh:

~/D/m/macOS-Simple-KVM ❯❯❯ cat basic.sh
#!/bin/bash

OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VMDIR=$PWD
OVMF=$VMDIR/firmware
#export QEMU_AUDIO_DRV=pa
#QEMU_AUDIO_DRV=pa

qemu-system-x86_64 \
    -enable-kvm \
    -m 2G \
    -machine q35,accel=kvm \
    -smp 4,cores=2 \
    -cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
    -device isa-applesmc,osk="$OSK" \
    -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
    -drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
    -vga qxl \
    -device ich9-intel-hda -device hda-output \
    -usb -device usb-kbd -device usb-mouse \
    -netdev user,id=net0 \
    -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
    -device ich9-ahci,id=sata \
    -drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
    -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=macos.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk

The log during startup:

~/D/m/macOS-Simple-KVM ❯❯❯ ./basic.sh 
WARNING: Image format was not specified for 'BaseSystem.img' and probing guessed raw.                            
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.                                        
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]               
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]              
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]               
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]              
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]               
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]              
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]               
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.0DH:EAX.xgetbv1 [bit 2]    

Passthrough iPhone from Linux Host

Got Mojave up and running no problem with this repository!

Unfortunately now I'm struggling to get my iPhone to passthrough via USB. When I attach the iPhone to Qemu, the host assigns the phone a new usb address and reconnects to it. It seems like this has been a problem for a while.

People used to be able to work around it by modifying the udev rules for usbmuxd:
https://www.zeitgeist.se/2015/06/28/mount-an-iphone-inside-a-kvm-guest-by-disabling-usbmuxd/

Unfortunately as gnome / linux has gotten more sophisticated, it seems like more and more things are preempting the VM from grabbing the device:
https://askbot.fedoraproject.org/en/question/102519/iphone-redirect-into-kvm-windows-7-guest/

A lot of people have recommended getting a separate USB controller PCI card and passing that through to the VM, but I want to try to sort it out in software first.

Wanted to see if anybody here has any suggestions or has had any success connecting such a device to their VM.

Thanks!

[Docs] Required disk space?

Hi there, roughly how much free disk space do I need for an installation? I see it recommends creating a 64GB qcow, but what would the bare minimum be? And what about the MacOS installer image download size?

qemu passthrough not starting when setting -vga to none

So I've installed High Sierra successfully, installed nvidias web driver and shut down the vm.
Now I tried to passthrough my 1080ti, but without success so far. Qemu just shows up with a help screen. qemu
As soon as I change -vga none to -vga qxl, it boots up again, but without my graphics card passed through.

Terminal while vm is running:

[max@manjaro macOS-Simple-KVM]$ sudo ./basic.sh 
WARNING: Image format was not specified for 'BaseSystem.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

lspci -nn | grep "VGA|Audio"

00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Desktop) [8086:3e92]
00:1f.3 Audio device [0403]: Intel Corporation 200 Series PCH HD Audio [8086:a2f0]
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] [10de:1b06] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP102 HDMI Audio Controller [10de:10ef] (rev a1)

My grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt intel_iommu=on vfio-pci.ids=10de:1b06,10de:10ef"

This is my basic.sh file:

#!/bin/bash

OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VMDIR=$PWD
OVMF=$VMDIR/firmware
#export QEMU_AUDIO_DRV=pa
#QEMU_AUDIO_DRV=pa

qemu-system-x86_64 \
    -enable-kvm \
    -m 28G \
    -machine q35,accel=kvm \
    -smp 8,cores=4 \
    -cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
    -device isa-applesmc,osk="$OSK" \
    -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
    -drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
    -vga none \
    -device ich9-intel-hda -device hda-output \
    -usb -device usb-kbd -device usb-tablet \
    -netdev user,id=net0 \
    -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
    -device ich9-ahci,id=sata \
    -drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
    -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=MyDisk.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk \
    -device intel-iommu
    -device ioh3420,bus=pcie.0,multifunction=on,port=1,chassis=1,id=port.1 \
    -device vfio-pci,host=01:00.0,bus=port.1,multifunction=on,romfile=vbios_patched.rom \
    -device vfio-pci,host=01:00.1,bus=port.1 \

This is my first qemu vm, so help is very much appreciated

Installation instructions should mention qemu-utils for Debian/Ubuntu

I tried running the instructions for a START1-M instance at Scaleway

$ qemu-img create -f qcow2 MyDisk.qcow2 64G

Command 'qemu-img' not found, but can be installed with:

sudo apt install qemu-utils

Also, the KVM prerequisite can be installed and configured as described here, and here, however Ubuntu 18.04 and first need to install vertinst:

sudo apt install qemu qemu-kvm virt-manager virtinst bridge-utils cpu-checker
kvm-ok  # verify the cpu supports KVM 

My installation failed, even though kvm-ok indicated that the CPU was ok:

$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

$ sudo ./basic.sh
Unable to init server: Could not connect: Connection refused
WARNING: Image format was not specified for 'BaseSystem.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi1 [bit 3]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi2 [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.0DH:EAX [bit 2]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi1 [bit 3]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi2 [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.0DH:EAX [bit 2]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi1 [bit 3]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi2 [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.0DH:EAX [bit 2]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi1 [bit 3]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi2 [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.0DH:EAX [bit 2]

I stopped here, perhaps this VM is unsuitable.

Losing input device randomly

I am using the keyboard and trackpad on my laptop, and experiencing random input device freezes that don't go away unless I turn off the VM.

The mouse cursor and keyboard would suddenly not respond anymore. The guest OS seems to be running normally, expect that now I don't have no control over it, other than being able to monitor the screen. I can still escape mouse and keyboard with ctrl-alt to the host OS, but recapturing them in the guest OS also doesn't solve this issue.

CPU: i5-7200U
Guest: Mojave
Host: Ubuntu Mate 18.04.2

All default settings in the basic.sh script.

Would be glad to provide logs, but I'm very new to QEMU/KVM, and not sure which log is needed.

dmg2img error while loading shared libraries: libbz2.so.1.0

dmg2img:error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory

Had this error in the progresses of converting the BaseSystem.dmg to BaseSystem.img using Clear Linux as a host.

Fixed by replacing macOS-Simple-KVM/tools/dmg2img

from dmg2img

newbie question: Broadcom?

let's say i wanted to use a RPi 4 (Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz) is that a no-go? sorry for the lack of clue.

virt-manager config omits MyDisk.qcow2

I followed your instructions for setting up virt-manager, pressed play and found that MacOS could not install as qcow2 you had me create (MyDisk.qcow2) was not attached to the guest vm.

I added it via the virt-manager interface and now all is installing as hoped :-)

many thanks.

Jules

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.