Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/godmode2k/docker-macos
macOS in Docker
https://github.com/godmode2k/docker-macos
docker macos macosx osx qemu-kvm x11
Last synced: 16 days ago
JSON representation
macOS in Docker
- Host: GitHub
- URL: https://github.com/godmode2k/docker-macos
- Owner: godmode2k
- License: apache-2.0
- Created: 2024-10-23T06:29:16.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2024-10-25T03:38:24.000Z (20 days ago)
- Last Synced: 2024-10-26T17:12:10.238Z (19 days ago)
- Topics: docker, macos, macosx, osx, qemu-kvm, x11
- Language: Shell
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker-macOS
Summary
----------
> Run macOS in Docker
>
> source-based: https://github.com/sickcodes/Docker-OSX
> USE THIS AT YOUR OWN RISK.Environment
----------
> build all and tested on GNU/LinuxGNU/Linux: Ubuntu 20.04_x64 LTS
Run
----------
```sh
// Docker installation
https://docs.docker.com/engine/install/// Arch
$ sudo pacman -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison iptables-nft edk2-ovmf// Ubuntu
$ sudo apt-get install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools// CentOS, RHEL, Fedora
$ sudo yum install libvirt qemu-kvm// Then, enable libvirt and load the KVM kernel module
$ sudo systemctl enable --now libvirtd
$ sudo systemctl enable --now virtlogd
$ echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
$ sudo modprobe kvm// macOS Sonoma (14)
$ sudo bash run_docker_macos.sh---------------------------------
Issues
---------------------------------
1. infinite boot loop
- USE this options: {
-e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e RAM=4
}2. shared directroy: macfuse, sshfs does not work (macOS in docker (QEMU))
- USE this options: {
-v "${SHARE}:/mnt/hostshare" \
-e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare"
}then, Open Terminal inside macOS and run the following command to mount the virtual file system
(macOS)$ sudo -S mount_9p hostshare
(macOS) Finder [menu: Go -> Computer] -> you can find 'hostshare'.3. Audio
- USE this options: {
--device /dev/snd \
-e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \-v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
or (logged in userid, not 'sudo' for root)
-v "/run/user/1000/pulse/native:/tmp/pulseaudio.socket" \-e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare -device intel-hda -device hda-output,audiodev=hda" \
-e NOPICKER=false \
}then,
source-based:
- https://github.com/MobCode100/Dastux/blob/main/VoodooHDA-QEMU-KVM.md
- https://sourceforge.net/projects/voodoohda (download: latest version, VoodooHDA.kext-v301.zip)Disable System Integrity Protection (SIP)
(macOS) boot menu > select Recovery partition: Go to Utilities > Terminal
(macOS)$ csrutil status // you can skip below command if result like this 'System Integrity Protection status: disabled' or 'Kext Signing: disabled'
(macOS)$ csrutil disable
or
(macOS)$ csrutil enable --without kext
(macOS) reboot macOShttps://sourceforge.net/projects/voodoohda: download VoodooHDA, VoodooHDA.kext-v301.zip (latest version)
(macOS)$ sudo cp -R Downloads/VoodooHDA.kext /Library/Extensions
Shortly after that, a popup will appear.For Ventura:
- you might need to load the kext manually by entering cmd for the popup message to appear.
- (macOS)$ sudo kextutil -v /Library/Extensions/VoodooHDA.kext(macOS) Go to System Settings > Security & Privacy > Security section
(macOS) select 'App Store and identified developers' > Click the button 'Details...', enter your password
(macOS) check the 'Unidentified - VoodooHDA - Updated', click OK and restart.Install Homebrew: https://brew.sh/
(macOS)$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install Pulseaudio
(macOS)$ brew install pulseaudio
(macOS)$ brew services start pulseaudio
(macOS)$ brew services stop pulseaudio```