Black Apple filled pit (VMware install MacOS) - modify the source code version of the patch Unlocker

Busy recently suddenly having a bit of something to toss about, so with Apple's conference eyeing his hand iPhone, but also to get hold of Mac Laigao IOS. So there is this story filled pit.

Why should modify the source code patch:

  1. No longer hard to find and download files drawn.iso, although I will tell you where you can download the official website ;
  2. Encounter a mistake, since it is engaged in python, that of course, have their own hands hands.

1. Before installing

\ 1. Installation Environment

  • Windows 10
  • VMware Pro 14

\ 2. System hardware configuration

  • 16G or more RAM recommended
  • Set aside more than 40G hard disk
  • CPU recommended above i5 8th

\ 3. Install MacOS essential package

  • VMware Pro 14

One number to fill the pit : Unlocker latest version v3.0.2 version supports only VMware 12 to 14 (terminal output, I used before is always reported 15 various wrong, so we found this hole).

Be sure to use the Pro version, Player version installed black apple unstable, often automatically restart ..

VMware pro 14 download the official website address

  • MacOS system image (about the size 6G)
  1. CDR [Recommended], lazy installation package, as easy to install, less trouble.

No. II fill the pit : I tried to use the tools God horse HFSExplorer dmg cdr turn, the results of that tool does not work, so they always pop up error box search download other people's hair cdr package to install.

  1. dmg, original mirror, no installation tried this format, fill the pit do not understand
  2. ISO, you can use UltraISO tool dmg format into iso format, and then install it, but half-way encounter boot problems, so for the installation in cdr
  • MacOS Unlocker for VMware, 简称 Unlocker

VMware allows select Mac systems installed patches

Download Unlocker in the github

Select the first unlocker302.zip windows can download

2. Install

\ 1. Install VMware Pro 14, and registration

Webcast on here a lot, installation is not complicated, the process is very smooth

Sign up depends on the person, the usual way is to register online search key, keys such as:
ZC5XK-A6E0M-080XQ-04ZZG-YF08D;
ZY5H0-D3Y8K-M89EZ-AYPEG-MYUA8.

\ 2 Install Unlocker

  1. Use the super administrator to run cmd.

In the task bar search box, search cmd, then right-click cmd to run with administrator

Unzip the downloaded unlocker, and cd to the directory in the just opened terminal

Implementation of win-install.cmd

  1. It is given a terminal

See terminal has Successfully, Finished and other words, the first not happy too early, because that whole sentence is negative.

Error contents are:

  • ***.*** File permissions problem

    Which file permissions of a problem, to find it and give it permission to add it.

    Steps: Right-click and select Properties -> Select the Security tab -> click on Edit -> Select Everyone (group or user name) -> Allow Full Control.

  • I did not find the drawn*.*file

    Looked at the terminal is accessed http://***only after the report links errors, believed to be the result of access timeout retry a few times will not work, and then open the browser to access the link, the browser returns the result not found. Look ignorant force, simply pit father ah

    Fill the hole number three : solutions - recompile the modified source code packaged exe
    modify the file: gettools.py, complete modified code on the last, have Chinese notes.
    Ideas: access problem, then modify the links accessible; Because VMware Server identification UA, UA so camouflage
    packaging exe: python3.x need environment dependencies: requests, PyInstaller; packaging commands pyinstaller -F gettools.py
    replace gettools.exe file: the packaged exe, generated dist folder, found inside exe files, file replace unlocker gettools.exe folder

    NOTE: mounting order dependencies: pip3 install requests; pip3 install PyInstaller; Before packaging exe, and the need to open the terminal switch directory to directory files gettools.py.

\ 3. Install mac

  1. Run VMware and create a new virtual machine
  2. CD / DVD at select cdr file, and then start the virtual system
  3. Virtual system installation problems arising in the course
  • Virtual system startup, the virtual machine error problem:

Open the ***.vmxtext file, add smc.version = "0"configuration items

  • Installation disk problem:

Select Utilities on the menu bar -> select VMware hard disk -> click on the Erase button -> Enter a name to English

  1. Installation VMTools

Off mac, select VMware Pro installation darwn.iso (Unlocker generated file) directory in the CD / DVD at my installation directory is C:\Program Files (x86)\VMware\VMware Workstation

