Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sickcodes/Docker-OSX #54

Open
medophin opened this issue Apr 22, 2023 · 0 comments
Open

sickcodes/Docker-OSX #54

medophin opened this issue Apr 22, 2023 · 0 comments
Assignees
Labels

Comments

@medophin
Copy link

medophin commented Apr 22, 2023

活動連結:
https://spotvirtual.com/invite/iostaipei-20ea5d5ecbafb5b9-ElVJEE7ZGI

活動時間:
週二, 2023/4/25 20:00

FB link:
https://www.facebook.com/events/1168880770416990

Demo Project:
https://github.com/sickcodes/Docker-OSX

Description:
如何用 sickcodes/Docker-OSX 建立環境
#虛擬化 #容器


sickcodes/Docker-OSX

https://github.com/sickcodes/Docker-OSX
使用黑蘋果 Hackintosh osx-kvm docker-osx可能違反相關用戶協議,除非你用於資安研究
Disclaimer
https://sick.codes/is-hackintosh-osx-kvm-or-docker-osx-legal/


opencore+qemu+docker+OSX = Docker-OSX

  • opencore
  • OSX-KVM
    • qemu (quick emulator)
    • kvm (Kernel-based Virtual Machine)
  • docker

support k8s


OSX-KVM - 1/2

https://github.com/kholia/OSX-KVM

  • A modern Linux distribution. E.g. Ubuntu 22.04 LTS 64-bit or later.
  • QEMU >= 6.2.0
  • A CPU with Intel VT-x / AMD SVM support is required (grep -e vmx -e svm /proc/cpuinfo)
  • A CPU with SSE4.1 support is required for >= macOS Sierra
  • A CPU with AVX2 support is required for >= macOS Mojave

OSX-KVM - 2/2

  • install tools
sudo apt-get install qemu uml-utilities virt-manager git \
    wget libguestfs-tools p7zip-full make dmg2img -y
  • Fetch macOS installer. create BaseSystem(macOS installer)
dmg2img -i BaseSystem.dmg BaseSystem.img
  • create hdd qemu-img create -f qcow2 mac_hdd_ng.img 128G
  • boot ./OpenCore-Boot.sh

why Docker

  • share cpu resource
  • Infrastructure-as-code,IaC =>version control
  • same env , easy to CI/CD

My Env

Windows11 wsl2
https://github.com/sickcodes/Docker-OSX#id-like-to-run-docker-osx-on-windows
ref :
WSL+Docker+Apple MacOS X Big Sur installation in Windows 11 - YouTube


Docker-OSX WSL step 1/2

  • install docker
  • C:/Users/<Your_Name>/.wslconfig  add nestedVirtualization=true
[wsl2]
nestedVirtualization=true
  • check kvm , kvm-ok
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/\
    osx-serial-generator/master/config-custom.plist' \
    sickcodes/docker-osx:ventura

Docker-OSX WSL step 2/2

  • erase QEMU HARDDISK MEDIA
  • reinstall macOS
  • vnc
    • vnc changepassword ${pswd}

modify RAM setting

xcode simulator need more than 4GB ram to start
sickcodes/Docker-OSX#197

  • backup previous containers mac_hdd_ng_auto.img
  • use sickcodes/docker-osx:naked
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng_auto.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    sickcodes/docker-osx:naked


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants