Skip to content

Instantly share code, notes, and snippets.

@citruz
Last active October 24, 2024 02:17
Show Gist options
  • Save citruz/9896cd6fb63288ac95f81716756cb9aa to your computer and use it in GitHub Desktop.
Save citruz/9896cd6fb63288ac95f81716756cb9aa to your computer and use it in GitHub Desktop.
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6

07.03.2021: Updated instructions to apply patch cleanly

01.06.2021: Updated instructions for Xcode 12.4 and above

Building QEMU

  • Clone QEMU and checkout version 5.2.0
git clone https://github.com/qemu/qemu
cd qemu
git checkout v5.2.0
curl https://patchwork.kernel.org/series/418581/mbox/ | git am --exclude=MAINTAINERS
  • If you use Xcode 12.4 or above, you will need another patch to fix the QEMU build. Download xcode-12-4.patch from below and apply it using
git apply xcode-12-4.patch
  • Install the ARM version of the brew package manager. The (recommended) installation via Rosetta will cause problems when building QEMU. Even if brew screams at you at every launch that this is not a supported configuration I had no major problems so far. You can follow this guide (see the "Multiple Homebrews" section).
  • Install required packages for building:
brew install libffi gettext pkg-config autoconf automake pixman
  • Run the following commands to build qemu:
mkdir build
cd build
../configure --target-list=aarch64-softmmu --disable-gnutls
make -j8
sudo make install
  • For some reason, the qemu binary is modified during make install. You need to resign it with the correct entitlements, otherwise you will get an Unknown Error:
sudo codesign --entitlements /path/to/qemu/accel/hvf/entitlements.plist --force -s - `which qemu-system-aarch64`

Create Ubuntu VM

qemu-img create -f qcow2 disk.qcow2 10G
  • Create an empty file for persisting UEFI variables:
dd if=/dev/zero conv=sync bs=1m count=64 of=ovmf_vars.fd
  • Run qemu with the following command-line arguments:
qemu-system-aarch64 \
    -accel hvf \
    -m 2048 \
    -cpu cortex-a57 -M virt,highmem=off  \
    -drive file=/usr/local/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on \
    -drive file=ovmf_vars.fd,if=pflash,format=raw \
    -serial telnet::4444,server,nowait \
    -drive if=none,file=disk.qcow2,format=qcow2,id=hd0 \
    -device virtio-blk-device,drive=hd0,serial="dummyserial" \
    -device virtio-net-device,netdev=net0 \
    -netdev user,id=net0 \
    -vga none -device ramfb \
    -cdrom /path/to/ubuntu.iso \
    -device usb-ehci -device usb-kbd -device usb-mouse -usb \
    -monitor stdio
  • You should be able to install Ubuntu as normal
  • If you want a desktop environment, you can install it using sudo apt-get install ubuntu-desktop

Create Windows VM

  • Download Windows for ARM from here
  • Create an empty file for persisting UEFI variables:
dd if=/dev/zero conv=sync bs=1m count=64 of=ovmf_vars.fd
  • For Windows, we need to replace the VirtIO block device with something that is supported natively by the OS. Otherwise, the command-line is almost unchanged
  • You may want to pass multiple cores to the VM using -smp X:
qemu-system-aarch64 \
    -accel hvf \
    -m 2048 -smp 2 \
    -cpu cortex-a72 -M virt,highmem=off  \
    -drive file=/usr/local/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on \
    -drive file=ovmf_vars.fd,if=pflash,format=raw \
    -serial telnet::4444,server,nowait \
    -drive if=none,file=Windows10_InsiderPreview_Client_ARM64_en-us_20231.VHDX,format=vhdx,id=hd0,cache=writethrough \
    -device nvme,drive=hd0,serial="dummyserial" \
    -nic user,model=virtio \
    -vga none -device ramfb \
    -device usb-ehci -device usb-kbd -device usb-mouse -usb \
    -monitor stdio

Limitations

Networking on Windows

Windows does not support VirtIO network interfaces out of the box. To get it working, you need to install additional drivers. See this gist for a guide (be sure to use version 0.1.190 instead of 0.1.185)

