summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/virtualbox/files/run-virt.include
diff options
context:
space:
mode:
authorMichael Janczyk2010-03-22 19:06:22 +0100
committerMichael Janczyk2010-03-22 19:06:22 +0100
commit3f82922eef9a7b3e894d629d6cac59cadb66e2de (patch)
tree6a01c4c65bb88da9e268d1c3bddac520fa8811b2 /os-plugins/plugins/virtualbox/files/run-virt.include
parentqemukvm angepasst... geht noch nicht :( (diff)
downloadcore-3f82922eef9a7b3e894d629d6cac59cadb66e2de.tar.gz
core-3f82922eef9a7b3e894d629d6cac59cadb66e2de.tar.xz
core-3f82922eef9a7b3e894d629d6cac59cadb66e2de.zip
small bugfix regarding xmlfile and paths.
writelog now additional into rwshare. virtualbox rmdirs new. qemukvm plugin added new konfigurations and headless support, to be tested
Diffstat (limited to 'os-plugins/plugins/virtualbox/files/run-virt.include')
-rw-r--r--os-plugins/plugins/virtualbox/files/run-virt.include23
1 files changed, 13 insertions, 10 deletions
diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include
index 62ef769d..eb1cb0e9 100644
--- a/os-plugins/plugins/virtualbox/files/run-virt.include
+++ b/os-plugins/plugins/virtualbox/files/run-virt.include
@@ -37,7 +37,9 @@ mkdir -m 1777 /tmp/${self} 2>/dev/null
confdir="/tmp/${self}/${USER}/${VM_ID}"
# use alternate configuration directory instead of $HOME/.VirtualBox
export VBOX_USER_HOME=${confdir}
-rm -rf ${VBOX_USER_HOME}/* /tmp/.vbox-${USER}-ipc
+# define dirs and files which can be removed after exit, be carefull!
+RMDIRS="${snapshotdir} ${confdir} /tmp/.vbox-${USER}-ipc" 2>/dev/null
+rm -rf ${RMDIRS} 2>/dev/null
machfolder="${VBOX_USER_HOME}/Machines"
# imgname is the name of the virtual image file
# use vm_shortname since vm_name can be very long
@@ -45,16 +47,16 @@ vm_shortname=$(echo ${imgname%.*} | sed -e "s, ,-,g")
machconfig="${machfolder}/${vm_shortname}/${vm_shortname}.xml"
diskfolder="${VBOX_USER_HOME}/HardDisks"
snapshotdir=${machfolder}/${vm_shortname}/Snapshots
-# imgname is the name of the virtual image file
diskfile="${diskfolder}/${imgname}"
-mkdir -p ${diskfolder} ${snapshotdir}
+mkdir -p ${diskfolder} ${snapshotdir} 2>/dev/null
ln -sf ${vmpath} ${diskfile}
# check the file type
if echo ${imgname} | grep -iE "vdi" >/dev/null 2>&1; then #vmdk|vhd
imgtype=$(echo ${imgname#*.} | tr [a-z] [A-Z])
else
- writelog "${imgname} is not a valid image type (vdi)" #vmdk|vhd
+ writelog "${imgname} is not a valid image type (vdi), exiting!" #vmdk|vhd
+ exit 1
fi
# TODO: maybe rewrite, to reduce checks, merge it with network option,
@@ -151,7 +153,7 @@ case "${network_kind}" in
bridged)
network_kind='BridgedInterface name="br0"'
;;
- host-only)
+ hostonly|host-only)
network_kind='HostOnlyInterface name="vboxnet0"'
;;
*)
@@ -159,8 +161,10 @@ case "${network_kind}" in
;;
esac
+# external GUI
vrdpport="590${VM_ID}"
+# TODO: nur bei vmchooser
# TODO: most of the following does not make much sense yet ...
# virtual fd/cd/dvd and drive devices, floppy b: for configuration
# if $floppy_0 from run-virt.include set then fdtest="TRUE"
@@ -200,9 +204,12 @@ writelog "\tGuest RAM:\t\t${mem} MB"
writelog "\tMAC address:\t\t$macaddr"
writelog "\tNetwork card:\t\t${vb_network_card}"
writelog "\tNetwork kind:\t\t${network_kind}"
+# TODO: server start activate via xml, etc...
+#writelog "\tGuest VRDP port:\t${vrdpport}"
#writelog "\tCD-ROM1:\t${cdrom0}"
#writelog "\tCD-ROM2:\t${cdrom1}"
#writelog "\tFloppy_A:\t${floppy0}"
+#writelog "\tFloppy_B:\t${floppy1}"
writelog "\tShared Folders 'home':\t/home/${USER}"
################################################################################
@@ -245,7 +252,7 @@ cat ${OPENSLX_DEFAULT_DIR}/plugin-repo/virtualbox/empty-diff.vdi.gz | \
gunzip > "${snapshotdir}/{${snapshotuuid}}.vdi"
################################################################################
-# finally set env for run-virt.sh
+### finally set env for run-virt.sh
################################################################################
# wait for a certain command to settle
@@ -268,9 +275,6 @@ done
# fi
#done
-# define dirs and files which can be removed after exit, be carefull!
-RMDIRS="${snapshotdir} ${confdir}"
-
# set the variables appropriately (several interfaces with different names)
VIRTCMD=$(which VirtualBox 2>/dev/null)
VIRTCMDOPTS="--startvm ${machineuuid} --start-running"
@@ -283,4 +287,3 @@ VIRTCMDOPTS="--startvm ${machineuuid} --start-running"
# set headless mode
VIRTCMDHL=$(which VBoxHeadless 2>/dev/null)
VIRTCMDOPTSHL="-s ${machineuuid}"
-