summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-08-03 14:49:51 +0200
committerSimon Rettberg2016-08-03 14:49:51 +0200
commit0e3b1d69a4c08a2e71aae2247f575325a301d259 (patch)
treea84eba17bf79a7e93b9a981a1e4c53c6c26cda82
parent[run-virt] usbdetect: Add class 239 ("misc. device") (diff)
downloadtm-scripts-0e3b1d69a4c08a2e71aae2247f575325a301d259.tar.gz
tm-scripts-0e3b1d69a4c08a2e71aae2247f575325a301d259.tar.xz
tm-scripts-0e3b1d69a4c08a2e71aae2247f575325a301d259.zip
[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.
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc2
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc20
2 files changed, 20 insertions, 2 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
index ff562b20..5f12fe29 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
@@ -19,7 +19,7 @@ else
SHARE_REMAP_MODE_INI="$SHARE_REMAP_MODE"
fi
[ -z "$SHARE_CREATE_MISSING_REMAP" ] && SHARE_CREATE_MISSING_REMAP="1"
-RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \
+declare -rg RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \
| grep -o -E -m1 '[0-9]+x[0-9]+')
# Legacy: HOSTRES.TXT
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')