-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathsetup.sh
executable file
·57 lines (48 loc) · 1.8 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#####################################
# #
# VBoxMacSetup #
# #
# Maintianed by; hkdb <hkdb@3df.io> #
# #
#####################################
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"