From 0e3b1d69a4c08a2e71aae2247f575325a301d259 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 3 Aug 2016 14:49:51 +0200 Subject: [run-virt/vmware] Patch resolution into vmx if it's an "odd one" vmware doesn't allow some resolutions by default on some guests, so this workaround forces the desired resolution by some additional vmx entries. --- .../openslx/vmchooser/vmware/includes/parse_vmx.inc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'remote/modules/vmware/data/opt') diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc index 878e9a9d..69ec513a 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc @@ -128,8 +128,26 @@ if [ -n "$SLX_EXAM" ]; then echo 'gui.restricted = "true"' >> "${TMPCONFIG}" fi +# Hack resolution if we know the desired one is not in the default list of vmx_svga +# For now, only do it on the odd ones, as we don't know if this has any side effects +# This seems unnecessary on Win7 but is required on WinXP - need more research for other OSs +case "$RESOLUTION" in + 1600x900|2560x1440|2880x1800|3200x1800) + X=${RESOLUTION%x*} + Y=${RESOLUTION#*x} + BYTES=$(( ( ( X * Y * 4 + 65535 ) / 65536 ) * 65536 )) + [ "$BYTES" -lt 16777216 ] && BYTES=16777216 + cat >> "${TMPCONFIG}" <<-EOF + svga.autodetect = "FALSE" + svga.vramSize = $BYTES + svga.maxWidth = $X + svga.maxHeight = $Y + EOF + ;; +esac + # Killing duplicate lines (output much nicer than sort -u): -awk '!a[$0]++' "${TMPCONFIG}" > "${TMPCONFIG}.tmp" && mv "${TMPCONFIG}.tmp" "${TMPCONFIG}" +awk '!a[$0]++' "${TMPCONFIG}" > "${TMPCONFIG}.tmp" && mv -f "${TMPCONFIG}.tmp" "${TMPCONFIG}" # Apply $maxhardwareversion to final VMX HWVER=$(grep -i -m1 '^virtualHW.version *= *' "${TMPCONFIG}" | awk -F '=' '{print $2}' | sed -r 's/[^0-9]//g') -- cgit v1.2.3-55-g7522