From 74be7469519e6201dd345359e5a396b2a8fafd6b Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 27 Nov 2012 15:49:43 +0100 Subject: Working on VirtualBox for OpenSLX clients ... (including changes for vmchooser) --- .../plugins/virtualbox/files/run-virt.include | 71 +++++++++++++++++----- 1 file changed, 57 insertions(+), 14 deletions(-) (limited to 'src/os-plugins/plugins/virtualbox/files/run-virt.include') diff --git a/src/os-plugins/plugins/virtualbox/files/run-virt.include b/src/os-plugins/plugins/virtualbox/files/run-virt.include index 9d3f785d..0c858bee 100644 --- a/src/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/src/os-plugins/plugins/virtualbox/files/run-virt.include @@ -1,7 +1,7 @@ # run-virt.include # ----------------------------------------------------------------------------- # Copyright (c) 2009..2011 - RZ Uni Freiburg -# Copyright (c) 2009..2011 - OpenSLX GmbH +# Copyright (c) 2009..2012 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -50,8 +50,12 @@ snapshotdir=${machfolder}/${vm_shortname}/Snapshots mkdir -p ${diskfolder} ${snapshotdir} 2>/dev/null # check if diskless var empty? [ -z "${diskless}" ] && diskless=0 +# default guest audio controller +guestaudio="AC97" +# default guest network adaptor +vb_network_card="Am79C973" -# configure our own rwimg, empty image which we support +# configure our own rwimg, empty image which we provide if [ "${imgmode}" = "rwimg" ]; then # what is our rwimg called? imgname="${vm_shortname}.vdi" @@ -73,9 +77,37 @@ elif [ ${diskless} -eq 0 ]; then cleanexit 1 fi -# TODO: maybe rewrite, to reduce checks, merge it with network option, -# so we can have a "compatibility to vmware config" section +# nested paging +npaging="false" +# enable VT +enablevt="false" +# check for VT, if not available use only 1 cpu (only 1 supported) +[ ${vtflag} -eq 0 ] && cpu_cores=1 +[ ${vtflag} -eq 1 ] && enablevt="true" + +# set some base configuration depending on the guest operating system case "${vmostype}" in + win31*) + guestaudio="SB16" + vmostype="Windows31" + mem="32" + cpu_cores=1 + ;; + win95*) + vmostype="Windows95" + mem="92" + cpu_cores=1 + ;; + win98*) + vmostype="Windows98" + mem="256" + cpu_cores=1 + ;; + winme*) + vmostype="WindowsMe" + mem="256" + cpu_cores=1 + ;; winxp*|windowsxp*) vmostype="WindowsXP" ;; @@ -103,7 +135,9 @@ case "${vmostype}" in fi ;; os2*) + mem="256" vmostype="OS2eCS" + cpu_cores=1 ;; macos*|MacOS*) vmostype="MacOS" @@ -171,7 +205,7 @@ elif [ ${diskless} -eq 0 ]; then skip=392 bs=1 count=16 conv=notrunc fi -# TODO: MEM muss noch angepasst werden. Maschine crasht wenn nehr als 50% MEM +# TODO: MEM muss noch angepasst werden. Maschine crasht wenn mehr als 50% MEM # memory part equal to vmware plugin # percentage of memory to use for virtualbox in standard case #if [ -n "${forcemem}" ]; then @@ -238,6 +272,16 @@ case "${network_kind}" in network_kind="NAT" esac +# configure 3d settings +case "${enable3d}" in + *true*|*yes*) + enable3d="true" + ;; + *) + enable3d="false" + ;; +esac + # translate boot, use if set else set to HardDisk # usually support for a,c,d,n, stands for Floppy, HD, CD-ROM, Network # support nfs and tftp as well @@ -267,14 +311,6 @@ case ${boot} in ;; esac -# nested paging -npaging="false" -# enable VT -enablevt="false" -# check for VT, if not available use only 1 cpu (only 1 supported) -[ ${vtflag} -eq 0 ] && cpu_cores=1 -[ ${vtflag} -eq 1 ] && enablevt="true" - # external GUI vrdpport=${remotedesktopport} @@ -326,7 +362,7 @@ fi # create machine.xml . ${PLUGINCONFVIRTUALBOX}/machine.include -# remove CD-ROM +# remove CD-ROM if not available if [ "${cdrom0}" != "TRUE" ]; then sed -i "/HostDrive/d" ${machconfig} sed -i '/AttachedDevice.*type="DVD"/d' ${machconfig} @@ -366,6 +402,13 @@ fi ### finally set env for run-virt.sh ################################################################################ +# configure and start samba service to provide user's home directory +if [ -f /usr/sbin/smbd ] ; then + sudo /opt/openslx/rootfs/bin/sed -i /etc/vbox/smb.conf -e "s,$USER,USER," + sudo /usr/sbin/nmbd -c /etc/vbox/smb.conf + sudo /usr/sbin/smbd -c /etc/vbox/smb.conf +fi + # wait for a certain command to settle # get the PID of the right process # kill PID, seems to work -- cgit v1.2.3-55-g7522