summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules')
-rwxr-xr-xremote/modules/vbox/data/opt/openslx/scripts/systemd-vbox_env25
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env23
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt2
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include127
4 files changed, 88 insertions, 89 deletions
diff --git a/remote/modules/vbox/data/opt/openslx/scripts/systemd-vbox_env b/remote/modules/vbox/data/opt/openslx/scripts/systemd-vbox_env
index 9b1d8489..8bdfc515 100755
--- a/remote/modules/vbox/data/opt/openslx/scripts/systemd-vbox_env
+++ b/remote/modules/vbox/data/opt/openslx/scripts/systemd-vbox_env
@@ -1,14 +1,19 @@
-#!/bin/ash
-# Copyright (c) 2009 - OpenSLX GmbH
-#
-# This program is free software distributed under the GPL version 2.
-# See http://openslx.org/COPYING
-#
-# If you have any feedback please consult http://openslx.org/feedback and
-# send your suggestions, praise, or complaints to feedback@openslx.org
-#
-# General information about OpenSLX can be found at http://openslx.org/
+#!/bin/bash
# -----------------------------------------------------------------------------
+# Copyright (c) 2007..2013 - RZ Uni FR
+# Copyright (c) 2007..2013 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# systemd-vbox_env
+# - This is the preparation script for the configuration of VirtualBox.
+################################################################################
export PATH="$PATH":/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin
VBOX_CONF_DIR=/opt/openslx/etc/vbox
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env
index b429bb55..c796b3db 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env
@@ -1,5 +1,4 @@
-#!/bin/bash
-# Full bash required
+#!/bin/ash
# -----------------------------------------------------------------------------
# Copyright (c) 2007..2013 - RZ Uni FR
# Copyright (c) 2007..2013 - OpenSLX GmbH
@@ -17,6 +16,10 @@
# zation tools used later on.
################################################################################
+################################################################################
+### Define default dirs / get configs
+################################################################################
+
export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin
# source config file with vars (e.g. ipaddr, macaddr, hostname)
@@ -68,7 +71,9 @@ mkdir -p /var/log/samba
#ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/bin/killall nmbd smbd
#EOF
-#from plugins/vmchooser/80-after-plugins/virtualization.sh
+################################################################################
+### Determine hardware configuration
+################################################################################
# estimate free mem
mem_free=$(grep -i "^memfree:" /proc/meminfo | awk '{print $2}')
@@ -77,8 +82,8 @@ mem_swapcached=$(grep -i "^swapcached:" /proc/meminfo | awk '{print $2}')
[ -z "$mem_free" ] && mem_free="2048000"
[ -z "$mem_cached" ] && mem_cached="0"
[ -z "$mem_swapcached" ] && mem_swapcached="0"
-totalmem="$[ ( $mem_free + $mem_cached + $mem_swapcached ) / 1024 ]"
-echo "totalmem=${totalmem}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
+totalmem="$(expr $(expr $mem_free + $mem_cached + $mem_swapcached) / 1024)"
+echo "totalmem=${totalmem}" > "${VMCHOOSER_CONF_DIR}/virtualization.conf"
# determine number of cpu cores
CPU_CORES=$(grep '^processor.*:' /proc/cpuinfo | wc -l)
@@ -88,10 +93,10 @@ else
echo 'cpu_cores=1' >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
fi
-# arch
+# general machine architecture (32/64bit)
echo "host_arch=$(uname -m)" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
-# VT enabled cpu?
+# check for VT enabled CPU
if grep -q '^flags.*\<vmx\>' "/proc/cpuinfo"; then
echo "vtflag=1" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
echo 'kvm_module="kvm_intel"' >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
@@ -108,10 +113,10 @@ if [ -n "$SLX_PXE_MAC" ]; then
else ## Fallback:
echo "hostmacaddr=$(ip a | grep ether | grep -o -E -i '([0-9a-f]{2}:){5}[0-9a-f]{2}' | head -n 1)" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
fi
-# ip addr
+# read in ip address
echo "hostip=${SLX_PXE_CLIENT_IP}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
# hostname
-echo "hostname=$(hostname -s)" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
+echo "hostname=\"$(hostname -s)\"" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
# get further hw information and check for traces of available optical and floppy drives
j=0
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
index 2a6a3272..43880a2c 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
@@ -433,7 +433,7 @@ amixer -q sset Front "$VOL" unmute 2>/dev/null # in SUSE 11.0 it's headphon
amixer -q sset Speaker "$VOL" unmute 2>/dev/null # annoying built-in speaker
-# # # # # # Start printer daemon # # # # # # #
+# Start printer daemon
USER="$(whoami)"
SPOOLDIR="/var/spool"
QUEUE="STANDARD"
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 2de41d77..a4e03b7f 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
@@ -33,153 +33,142 @@ runvmwareconfheader ()
{
echo "# This configuration file was generated by $0" > "$conffile"
- # does this makes sense? Depends on the VMworkstation in use
MAXMEM="9999999"
MAXCORES="4"
+ shfolders="TRUE"
+ sound="es1371"
- # check for the ostype
- # 1) memory limits
+ # 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 "$vmostype" in
win31*|windows31*)
- MAXMEM="32"
vmostype="win31"
+ shfolders="FALSE"
+ sound="sb16"
+ MAXMEM="32"
+ MAXCORES="1"
;;
winnt*|windowsnt*)
- MAXMEM="1000"
vmostype="winnt"
+ shfolders="FALSE"
+ sound="sb16"
+ MAXMEM="1000"
+ MAXCORES="2"
;;
win95*|windows95*)
- MAXMEM="96"
vmostype="win95"
+ shfolders="FALSE"
+ MAXMEM="96"
+ MAXCORES="1"
;;
win98*|windows98*)
- MAXMEM="384"
vmostype="win98"
+ MAXMEM="256"
+ MAXCORES="1"
;;
winme*|windowsme*)
- MAXMEM="384"
vmostype="winme"
+ MAXMEM="384"
+ MAXCORES="1"
;;
win2000|windows2000|win2000pro*)
- MAXMEM="4000"
vmostype="win2000pro"
+ MAXMEM="4000"
+ MAXCORES="2"
;;
win2000srv*|windows2000srv*|win2000serv*|windows2000serv*)
- MAXMEM="4000"
vmostype="win2000serv"
+ shfolders="FALSE"
+ MAXMEM="4000"
+ MAXCORES="4"
;;
win2000adv*|windows2000adv*|win2000dat*|windows2000dat*)
- MAXMEM="8000"
vmostype="win2000advserv"
+ shfolders="FALSE"
+ MAXMEM="8000"
+ MAXCORES="8"
;;
winnet*64|win*2003*64|windowsnet*64)
- MAXMEM="8000"
vmostype="winnetstandard-64"
+ MAXMEM="8000"
;;
winnet*|win*2003*|windowsnet*)
- MAXMEM="4000"
vmostype="winnetstandard"
+ MAXMEM="4000"
;;
winxphome*|windowsxphome*)
- MAXMEM="4000"
vmostype="winxphome"
+ MAXMEM="4000"
+ MAXCORES="1"
;;
winxp*64|windowsxp*64)
- MAXMEM="8000"
vmostype="winxppro-64"
+ MAXMEM="8000"
+ MAXCORES="2"
;;
winxp*|windowsxp*)
- MAXMEM="4000"
vmostype="winxppro"
+ MAXMEM="4000"
+ MAXCORES="1"
;;
winvista*64|windowsvista*64)
- MAXMEM="16000"
vmostype="winvista-64"
+ MAXMEM="16000"
+ MAXCORES="2"
;;
winvista*|windowsvista*)
- MAXMEM="8000"
vmostype="winvista"
+ MAXMEM="8000"
+ MAXCORES="2"
;;
win7*64|windows7*64)
- MAXMEM="32000"
vmostype="windows7-64"
+ MAXMEM="32000"
+ MAXCORES="4"
;;
win7*|windows7*)
- MAXMEM="8000"
vmostype="windows7"
+ MAXMEM="8000"
+ MAXCORES="4"
;;
win*64)
MAXMEM="16000"
+ MAXCORES="4"
;;
win*)
MAXMEM="8000"
;;
dos|msdos*|ms-dos*)
- MAXMEM="128"
vmostype="dos"
- ;;
- *64)
- MAXMEM="123456"
- ;;
- *)
- MAXMEM="8000"
- ;;
- esac
-
- # 2) other hardware + capabilities
- shfolders="FALSE"
- case "$vmostype" in
- win31)
- MAXCORES="1"
- sound="sb16"
- ;;
- winnt)
- MAXCORES="2"
- sound="sb16"
- ;;
- win95|win98|winme)
- MAXCORES="1"
- ;;
- win2000pro) # Don't know if Win 2000 supports shared folders, disabled to be safe
- MAXCORES="2"
- ;;
- win2000serv)
- MAXCORES="4"
- ;;
- win2000advserv)
- MAXCORES="8"
- ;;
- winxphome)
- MAXCORES="1"
- shfolders="TRUE"
- ;;
- winxp*|winvista*|windows7*)
- MAXCORES="4"
- shfolders="TRUE"
- ;;
- winnet*)
- shfolders="TRUE"
- ;;
- linux*|ubuntu*|suse*|debian*)
- shfolders="TRUE"
+ shfolders="FALSE"
+ MAXMEM="128"
;;
macos*64)
- MAXCORES="2"
vmostype="freebsd-64"
+ MAXMEM="4000"
+ MAXCORES="2"
;;
macos*)
- MAXCORES="1"
vmostype="freebsd"
+ MAXMEM="4000"
+ MAXCORES="1"
;;
beos*)
vmostype="other"
+ shfolders="FALSE"
;;
# Unknown guestOS setting in .xml - use conservative defaults
*64)
vmostype="other-64"
+ shfolders="FALSE"
+ MAXMEM="123456"
+ MAXCORES="4"
;;
*)
vmostype="other"
+ shfolders="FALSE"
+ MAXMEM="8000"
+ MAXCORES="1"
;;
esac
@@ -259,7 +248,7 @@ floppy0.startConnected = "FALSE"
floppy0.autodetect = "TRUE"
floppy0.fileName = "auto detect"
-# we need floppy b: for our windows client configuration
+# we need floppy b: for the client configuration
floppy1.present = "$floppy1"
floppy1.startConnected = "TRUE"
floppy1.fileType = "file"