diff options
Diffstat (limited to 'remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include')
-rwxr-xr-x | remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include | 37 |
1 files changed, 33 insertions, 4 deletions
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="<SharedFolders> + <SharedFolder name=\"${homesharename}\" hostPath=\"${homesharepath}\" writable=\"true\"/> + <SharedFolder name=\"${commonsharename}\" hostPath=\"${commonsharepath}\" writable=\"true\"/> + </SharedFolders>" +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 |