Install deps, configure kvm and reboot:
yay -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison edk2-ovmf xorg-xhost
sudo systemctl enable libvirtd.service
sudo systemctl enable virtlogd.service
echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
sudo modprobe kvm
sudo reboot
Enable xhost:
xhost +
To make this change persistent you need to add it to your shell rc
file. Eg:
xhost + >/dev/null
Run docker:
docker run -it \
--name macos \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
sickcodes/docker-osx:latest
Follow the instructions on https://github.com/sickcodes/Docker-OSX#additional-boot-instructions (like below):
-
Boot the macOS Base System
-
Click
Disk Utility
-
Erase the BIGGEST disk (around 200gb default), DO NOT MODIFY THE SMALLER DISKS (if you can't click
erase
, you may need to reduce the disk size by 1kb) and close the window -
Click
Reinstall macOS
Whenever you see the message below, run docker restart macos
to restart QEMU and continue the installation.
After running QEmu, go to View
menu and select Grab on Hover
so the window meta key
will work as the command
Mac key.
If you have a keyboard with ABNT2 layout, make sure you select the type
as ANSI
and not as ISO
for all key to work properly.
To do so, go to System Settings
-> Change Keyboard Type
and follow the instructions
until you see the screen below:
Click Done
to confirm.