Skip to content

Instantly share code, notes, and snippets.

@vinhlq
Last active September 29, 2020 03:24
Show Gist options
  • Save vinhlq/aabe195613d471910b380acfe33f8919 to your computer and use it in GitHub Desktop.
Save vinhlq/aabe195613d471910b380acfe33f8919 to your computer and use it in GitHub Desktop.
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 15
---
title: OSX-KVM: Cài đặt máy ảo OSX cho linux
tags: ['osx', 'kvm', 'linux']
status: draft
---
  1. Install QEMU

    • Ubuntu

    sudo apt-get install qemu uml-utilities virt-manager dmg2img git wget libguestfs-tools virt-viewer

  2. Chuẩn bị script

  3. Download MacOS base image

    • Run script

      ./fetch-macOS.py

      #    ProductID    Version    Build   Post Date  Title
      1    061-26578    10.14.5  18F2059  2019-10-14  macOS Mojave
      2    061-26589    10.14.6   18G103  2019-10-14  macOS Mojave
      3    041-91758    10.13.6    17G66  2019-10-19  macOS High Sierra
      4    041-88800    10.14.4  18E2034  2019-10-23  macOS Mojave
      5    041-90855    10.13.5   17F66a  2019-10-23  Install macOS High Sierra Beta
      6    061-44345    10.15.2   19C39d  2019-11-15  macOS Catalina Beta
      7    061-44387    10.15.3    19D76  2020-01-28  macOS Catalina
      
      Choose a product to download (1-7): 
      
    • Lựa chọn phiên bản MacOS

  4. Convert base image

    qemu-img convert BaseSystem.dmg -O raw BaseSystem.img

    Hoặc

    dmg2img BaseSystem.dmg BaseSystem.img

  5. Tạo HDD ảo cài đặt OSX

    • Nếu phân vùng chứa hdd ảo định dạng btrfs nên dùng raw format

      truncate -s 128G mac_hdd_ng.img

    • Nếu phân vùng chứa hdd ảo định dạng khác( ext, xfs, ...)

      qemu-img create -f qcow2 mac_hdd_ng.img 128G

  6. Cài đặt OSX

    • OSX Catalina

      • Get script: qemu-osx-catalina

      • Run script

        boot-macOS-Catalina-raw-hdd.sh

        hoặc

        boot-macOS-Catalina-raw-hdd.sh

      • Remote: Sử dụng tool Remote Viewer(package virt-viewer)

      • URI: vnc://127.0.0.1:5900

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