Repository: hkdb/VBoxMacSetup Branch: master Commit: 67ee916c098b Files: 3 Total size: 5.4 KB Directory structure: gitextract_lti6zzvw/ ├── LICENSE ├── README.md └── setup.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2018 hkdb Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # VBoxMacSetup v1.2 **maintained by:** hkdb \
### Bash script to quickly prepare your MacOS High Sierra Virtual HD with full screen resolution. ## WHAT DOES IT DO? This script automates the following commands: ``` VBoxManage modifyvm "MacOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "MacOS" "VBoxInternal2/EfiGraphicsResolution" "1920x1080" ``` It also executes the following if the host is not on an Intel CPU: ``` VBoxManage modifyvm "${VM}" --cpu-profile "Intel Core i7-6700K" ``` ## RELEASE v1.2 - Added support for non-Intel hosts based on @jld3103 v1.1 - Merged PR Fix, Added Version Tracking, and Fixed README v1.0 - Initial Release ## DEVELOPMENT AND PULL REQUESTS As of v1.1, I created a develop branch for development or pull requests if it's still needed. Though, I think this is a simple enough script that probably won't require any further development? ## DEPENDENCIES - Bash - Virtualbox 5.x and 6.x - MacOS High Sierra Final ## TESTED ON - Ubuntu Linux 18.04, 18.10, 19.04 ## INSTALLATION Nothing needs to be installed. It's just a script that runs commands for you. ## USAGE setup.sh takes 2 arguments which is what you named your VM led by a -v flag and the desired resolution for your VM led by -r. For example, I named mine "MacOS" and my full screen resolution is 1920x1080. Therefore, this is how I run the script: ``` ./setup.sh -v "MacOS" -r 1920x1080 ``` ## OVERALL PROCEDURE 1. Download the image file from this Techsviewer post: https://techsviewer.com/install-macos-high-sierra-virtualbox-windows/ 2. Install VirtualBox (ie. sudo apt install virtualbox, etc) 3. Launch Virtualbox 4. Create Virtual Machine w/ existing vmdk (ie. with what you downloaded in step 1) 5. Name your VM without spaces. I read somewhere that spaces could potentially cause issues. mine is named "MacOS" 6. Configure at least 2 cores, 4GB of RAM, and 128MB of graphics with 3D acceleration on. 7. Close VirtualBox 8. In terminal, run setup.sh -v \ -r \ 9. Launch VirtualBox again 10. Play MacOS VM 11. Voila! ================================================ FILE: setup.sh ================================================ #!/bin/bash ##################################### # # # VBoxMacSetup # # # # Maintianed by; hkdb # # # ##################################### VERSION="v1.2" POSITIONAL=() if [ "$#" -le 3 ] && [ "$1" != "-h" ]; then echo -e '\nSomething is missing... Type "./setup -h" without the quotes to find out more...\n' exit 0 fi while [[ $# -gt 0 ]] do key="$1" case $key in -v|--vm) VM="$2" shift # past argument shift # past value ;; -r|--resolution) RES="$2" shift # past argument shift # past value ;; -h|--help) echo -e "\nVBoxMacSetup $VERSION\n\nOPTIONS:\n\n-v, --vm: Virtual Machine Name\n-r, --resolution: VM Resolution\n-h, --help: Help\n\nEXAMPLE:\n\n./setup.sh -v MacOS -r 1920x1080\n" exit 0 ;; esac done set -- "${POSITIONAL[@]}" # restore positional parameters VBoxManage modifyvm "${VM}" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff # Check CPU Type INTEL=$(lscpu |grep GenuineIntel) # Execute this line if it's a non-intel CPU if [ -z "$INTEL" ]; then VBoxManage modifyvm "${VM}" --cpu-profile "Intel Core i7-6700K" fi VBoxManage setextradata "${VM}" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "${VM}" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "${VM}" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "${VM}" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "${VM}" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "${VM}" "VBoxInternal2/EfiGraphicsResolution" "$RES"