summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmware
diff options
context:
space:
mode:
authorJonathan Bauer2016-01-08 14:28:46 +0100
committerJonathan Bauer2016-01-08 14:28:46 +0100
commit7106ee223592a0591e267daa7f71162e4ad658b0 (patch)
tree490d793b56807918cbd6197086b5251d08a18145 /remote/modules/vmware
parent[exam] renamed safe-mode service to 'exam.service' and removed unneeded code (diff)
parent[run-virt] openslx.exe: Hide console, re-set logoff caption periodically (diff)
downloadtm-scripts-7106ee223592a0591e267daa7f71162e4ad658b0.tar.gz
tm-scripts-7106ee223592a0591e267daa7f71162e4ad658b0.tar.xz
tm-scripts-7106ee223592a0591e267daa7f71162e4ad658b0.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/vmware')
-rw-r--r--remote/modules/vmware/data/etc/X11/Xreset.d/vmware11
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc6
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc19
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc11
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include1
5 files changed, 28 insertions, 20 deletions
diff --git a/remote/modules/vmware/data/etc/X11/Xreset.d/vmware b/remote/modules/vmware/data/etc/X11/Xreset.d/vmware
index ee436292..83bfb392 100644
--- a/remote/modules/vmware/data/etc/X11/Xreset.d/vmware
+++ b/remote/modules/vmware/data/etc/X11/Xreset.d/vmware
@@ -2,9 +2,16 @@
# VMWare cleanup
#
+# Unmount dirs that vmware sometimes leaves around
VMWARE_TMP_DIRS="$(cat /proc/mounts | grep "/tmp/vmware-" | awk -F " " '{print $1}')"
for DIR in $VMWARE_TMP_DIRS; do
- umount -l "$DIR" || echo "Could not unmount."
+ umount "$DIR" && rmdir "$DIR"
done
-exit 0
+# Delete redo/temp files that sometimes stay around e.g. on vmware crash
+for file in $(find /tmp/virt/vmware -type f -size +4M); do
+ fuser -s "$file" || rm -- "$file"
+done
+
+true
+
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc
index e33320ad..b618041c 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc
@@ -35,7 +35,6 @@ create_vmhome_preferences_file() {
pref.hotkey.alt = "true"
pref.hotkey.shift = "true"
pref.hotkey.gui = "true"
- gui.restricted = "true"
# fullscreen/mouse/keyboard
pref.fullscreen.toolbarPixels = "0"
@@ -65,5 +64,8 @@ create_vmhome_preferences_file() {
pref.eula1.product = "VMware Workstation"
pref.eula1.build = "$vmware_build"
HEREEND
- writelog "Vmware preferences file created in vmhome."
+ if [ -n "$SLX_EXAM" ]; then
+ echo 'pref.hotkey.rightControl = "true"' >> "$vmhome/preferences"
+ fi
+ writelog "Vmware preferences file created in $vmhome."
}
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 3d82d934..f8f43ad3 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
@@ -55,10 +55,16 @@ MemTrimRate = "-1"
HEREEND
# USB
-cat >> "$TMPDIR/$IMGUUID" <<-HEREEND
-usb.present = "TRUE"
-usb.generic.autoconnect = "TRUE"
-HEREEND
+if [ -n "$SLX_EXAM" ]; then
+ # Exam mode: No USB (TODO: Configurable)
+ sed -i '/^usb\./d' "$TMPDIR/$IMGUUID"
+ echo 'usb.present = "FALSE"' >> "$TMPDIR/$IMGUUID"
+else
+ cat >> "$TMPDIR/$IMGUUID" <<-HEREEND
+ usb.present = "TRUE"
+ usb.generic.autoconnect = "TRUE"
+ HEREEND
+fi
# shared folders
cat >> "$TMPDIR/$IMGUUID" <<-HEREEND
@@ -106,6 +112,11 @@ fi
sed -i '/^gui.applyHostDisplayScaling/d' "$TMPDIR/$IMGUUID"
echo 'gui.applyHostDisplayScalingToGuest = "FALSE"' >> "$TMPDIR/$IMGUUID"
+# Additinal exam mode settings
+if [ -n "$SLX_EXAM" ]; then
+ echo 'gui.restricted = "true"' >> "$TMPDIR/$IMGUUID"
+fi
+
# Killing duplicate lines (output much nicer than sort -u):
awk '!a[$0]++' "${TMPDIR}/${IMGUUID}" > "${TMPDIR}/${IMGUUID}.tmp" && mv "${TMPDIR}/${IMGUUID}.tmp" "${TMPDIR}/${IMGUUID}"
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc
index 5a5d1132..0c45ee59 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc
@@ -5,17 +5,6 @@
set_vmware_include_variables() {
[ "$mem" -gt 3800 -a "$(uname -m)" != "x86_64" ] && mem=3800
- # VM-ID static (0D), remove if changed to 00
- VM_ID="0D"
-
- # should be dynamic
- if [ "x$(which bc)" != "x" ]; then
- VM_ID=$(echo "obase=16; $$" | bc)
- VM_ID=$(expr substr $VM_ID $(expr ${#VM_ID} - 1) 2)
- else
- VM_ID=$[ $$ % 100 ]
- fi
-
# temporary disk space for logs, etc...
redodir="/tmp/virt/vmware/${USER}.$$"
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
index a823df72..f63092bd 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
@@ -68,5 +68,4 @@ cp "$conffile" "/tmp/vmware-last-config"
# using the modified version of the wrapper script
VIRTCMD="/opt/openslx/bin/vmplayer"
VIRTCMDOPTS="${vmopt} ${conffile}"
-RMDIRS="${redodir} ${conffile}"