summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/determine_hardware_limitations.inc
blob: 11ea2e3a3e4352d3ebba2b6113c03d9dd5bd8a77 (plain) (blame)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
########################################
# Include: Determine hw limitations depending on hwver and guest os #
########################################

MAXMEM="9999999"
MAXCORES="4"
shfolders="TRUE"
sound="es1371"

# define hardware configuration depending on the guest OS used
# this needs to be fixed and is the base for the creation of new VMs
case "$VM_OS_TYPE" in
	win31*|windows31*)
		VM_OS_TYPE="win31"
		shfolders="FALSE"
		sound="sb16"
		MAXMEM="32"
		MAXCORES="1"
	;;
	winnt*|windowsnt*)
		VM_OS_TYPE="winnt"
		shfolders="FALSE"
		sound="sb16"
		MAXMEM="1000"
		MAXCORES="2"
	;;
	win95*|windows95*)
		VM_OS_TYPE="win95"
		shfolders="FALSE"
		MAXMEM="96"
		MAXCORES="1"
	;;
	win98*|windows98*)
		VM_OS_TYPE="win98"
		MAXMEM="256"
		MAXCORES="1"
	;;
	winme*|windowsme*)
		VM_OS_TYPE="winme"
		MAXMEM="384"
		MAXCORES="1"
	;;
	win2000|windows2000|win2000pro*)
		VM_OS_TYPE="win2000pro"
		MAXMEM="4000"
		MAXCORES="2"
	;;
	win2000srv*|windows2000srv*|win2000serv*|windows2000serv*)
		VM_OS_TYPE="win2000serv"
		shfolders="FALSE"
		MAXMEM="4000"
		MAXCORES="4"
	;;
	win2000adv*|windows2000adv*|win2000dat*|windows2000dat*)
		VM_OS_TYPE="win2000advserv"
		shfolders="FALSE"
		MAXMEM="8000"
		MAXCORES="8"
	;;
	winnet*64|win*2003*64|windowsnet*64)
		VM_OS_TYPE="winnetstandard-64"
		MAXMEM="8000"
		MAXCORES="8"
	;;
	winnet*|win*2003*|windowsnet*)
		VM_OS_TYPE="winnetstandard"
		MAXMEM="4000"
		MAXCORES="8"
	;;
	winxphome*|windowsxphome*)
		VM_OS_TYPE="winxphome"
		MAXMEM="4000"
		MAXCORES="2"
	;;
	winxp*64|windowsxp*64)
		VM_OS_TYPE="winxppro-64"
		MAXMEM="8000"
		MAXCORES="8"
	;;
	winxp*|windowsxp*)
		VM_OS_TYPE="winxppro"
		MAXMEM="4000"
		MAXCORES="4"
	;;
	winvista-64)
		VM_OS_TYPE="winvista-64"
		MAXMEM="16000"
		MAXCORES="4"
	;;
	windows7-64)
		VM_OS_TYPE="windows7-64"
		MAXMEM="32000"
		MAXCORES="8"
	;;
	windows8-64)
		VM_OS_TYPE="windows8-64"
		MAXMEM="32000"
		MAXCORES="8"
	;;
	windows9-64)
		VM_OS_TYPE="windows9-64"
		MAXMEM="64000"
		MAXCORES="8"
	;;
	winvista)
		VM_OS_TYPE="winvista"
		MAXMEM="8000"
		MAXCORES="2"
	;;
	windows7)
		VM_OS_TYPE="windows7"
		MAXMEM="8000"
		MAXCORES="4"
	;;
	windows8)
		VM_OS_TYPE="windows8"
		MAXMEM="8000"
		MAXCORES="4"
	;;
	windows9)
		VM_OS_TYPE="windows9"
		MAXMEM="8000"
		MAXCORES="4"
	;;
	win*64)
		MAXMEM="16000"
		MAXCORES="4"
	;;
	win*)
		MAXMEM="8000"
		MAXCORES="1"
	;;
	dos|msdos*|ms-dos*)
		VM_OS_TYPE="dos"
		shfolders="FALSE"
		MAXMEM="128"
		MAXCORES="1"
	;;
	macos*64)
		VM_OS_TYPE="freebsd-64"
		MAXMEM="4000"
		MAXCORES="2"
	;;
	macos*)
		VM_OS_TYPE="freebsd"
		MAXMEM="4000"
		MAXCORES="1"
	;;
	beos*)
		VM_OS_TYPE="other"
		shfolders="FALSE"
	;;
	# Unknown guestOS setting in .xml - this encompasses linux too,
	# as there is a multitude of different distributions. Perhaps further
	# action will be needed if this leads to problems with exotic OSs.
	*64)
		VM_OS_TYPE="other-64"
		# shfolders="FALSE"
		MAXMEM="123456"
		MAXCORES="4"
	;;
	*)
		VM_OS_TYPE="other"
		# shfolders="FALSE"
		MAXMEM="8000"
		MAXCORES="1"
	;;
esac

real_core_count="$cpu_cores"
[ "$cpu_cores" -gt "$MAXCORES" ] && cpu_cores="$MAXCORES"

# It currently makes no sense to set the virtual number of cores
# to a different value than the virtual number of cores per virtual CPU.
cores_per_socket="$cpu_cores"

if [ "x$shfolders" != "xFALSE" ] && [ "$SHARE_REMAP_MODE" != 1 ]; then
	HGFS_DISABLED="FALSE"
else
	HGFS_DISABLED="TRUE"
fi

[ "$mem" -ge "$MAXMEM" ] && mem="$MAXMEM"
[ "$HWVER" -lt "7" -a "$mem" -gt "3500" ] && mem="3500"