Resolution

The resolution is set to 800x600 by default. To change it, hit Esc at the immediately after starting the VM, while you see the tianocore logo, to get into the OVMF config menu. Choose Device Manager -> OVMF Platform Configuration -> Change Preferred -> Select 1024x768 -> Commit Changes and Exit -> Esc -> Reset.

Tweaks

Port Forwarding

Proper NAT networking is currently not possible with QEMU due to the lack of tap devices in macOS Big Sur. If you just want to be able to connect to a port on the VM (e.g. for SSH or RDP), you can configure QEMU to forward a local port to the VM:

    -nic user,model=virtio,hostfwd=tcp:127.0.0.1:3389-0.0.0.0:3389 \

In this case the port for RDP is forwarded so that I can connect to the VM at localhost:3389. The same for Ubuntu/SSH:

    -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-0.0.0.0:22 \

Disk Snapshots

Some users experience a random filesystem corruptions when booting Windows which can be avoided with the cache=writethrough for the hard drive. You can also perform disk snapshots to save the state of the hard disk at a certain point in time and restore it later. To do this, shut the VM down and create a new disk with your original image as the backing file:

qemu-img create -b Windows10_InsiderPreview_Client_ARM64_en-us_20231.VHDX -F vhdx -f qcow2 disk.qcow2

Now, adjust the -drive parameter so that QEMU boots from your new image:

    -drive if=none,file=disk.qcow2,format=qcow2,id=hd0,cache=writethrough \

If something goes wrong you can now delete disk.qcow2 and recreate it using the same commmand to back to the original state.