Power to open the disc on the desktop install, it is used to install VMTools drawn.iso plug.

\ 4. Screen size, resolution issues

VMware and installed in the full screen resolution at VMTools is found 950 (HiDPI), the setting / display / scaling, switching click can not live or die 1920

Open a terminal in turn enter the following command:

cd /Library/PreferencesSwitch catalog.
plutil -p com.apple.windowserver.plistView now plist setting, the value should be 1.
sudo plutil -replace DisplayResolutionEnabled -bool "NO" com.apple.windowserver.plistmodify plist is set to 0.

Restart to take effect.

gettools.py

from __future__ import print_function

import os
import shutil
import sys
import tarfile
import zipfile

# 添加处, 方便伪装 User-Agent
import requests


# 添加处
def download_drawn(url, path):
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36',
    }
    resp = requests.get(url, headers=headers, timeout=180)
    with open(path, "wb") as fp:
        fp.write(resp.content)


def convertpath(path):
    # OS path separator replacement funciton
    return path.replace(os.path.sep, '\\')  # 修改处


def main():
    # Check minimal Python version is 2.7
    if sys.version_info < (2, 7):
        sys.stderr.write('You need Python 2.7 or later\n')
        sys.exit(1)

    # Setup url and file paths
    url = 'http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/'
    dest = os.path.dirname(os.path.abspath(__file__))

    # Re-create the tools folder
    shutil.rmtree(dest + '/tools', True)
    os.mkdir(dest + '/tools')

    # 删改处
    urlpost15 = url + '11.1.0/13668589' + '/packages/com.vmware.fusion.tools.darwin.zip.tar'
    urlpre15 = url + '11.1.0/13668589' + '/packages/com.vmware.fusion.tools.darwinPre15.zip.tar'

    # Download the darwin.iso tgz file
    print('Retrieving Darwin tools from: ' + urlpost15)
    # 修改处
    download_drawn(urlpost15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))

    # Extract the tar to zip
    tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'), 'r')
    tar.extract('com.vmware.fusion.tools.darwin.zip', path=convertpath(dest + '/tools/'))
    tar.close()

    # Extract the iso and sig files from zip
    cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'), 'r')
    cdszip.extract('payload/darwin.iso', path=convertpath(dest + '/tools/'))
    cdszip.extract('payload/darwin.iso.sig', path=convertpath(dest + '/tools/'))
    cdszip.close()

    # Move the iso and sig files to tools folder
    shutil.move(convertpath(dest + '/tools/payload/darwin.iso'), convertpath(dest + '/tools/darwin.iso'))
    shutil.move(convertpath(dest + '/tools/payload/darwin.iso.sig'), convertpath(dest + '/tools/darwin.iso.sig'))

    # Cleanup working files and folders
    shutil.rmtree(convertpath(dest + '/tools/payload'), True)
    os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
    os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'))

    # Download the darwinPre15.iso tgz file
    print('Retrieving DarwinPre15 tools from: ' + urlpre15)
    # 修改处
    download_drawn(urlpre15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'))

    # Extract the tar to zip
    tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'), 'r')
    tar.extract('com.vmware.fusion.tools.darwinPre15.zip', path=convertpath(dest + '/tools/'))
    tar.close()

    # Extract the iso and sig files from zip
    cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip'), 'r')
    cdszip.extract('payload/darwinPre15.iso', path=convertpath(dest + '/tools/'))
    cdszip.extract('payload/darwinPre15.iso.sig', path=convertpath(dest + '/tools/'))
    cdszip.close()

    # Move the iso and sig files to tools folder
    shutil.move(convertpath(dest + '/tools/payload/darwinPre15.iso'), convertpath(dest + '/tools/darwinPre15.iso'))
    shutil.move(convertpath(dest + '/tools/payload/darwinPre15.iso.sig'), convertpath(dest + '/tools/darwinPre15.iso.sig'))

    # Cleanup working files and folders
    shutil.rmtree(convertpath(dest + '/tools/payload'), True)
    os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'))
    os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip'))


if __name__ == '__main__':
    main()

Guess you like

Origin www.cnblogs.com/trent-fzq/p/11564442.html