summaryrefslogtreecommitdiffstats
path: root/vmware
diff options
context:
space:
mode:
authorMichael Janczyk2006-05-15 17:43:11 +0200
committerMichael Janczyk2006-05-15 17:43:11 +0200
commit00a02c9dff76a1416c51c58b9514e520c3f633ec (patch)
treebc0ab98addd63957eeadf02f24a4ff13d8943ff3 /vmware
parentfixes and cleanups within installer, see #51 too (diff)
downloadcore-00a02c9dff76a1416c51c58b9514e520c3f633ec.tar.gz
core-00a02c9dff76a1416c51c58b9514e520c3f633ec.tar.xz
core-00a02c9dff76a1416c51c58b9514e520c3f633ec.zip
few changes, testcommit
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@212 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'vmware')
-rwxr-xr-xvmware/runvmware108
-rw-r--r--vmware/winconfig28
2 files changed, 91 insertions, 45 deletions
diff --git a/vmware/runvmware b/vmware/runvmware
index 33a15976..bd59e10d 100755
--- a/vmware/runvmware
+++ b/vmware/runvmware
@@ -4,10 +4,13 @@
# X Stations (v4)
#
# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 18-03-2006
-# Michael Janczyk <mj0@uni-freiburg.de>, 21-04-2006
+# Michael Janczyk <mj0@uni-freiburg.de>, 15-05-2006
# Copyright: (c) 2003, 2006 - RZ Universitaet Freiburg
#
-version=0.14a; last_changes=21-04-06
+last_changes=$(head $0 | grep "@" | awk -F ", " '{print $2}' \
+ | awk -F "-" '{print $3" "$2" "$1}' | sort -bfnr \
+ | awk '{print $3"-"$2"-"$1}' | grep -m 1 [0-9])
+version=0.14.c
################################################################################
@@ -66,10 +69,12 @@ runvmwareconfheader () {
###### sound #################################################################
sound.present = \"TRUE\"
+ sound.virtualDev = \"es1371\"
###### usb ###################################################################
usb.present = \"TRUE\"
+ usb.generic.autoconnect = \"TRUE\"
###### floppies ##############################################################
@@ -102,9 +107,21 @@ runvmwareconfheader () {
###### misc ##################################################################
tmpDirectory = \"${tmpdir}\"
mainMem.useNamedFile = \"FALSE\"
- tools.syncTime = \"FALSE\"
+ tools.syncTime = \"TRUE\"
redoLogDir = \"${tmpdir}\"
-
+ hints.hideAll = \"TRUE\"
+ logging = \"FALSE\"
+ isolation.tools.hgfs.disable = \"FALSE\"
+ isolation.tools.dnd.disable = \"TRUE\"
+ isolation.tools.copy.enable = \"TRUE\"
+ isolation.tools.paste.enabled = \"TRUE\"
+ gui.restricted = \"TRUE\"
+ pref.hotkey.shift = \"TRUE\"
+ pref.hotkey.control = \"TRUE\"
+ pref.hotkey.alt = \"TRUE\"
+ svga.maxWidth = \"${xres}\"
+ svga.maxHeight = \"${yres}\"
+
" \
>${confile}
@@ -160,13 +177,20 @@ memgig=
permem=66
# virtual devices
cdr_1="FALSE"
-cdr_1_name="/dev/cdrom1"
+cdr_1_name="/dev/cdrom"
cdr_2="FALSE"
-cdr_2_name="/dev/cdrom2"
+cdr_2_name="/dev/cdrom1"
floppya="FALSE"
floppyb="FALSE"
# place for the virtual floppy "B:"
floppybname="/tmp/${clientip}-fd0.img"
+# resolution
+hostres=$(xvidtune -show | grep -ve "^$")
+xres=$(echo "${hostres}" | awk '{print $3}')
+yres=$(echo "${hostres}" | awk '{print $7}')
+guestres=
+g_xres=
+g_yres=
# VMware variables
@@ -257,6 +281,7 @@ Image options:
--silent no stdout from runvmware
--mem <n(M(h)),n(G(h))> override autoallocation of memory, in percent
m,M megabyte, g,G gigabyte, h,H reserve f. host
+ --res <XXXxYYY> Maximum resolution of the guest os, e.g. 800x600
--delay <n seconds> delay the start of the script n seconds
--image <directory> specify image directory
--persistent use persistent mode
@@ -317,7 +342,7 @@ checkalias () {
x_dialog () {
- desktops=( `ls ${vmsessions} | grep -x ".*desktop" 2>/dev/null` )
+ desktops=( `ls ${vmsessions}/*.desktop 2>/dev/null` )
desktopsnr=$(echo "${#desktops[*]}")
(( args=0 ))
declare -i i=0
@@ -392,27 +417,27 @@ filecheck () {
fi
# readable?
-# if [ `/bin/test -r "${diskfile}" >/dev/null 2>&1 \
-# || /usr/bin/test -r "${diskfile}" >/dev/null 2>&1` ]; then
-# writelog "Vmware Image Problem:\c" 0 1
-# writelog "\tThe image you've specified has wrong rights." 0 1
-# writelog "Filecheck says:\t\t`echo ${filecheck} \
-# | awk '{print $1" "$3" "$4}'` ${rightsfile}" 0 1
-# writelog "Hint:\t\t\tChange rights with: chmod a+r ${rightsfile}\n" 0 0
-# exit 1
-# fi
-#
+ if ! [ -r "${diskfile}" >/dev/null 2>&1 \
+ -o -r "${diskfile}" >/dev/null 2>&1 ]; then
+ writelog "Vmware Image Problem:\c" 0 1
+ writelog "\tThe image you've specified has wrong rights." 0 1
+ writelog "Filecheck says:\t\t`echo ${filecheck} \
+ | awk '{print $1" "$3" "$4}'` ${rightsfile}" 0 1
+ writelog "Hint:\t\t\tChange rights with: chmod a+r ${rightsfile}\n" 0 0
+ exit 1
+ fi
+
# writable (for persistent-mode)?
-# if [ `/bin/test -w "${diskfile}" >/dev/null 2>&1 \
-# || /usr/bin/test -w "${diskfile}" >/dev/null 2>&1` ] \
-# && [ "${np}" = "independent-persistent" ]; then
-# writelog "Vmware Image Problem:\c" 0 1
-# writelog "\tThe image you've specified has wrong rights." 0 1
-# writelog "Filecheck says:\t\t`echo ${filecheck} \
-# | awk '{print $1" "$3" "$4}'` ${rightsfile}" 0 1
-# writelog "Hint:\t\t\tUse nonpersistent-mode or change rights to rw" 0 0
-# exit 1
-# fi
+ if ! [ -w "${diskfile}" >/dev/null 2>&1 \
+ -o -w "${diskfile}" >/dev/null 2>&1 ] \
+ && [ "${np}" = "independent-persistent" ]; then
+ writelog "Vmware Image Problem:\c" 0 1
+ writelog "\tThe image you've specified has wrong rights." 0 1
+ writelog "Filecheck says:\t\t`echo ${filecheck} \
+ | awk '{print $1" "$3" "$4}'` ${rightsfile}" 0 1
+ writelog "Hint:\t\t\tUse nonpersistent-mode or change rights to rw" 0 0
+ exit 1
+ fi
}
@@ -482,6 +507,10 @@ while [ ${nofclopt} -gt "${args}" ]; do
(( args=${args}+1 ))
memopt=${lineopts[${args}]}
;;
+ --res)
+ (( args=${args}+1 ))
+ guestres=${lineopts[${args}]}
+ ;;
--run)
(( args=${args}+1 ))
vmrun=${lineopts[${args}]}
@@ -602,18 +631,18 @@ fi
# check memory range
memtest=${memtest}-128
if [ "${mem}" -lt "128" ] || [ "${mem}" -gt "${memtest}" ]; then
- writelog "\n\n\tYour memory is out of range: ${mem} MB.\n\
+ writelog "\n\n\tYour memory is out of range: ${mem} MB.
\tMin. 128 MB for host and guest!\n\tTry --mem option.\n" 0 1
exit 1
fi
# look for cdrom,dvd and floppy and add them to the vm config file
-if [ -L /dev/cdrom1 ] ; then
+if [ -L /dev/cdrom ] ; then
cdr_1="TRUE"
fi
-if [ -L /dev/cdrom2 ] ; then
+if [ -L /dev/cdrom1 ] ; then
cdr_2="TRUE"
fi
@@ -622,8 +651,23 @@ fi
[ -d /sys/block/fd0 ] && floppya="TRUE"
-writelog "finished\nResults:\n\tMAC=00:50:56:0D:${mac}\n\tMem=${mem} MB" 0 1
-writelog "\tCD-ROM_1=${cdr_1}\n\tCD-ROM_2=${cdr_2}\n" 0 1
+# guest resolution
+if [ -n "${guestres}" ]; then
+ g_xres=$(echo "${guestres}" | awk -F "x" '{print $1}')
+ g_yres=$(echo "${guestres}" | awk -F "x" '{print $2}')
+ if [ "${g_xres}" -ge "640" -a "${g_xres}" -le "${xres}" \
+ -a "${g_yres}" -ge "480" -a "${g_yres}" -le "${yres}" ]; then
+ xres=${g_xres}
+ yres=${g_yres}
+ else
+ writelog "\n\n\tSpecified resolution is not in range!
+ \tRange: 640x480 - ${xres}x${yres}
+ \tJumping back to resolution of Host.\n"
+ fi
+fi
+
+writelog "finished\nResults:\n\tMAC=00:50:56:0D:${mac}\n\tMem=${mem} MB
+ \tResolution=${xres}x${yres}\n\tCD-ROM_1=${cdr_1}\n\tCD-ROM_2=${cdr_2}\n" 0 1
diff --git a/vmware/winconfig b/vmware/winconfig
index 8ac8d149..a703ed15 100644
--- a/vmware/winconfig
+++ b/vmware/winconfig
@@ -4,24 +4,26 @@
# create Windows config file
+# NO LONGER NEEDED !!!!!
# definition of some resolution variables
-hostres=$(xvidtune -show | grep -ve "^$")
-x_param=$(echo "${hostres}" | awk '{print $3}')
-y_param=$(echo "${hostres}" | awk '{print $7}')
-resolution="
- <resolution_x param=\"${x_param}\">\r
- </resolution_x>\r
- <resolution_y param=\"${y_param}\">\r
- </resolution_y>\r"
+#hostres=$(xvidtune -show | grep -ve "^$")
+#x_param=$(echo "${hostres}" | awk '{print $3}')
+#y_param=$(echo "${hostres}" | awk '{print $7}')
+#resolution="
+# <resolution_x param=\"${x_param}\">\r
+# </resolution_x>\r
+# <resolution_y param=\"${y_param}\">\r
+# </resolution_y>\r"
# VMplayer does not need resolution change
-if [ `which vmplayer 2>/dev/null` ] && [ -z "${vmrun}" ] \
- || [ "${vmrun}" = "vmplayer" ]; then
- resolution=
-fi
+#if [ `which vmplayer 2>/dev/null` ] && [ -z "${vmrun}" ] \
+# || [ "${vmrun}" = "vmplayer" ]; then
+# resolution=
+#fi
# sync is needed to ensure that data is really written to virtual disk
+# insert '\r${resolution}' after </username> when resolution needed
sync
echo -e "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r
<settings>\r
@@ -29,7 +31,7 @@ echo -e "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r
<computername param=\"${hostname}\">\r
</computername>\r
<username param=\"${USER}\">\r
- </username>\r${resolution}
+ </username>
</eintrag>\r
</settings>\r" \
> /media/loop0/config.xml