diff --git a/Makefile b/Makefile
index bcbbec71a1..8b75085fa5 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ x := $(shell rm -rf meson-private meson-info meson-logs)
endif
# 1. ensure config-host.mak is up-to-date
-config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
+config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/QEMU_VERSION
@echo config-host.mak is out-of-date, running configure
@if test -f meson-private/coredata.dat; then \
./config.status --skip-meson; \
@@ -204,7 +204,7 @@ clean: recurse-clean
rm -f TAGS cscope.* *.pod *~ */*~
rm -f fsdev/*.pod scsi/*.pod
-VERSION = $(shell cat $(SRC_PATH)/VERSION)
+VERSION = $(shell cat $(SRC_PATH)/QEMU_VERSION)
dist: qemu-$(VERSION).tar.bz2
diff --git a/QEMU_VERSION b/QEMU_VERSION
new file mode 100644
index 0000000000..5214c0b8b9
--- /dev/null
+++ b/QEMU_VERSION
@@ -0,0 +1 @@
+5.2.0
diff --git a/VERSION b/VERSION
deleted file mode 100644
index 5214c0b8b9..0000000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-5.2.0
diff --git a/meson.build b/meson.build
index 2dc66ae930..a8f8a02b3f 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project('qemu', ['c'], meson_version: '>=0.55.0',
default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_colorout=auto'] +
(meson.version().version_compare('>=0.56.0') ? [ 'b_staticpic=false' ] : []),
- version: run_command('head', meson.source_root() / 'VERSION').stdout().strip())
+ version: run_command('head', meson.source_root() / 'QEMU_VERSION').stdout().strip())
not_found = dependency('', required: false)
if meson.version().version_compare('>=0.56.0')
@zoain-it
Copy link

How I use sound

@sebdanielsson
Copy link

With QEMU 6.0 now released, anyone got an idea which patches are now included and which are still missing? A list would be nice 👍

@Lunaticf
Copy link

Lunaticf commented May 2, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t  mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
                                                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
  ^````

use the instruction...dont know why compile error

@zoain-it
Copy link

zoain-it commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````

use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

@Lunaticf
Copy link

Lunaticf commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

@zoain-it
Copy link

zoain-it commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

Just modify the name of the VERSION file under qemu, and he read the one include when compiling. So https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff

@Lunaticf
Copy link

Lunaticf commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

Just modify the name of the VERSION file under qemu, and he read the one include when compiling. So https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff

change the �VERSION file to QEMU_VERSION still the same error....

@zoain-it
Copy link

zoain-it commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

Just modify the name of the VERSION file under qemu, and he read the one include when compiling. So https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff

change the �VERSION file to QEMU_VERSION still the same error....

Did you apply all the changes in that patch?

@Lunaticf
Copy link

Lunaticf commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

Just modify the name of the VERSION file under qemu, and he read the one include when compiling. So https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff

change the �VERSION file to QEMU_VERSION still the same error....

Did you apply all the changes in that patch?

just did this above
curl https://patchwork.kernel.org/series/418581/mbox/ | git am --exclude=MAINTAINERS
make me crazy

@zoain-it
Copy link

zoain-it commented May 3, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

Just modify the name of the VERSION file under qemu, and he read the one include when compiling. So https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff

change the �VERSION file to QEMU_VERSION still the same error....

Did you apply all the changes in that patch?

just did this above
curl https://patchwork.kernel.org/series/418581/mbox/ | git am --exclude=MAINTAINERS
make me crazy

On this basis, just merge https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff.

@wintifrosch
Copy link

wintifrosch commented May 12, 2021

building qemu failed. full log on my dropbox

...
admin@Mac-mini-von-Admin qemu % mkdir build
cd build
../configure --target-list=aarch64-softmmu --disable-gnutls
make -j8
sudo make install
...
[830/2393] Compiling C++ object libcommon.fa.p/disas_libvixl_vixl_utils.cc.o
FAILED: libcommon.fa.p/disas_libvixl_vixl_utils.cc.o 
[830/2393] Compiling C++ object libcommon.fa.p/disas_libvixl_vixl_utils.cc.o
FAILED: libcommon.fa.p/disas_libvixl_vixl_utils.cc.o 
c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -I../slirp -I../slirp/src -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.2/include -I/opt/homebrew/Cellar/glib/2.68.2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.2/include/gio-unix-2.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/admin/qemu/tcg/aarch64 -iquote . -iquote /Users/admin/qemu -iquote /Users/admin/qemu/accel/tcg -iquote /Users/admin/qemu/include -iquote /Users/admin/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_utils.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_utils.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_utils.cc.o -c ../disas/libvixl/vixl/utils.cc
In file included from ../disas/libvixl/vixl/utils.cc:27:
In file included from /Users/admin/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.0
^
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
make: *** [run-ninja] Error 1
admin@Mac-mini-von-Admin build % 

@mateuszdrab
Copy link

mateuszdrab commented May 18, 2021

c++ -Ilibcommon.fa.p -I. -I.. -I../capstone/include/capstone -I../dtc/libfdt -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/jpeg/9d/include -I/opt/homebrew/Cellar/libffi/3.3_3/include -I/opt/homebrew/Cellar/glib/2.68.1/include -I/opt/homebrew/Cellar/glib/2.68.1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.68.1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.68.1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libslirp/4.4.0_1/include/slirp -I/opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=gnu++11 -O2 -g -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -iquote /Users/lunaticf/qemu/tcg/aarch64 -iquote . -iquote /Users/lunaticf/qemu -iquote /Users/lunaticf/qemu/accel/tcg -iquote /Users/lunaticf/qemu/include -iquote /Users/lunaticf/qemu/disas/libvixl -MD -MQ libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -MF libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o.d -o libcommon.fa.p/disas_libvixl_vixl_a64_decoder-a64.cc.o -c ../disas/libvixl/vixl/a64/decoder-a64.cc
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:417:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:37:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:418:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:308:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:28:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/utils.h:31:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:309:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:668:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:83:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:205:
../version:1:1: error: expected unqualified-id
5.2.50
^
In file included from ../disas/libvixl/vixl/a64/decoder-a64.cc:29:
In file included from /Users/lunaticf/qemu/disas/libvixl/vixl/a64/decoder-a64.h:30:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/list:185:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:672:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:206:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/wchar.h:119:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:107:48: error: unknown type name 'mbstate_t'; did you mean '__mbstate_t'?
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:55:3: note: '__mbstate_t' declared here
} __mbstate_t;
^````
use the instruction...dont know why compile error

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3727099

thank you, install xcode is not working. I just want to install qemu on mac m1, tried so many solutions.

Just modify the name of the VERSION file under qemu, and he read the one include when compiling. So https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff

change the �VERSION file to QEMU_VERSION still the same error....

Did you apply all the changes in that patch?

just did this above
curl https://patchwork.kernel.org/series/418581/mbox/ | git am --exclude=MAINTAINERS
make me crazy

On this basis, just merge https://github.com/knazarov/homebrew-qemu-virgl/blob/master/Patches/qemu-version-v01.diff.

I merged this patch along with the two patches from https://arstechnica.com/civis/viewtopic.php?f=19&t=1473419 to compile a qemu capable of running x86 on m1 but I get stuck at the following error:

../target/i386/hvf/vmx.h:162:5: note: did you mean 'hv_vcpu_run'?

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Hypervisor.framework/Headers/hv_vcpu.h:238:1: note: 'hv_vcpu_run' declared here
hv_vcpu_run(hv_vcpu_t vcpu);
^
In file included from ../target/i386/hvf/x86_task.c:17:
../target/i386/hvf/vmx.h:165:34: error: unknown type name 'hv_vcpuid_t'; did you mean 'hv_vcpu_t'?
static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
^~~~~~~~~~~
hv_vcpu_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Hypervisor.framework/Headers/hv_vcpu_types.h:37:18: note: 'hv_vcpu_t' declared here
typedef uint64_t hv_vcpu_t;
^
In file included from ../target/i386/hvf/x86_task.c:17:
../target/i386/hvf/vmx.h:173:5: error: implicit declaration of function 'hv_vcpu_invalidate_tlb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
hv_vcpu_invalidate_tlb(vcpu);
^
../target/i386/hvf/vmx.h:174:5: error: implicit declaration of function 'hv_vcpu_flush' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
hv_vcpu_flush(vcpu);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

That means the SDK version is different?

@ihsakashi
Copy link

@fishphhd I've got a working Libvirt solution. In your case, you need to add -machine accel=hvf,highmem=off. I opened a repo, https://github.com/ihsakashi/VM . Refer to that.

@nrjdalal
Copy link

nrjdalal commented Jun 6, 2021

Installation method above is using QEMU v5.2.0 and Patch Series v6. Also code is signed manually and needs patching for Xcode.

The method above bring a lot redundancy as of June 2021.

Best practice for QEMU installation as of now is given below.

QEMU Silicon Mac Installation

Changelog -

  • QEMU v5.2.0 -> v6.0.0
  • HVF Patch Series v6 -> v8
  • Removes redundant Xcode patching
  • Removes redundant code signing

The link above also provides one command installer.

@nrjdalal
Copy link

nrjdalal commented Jun 6, 2021

Those of you, still having issues installing QEMU, can look into one click installer at the provided link. Be sure to uninstall any instances of QEMU that are installed using brew.

QEMU Silicon Mac Installation

@ywiyogo
Copy link

ywiyogo commented Jul 18, 2021

I also did as explained and getting

qemu-system-aarch64: -accel hvf: invalid accelerator hvf

I also did the resigning as explained
@faaaaabi & @kripsy

You missed the section:

sudo codesign --entitlements /path/to/qemu/accel/hvf/entitlements.plist --force -s - `which qemu-system-aarch64`

If the command hangs, try to run which qemu-system-aarch64 first, and copy the path manually.

@KvizadSaderah
Copy link

KvizadSaderah commented Aug 10, 2021

sudo codesign --entitlements /path/to/qemu/accel/hvf/entitlements.plist --force -s - `which qemu-system-aarch64`

If the command hangs, try to run which qemu-system-aarch64 first, and copy the path manually.

Hi! Even after

sudo codesign --entitlements /path/to/qemu/accel/hvf/entitlements.plist --force -s - `which qemu-system-aarch64`

it still give error qemu-system-aarch64: -accel hvf: invalid accelerator hvf

@kiranchavala
Copy link

Facing the same issue, any updates

@kassiansun
Copy link

kassiansun commented Oct 12, 2021

qemu 6.1 from homebrew now supports hvf natively, everything works on my m1 machine now :)

@m-bers
Copy link

m-bers commented Oct 17, 2021

@kassiansun I tried the 6.1 homebrew release on my M1 Macbook Air and cannot get networking working with -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-0.0.0.0:22 \

@kassiansun
Copy link

@kassiansun I tried the 6.1 homebrew release on my M1 Macbook Air and cannot get networking working with -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-0.0.0.0:22 \

Did you see any error message? My guess is you're running another VM/application binding to host port tcp:127.0.0.1:2222.

@m-bers
Copy link

m-bers commented Nov 1, 2021

lsof -i tcp:2222 on the host gives no output, so I assume the port is good to go.
Within the VM, I get some really weird behavior. This is what a ping looks like (I get the same results pinging a host on my local network as well):

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=0 ttl=255 time=5324017251240566 ms
wrong data byte #16 should be 0x10 but was 0x0
#16	0 1 0 1 84 f9 7f 61 0 0 0 0 a5 a6 a 0 0 0 0 0 10 11 12 13 14 15 16 17 18 19 1a 1b 
#48	1c 1d 1e 1f 20 21 22 23 

Whereas if I use a different binary (like the one from https://github.com/canonical/multipass), everything works fine, and I can even use

-nic vmnet-macos,mode=shared,model=virtio-net-pci \

to give the VM it's own NAT IP address that I can ssh to directly without port forwarding.

@brandonros
Copy link

brandonros commented Dec 20, 2021

$ uname -a
Darwin Brandons-MacBook-Air.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64

$ qemu-system-aarch64 --version # from brew
QEMU emulator version 6.2.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

qemu-system-aarch64 \
    -accel hvf \
    -m 2048 -smp 2 \
    -cpu cortex-a72 -M virt,highmem=off  \
    -drive file=/opt/homebrew/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on \
    -drive file=/tmp/ovmf_vars.fd,if=pflash,format=raw \
    -serial telnet::4444,server,nowait \
    -drive file=~/Downloads/Windows11_InsiderPreview_Client_ARM64_en-us_22523.VHDX,if=none,format=vhdx,id=hd0,cache=writethrough \
    -device nvme,drive=hd0,serial="dummyserial" \
    -nic user,model=virtio \
    -vga none -device ramfb \
    -device usb-ehci -device usb-kbd -device usb-mouse -usb \
    -monitor stdio

image

Stuck on this TianoCore loading screen.

@Baekalfen
Copy link

@brandonros I was stuck at the same place. I realized I was trying to load an old x86 .iso. Switching to Fedora in aarch64 worked.

@santiagorodpeya
Copy link

Hi,

I am not able to run the qemu on my MacBook Pro (13-inch, M1, 2020).
When I tried to run qemu command always fails. I created the two previous disk mentioned on the guide.
Screenshot at May 30 11-08-39

Any idea?

Regards,

@narcis-serbanescu
Copy link

narcis-serbanescu commented Sep 2, 2022

@kassiansun I tried the 6.1 homebrew release on my M1 Macbook Air and cannot get networking working with -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-0.0.0.0:22 \

Maybe it is too late, but recently I had the same issue; to solve it, I use:

-net nic,model=rtl8139 \
-net user,hostfwd=tcp::2222-:22 \

@MisterMiles
Copy link

@brandonros I was stuck at the same place. I realized I was trying to load an old x86 .iso. Switching to Fedora in aarch64 worked.

I face the same problem, but don't know what you exactly mean by this: what exactly do I have to do, in order to make it work. Can you elaborate? :)

@Baekalfen
Copy link

@brandonros I was stuck at the same place. I realized I was trying to load an old x86 .iso. Switching to Fedora in aarch64 worked.

I face the same problem, but don't know what you exactly mean by this: what exactly do I have to do, in order to make it work. Can you elaborate? :)

I simply had to pick the right ISO-image. I had picked one for x86, and not ARM (aarch64).

@narendersaini32
Copy link

How to run android using qemu on m1 mac?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment