From b60f27776ba0e1cf08ed864abe19dc9ba0283f2f Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 12 May 2015 17:08:08 +0200 Subject: [vbox] CAUTION: COMPATIBILITY BREAK to V3! virtualbox runs now, needs further work eg. fullscreen, Shared folders, less GUI messages etc. --- .../openslx/vmchooser/virtualbox/machine.include | 181 ++++++++++++++------- .../openslx/vmchooser/virtualbox/run-virt.include | 37 ++++- .../vmchooser/virtualbox/virtualbox.include | 6 +- remote/modules/vbox/module.conf | 4 +- remote/modules/vbox/module.conf.ubuntu.14 | 4 +- 5 files changed, 164 insertions(+), 68 deletions(-) (limited to 'remote/modules/vbox') diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include index d1c77f02..48610aea 100644 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include @@ -9,39 +9,49 @@ # # General information about OpenSLX can be found at http://openslx.org # ----------------------------------------------------------------------------- -# Include file (machine template) for run-virt.include of the OpenSLX virtual- -# box plugin +# Include file (general template) for run-virt.include of the virtualbox plugin + cat << EOF > "${machconfig}" - + + + + + + + + - - + + - + + + + + - + + + + - - + + + @@ -51,74 +61,131 @@ cat << EOF > "${machconfig}" - + + + + + + + - <${network_kind}/> + <${network_kind}/> - + - - - - - - + + + + + + + - + - - + + + + + - - - + $sharelist + + - - + + + + + + - --> - - + - + + - - - - - - - - EOF + diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include index 161fcf5a..ddf42f7c 100755 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include @@ -25,7 +25,7 @@ confdir="/tmp/virt/${self}/${USER}/${VM_ID}" # dir for configs export VBOX_USER_HOME=${confdir} # instead of $HOME/.VirtualBox # define dirs and files which can be removed after exit, be carefull! RMDIRS="${snapshotdir} ${confdir} /tmp/virt/.vbox-${USER}-ipc" -rm -rf ${RMDIRS} 2>/dev/null +# rm -rf ${RMDIRS} 2>/dev/null machfolder="${confdir}/Machines" # use vm_shortname for dir and config names since vm_name can be very long machconfig="${machfolder}/${vm_shortname}/${vm_shortname}.xml" @@ -64,6 +64,9 @@ enablevt="false" # VT: Default: not enabled [ ${vtflag} -eq 0 ] && cpu_cores=1 # check for VT, if not available only 1 cpu supported [ ${vtflag} -eq 1 ] && enablevt="true" +# Setting some default variables +shfolders="TRUE" + # set some base configuration depending on the guest operating system case "${vmostype}" in win31*) @@ -74,6 +77,17 @@ case "${vmostype}" in vram="16" cpu_cores=1 enablevt="false" + shfolders="FALSE" + ;; + winnt*) + guestaudio="SB16" + vb_network_card="Am79C973" + vmostype="Windows31" + mem="32" + vram="16" + cpu_cores=1 + enablevt="false" + shfolders="FALSE" ;; win95*) vmostype="Windows95" @@ -83,6 +97,7 @@ case "${vmostype}" in vram="32" cpu_cores=1 enablevt="false" + shfolders="FALSE" ;; win98*) vmostype="Windows98" @@ -91,6 +106,7 @@ case "${vmostype}" in mem="256" vram="64" cpu_cores=1 + shfolders="FALSE" ;; winme*) vmostype="WindowsMe" @@ -99,6 +115,7 @@ case "${vmostype}" in mem="256" vram="64" cpu_cores=1 + shfolders="FALSE" ;; winxp*|windowsxp*) vmostype="WindowsXP" @@ -165,7 +182,8 @@ machineuuid="00000000-0000-0000-0000-${macaddr}" # machine UUID, MAC addr part o machineuuid=$(echo ${machineuuid} | tr "[A-Z]" "[a-z]") # cosmetical, since UUID in lower case # get UUID of VBox image, if not diskless [ ${diskless} -eq 0 ] && diskuuid=$(VBoxManage -q showvdiinfo ${diskfile} \ - | grep UUID | grep -v "Parent UUID" | awk '{print $2}') + | grep UUID | grep -v "Parent UUID" | awk '{print $2}' \ + | grep -v use ) # nec. for VBox >= 4 imgtype="Immutable" # make disk immutable snapshotuuid="34f617be-192a-46b3-a8ae-bce1029e093f" # snapshot UUID is static @@ -335,7 +353,18 @@ writelog "\tShared Folders '${sharename}':\t${sharepath}" ################################################################################ # create Virtualbox.xml -. ${VMCHOOSERVBOX}/virtualbox.include # create Virtualbox.xml + +# Shares given? +if [ "x$shfolders" != "xFALSE" ]; then + sharelist=" + + + " +else + sharelist='' +fi + +source ${VMCHOOSERVBOX}/virtualbox.include # create Virtualbox.xml # remove snapshot disk when using rw images if [ "${imgtype}" != "Immutable" ]; then @@ -345,7 +374,7 @@ fi # TODO: add rawdisk if requested #"raw.vmdk" format="VMDK" type="Writethrough"/> -. ${VMCHOOSERVBOX}/machine.include # create machine.xml +source ${VMCHOOSERVBOX}/machine.include # create machine.xml # remove CD-ROM if not available if [ "${cdrom0}" != "TRUE" ]; then diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include index 477eebde..36c8ab80 100644 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2010..2013 - OpenSLX GmbH +# Copyright (c) 2010..2012 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -10,9 +10,9 @@ # General information about OpenSLX can be found at http://openslx.org # ----------------------------------------------------------------------------- # Include file (general template) for run-virt.include of the virtualbox plugin + cat << EOF > "${confdir}/VirtualBox.xml" - - + diff --git a/remote/modules/vbox/module.conf b/remote/modules/vbox/module.conf index 60cea223..6d79a1e7 100644 --- a/remote/modules/vbox/module.conf +++ b/remote/modules/vbox/module.conf @@ -1,7 +1,7 @@ REQUIRED_VBOX_VERSION_MAJOR="4.3" -REQUIRED_VBOX_VERSION_MINOR="8" +REQUIRED_VBOX_VERSION_MINOR="26" REQUIRED_VBOX_VERSION="$REQUIRED_VBOX_VERSION_MAJOR.$REQUIRED_VBOX_VERSION_MINOR" -REQUIRED_VBOX_VERSIONCODE="92456" +REQUIRED_VBOX_VERSIONCODE="98988" REQUIRED_DIRECTORIES=" /etc diff --git a/remote/modules/vbox/module.conf.ubuntu.14 b/remote/modules/vbox/module.conf.ubuntu.14 index 5691459b..59ed5ca7 100644 --- a/remote/modules/vbox/module.conf.ubuntu.14 +++ b/remote/modules/vbox/module.conf.ubuntu.14 @@ -1,5 +1,5 @@ -REQUIRED_VBOX_OSCODE='Ubuntu~raring' # raring: 13.04, but also used here. Should be changed when - # version for 14.04 appears on virtualbox.org. +REQUIRED_VBOX_OSCODE='Ubuntu~raring' # raring: 13.04, but also used here. Has not be changed when + # version for 14.04 appeared on virtualbox.org. REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/virtualbox-${REQUIRED_VBOX_VERSION_MAJOR}_${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}~${REQUIRED_VBOX_OSCODE}_${AMD64_I386}.deb" REQUIRED_VBOXEXTURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/Oracle_VM_VirtualBox_Extension_Pack-${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}.vbox-extpack" -- cgit v1.2.3-55-g7522