├── LICENSE ├── setup.sh └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 hkdb 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ##################################### 4 | # # 5 | # VBoxMacSetup # 6 | # # 7 | # Maintianed by; hkdb # 8 | # # 9 | ##################################### 10 | 11 | VERSION="v1.2" 12 | 13 | POSITIONAL=() 14 | 15 | if [ "$#" -le 3 ] && [ "$1" != "-h" ]; then 16 | echo -e '\nSomething is missing... Type "./setup -h" without the quotes to find out more...\n' 17 | exit 0 18 | fi 19 | 20 | while [[ $# -gt 0 ]] 21 | do 22 | key="$1" 23 | 24 | case $key in 25 | -v|--vm) 26 | VM="$2" 27 | shift # past argument 28 | shift # past value 29 | ;; 30 | -r|--resolution) 31 | RES="$2" 32 | shift # past argument 33 | shift # past value 34 | ;; 35 | -h|--help) 36 | 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" 37 | exit 0 38 | ;; 39 | esac 40 | done 41 | set -- "${POSITIONAL[@]}" # restore positional parameters 42 | 43 | VBoxManage modifyvm "${VM}" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff 44 | 45 | # Check CPU Type 46 | INTEL=$(lscpu |grep GenuineIntel) 47 | 48 | # Execute this line if it's a non-intel CPU 49 | if [ -z "$INTEL" ]; then 50 | VBoxManage modifyvm "${VM}" --cpu-profile "Intel Core i7-6700K" 51 | fi 52 | VBoxManage setextradata "${VM}" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" 53 | VBoxManage setextradata "${VM}" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" 54 | VBoxManage setextradata "${VM}" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" 55 | VBoxManage setextradata "${VM}" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" 56 | VBoxManage setextradata "${VM}" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 57 | VBoxManage setextradata "${VM}" "VBoxInternal2/EfiGraphicsResolution" "$RES" 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VBoxMacSetup v1.2 2 | **maintained by:** hkdb \
3 | 4 | ### Bash script to quickly prepare your MacOS High Sierra Virtual HD with full screen resolution. 5 | 6 | ## WHAT DOES IT DO? 7 | 8 | This script automates the following commands: 9 | 10 | ``` 11 | VBoxManage modifyvm "MacOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff 12 | 13 | VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" 14 | 15 | VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" 16 | 17 | VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" 18 | 19 | VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" 20 | 21 | VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 22 | 23 | VBoxManage setextradata "MacOS" "VBoxInternal2/EfiGraphicsResolution" "1920x1080" 24 | 25 | ``` 26 | 27 | It also executes the following if the host is not on an Intel CPU: 28 | ``` 29 | VBoxManage modifyvm "${VM}" --cpu-profile "Intel Core i7-6700K" 30 | ``` 31 | 32 | 33 | ## RELEASE 34 | 35 | v1.2 - Added support for non-Intel hosts based on @jld3103 36 | 37 | v1.1 - Merged PR Fix, Added Version Tracking, and Fixed README 38 | 39 | v1.0 - Initial Release 40 | 41 | 42 | ## DEVELOPMENT AND PULL REQUESTS 43 | 44 | 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? 45 | 46 | ## DEPENDENCIES 47 | 48 | - Bash 49 | - Virtualbox 5.x and 6.x 50 | - MacOS High Sierra Final 51 | 52 | ## TESTED ON 53 | 54 | - Ubuntu Linux 18.04, 18.10, 19.04 55 | 56 | ## INSTALLATION 57 | 58 | Nothing needs to be installed. It's just a script that runs commands for you. 59 | 60 | ## USAGE 61 | 62 | 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: 63 | 64 | ``` 65 | ./setup.sh -v "MacOS" -r 1920x1080 66 | ``` 67 | 68 | ## OVERALL PROCEDURE 69 | 70 | 1. Download the image file from this Techsviewer post: https://techsviewer.com/install-macos-high-sierra-virtualbox-windows/ 71 | 2. Install VirtualBox (ie. sudo apt install virtualbox, etc) 72 | 3. Launch Virtualbox 73 | 4. Create Virtual Machine w/ existing vmdk (ie. with what you downloaded in step 1) 74 | 5. Name your VM without spaces. I read somewhere that spaces could potentially cause issues. mine is named "MacOS" 75 | 6. Configure at least 2 cores, 4GB of RAM, and 128MB of graphics with 3D acceleration on. 76 | 7. Close VirtualBox 77 | 8. In terminal, run setup.sh -v \ -r \ 78 | 9. Launch VirtualBox again 79 | 10. Play MacOS VM 80 | 11. Voila! --------------------------------------------------------------------------------