From bafde168ea55336dbf3efec9e61ebb236da673f1 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Sun, 22 Aug 2010 14:30:51 +0200 Subject: cdrom support for vbox added --- .../plugins/virtualbox/files/run-virt.include | 43 ++++++---------------- 1 file changed, 12 insertions(+), 31 deletions(-) (limited to 'os-plugins/plugins/virtualbox/files/run-virt.include') diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include index 9dbe47ac..a4b3454b 100644 --- a/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/os-plugins/plugins/virtualbox/files/run-virt.include @@ -266,32 +266,6 @@ enablevt="false" # external GUI vrdpport=${remotedesktopport} -# 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" -fdtest= -fdtest=${floppy_0:+"TRUE"} -# if $fdtest not set floppy0="FALSE", else "TRUE" -floppy0=${fdtest:-"FALSE"} -floppy1="TRUE" -floppy1name="/var/lib/virt/vmchooser/loopimg/fd.img" -# if $cdrom_0 from run-virt.include set then cdtest="TRUE" -cdtest= -cdtest=${cdrom_0:+"TRUE"} -# if $cdtest not set cdrom0="FALSE", else "TRUE" -cdrom0=${cdtest:-"FALSE"} -# if $cdrom_1 from run-virt.include set then cdtest="TRUE" -cdtest= -cdtest=${cdrom_1:+"TRUE"} -# if $cdtest not set cdrom1="FALSE", else "TRUE" -cdrom1=${cdtest:-"FALSE"} -# ide is expected default, test for the virtual disk image type should -# be done while creating the runscripts ... -ide="TRUE" -hddrv="ide" -audio=${audio:-"true"} - [ ${diskless} -eq 0 ] && writelog "\tSnapshots dir:\t\t$snapshotdir" writelog "Diskimage:" [ ${diskless} -eq 0 ] && writelog "\tDisk file:\t\t$diskfile" @@ -315,10 +289,10 @@ writelog "\tBooting from:\t\t${boot}\c" [ ${diskless} -eq 1 ] && writelog " 'diskless'" # 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 "\tCD-ROM1:\t\t${cdrom0}" +#writelog "\tCD-ROM2:\t\t${cdrom1}" +#writelog "\tFloppy_A:\t\t${floppy0}" +#writelog "\tFloppy_B:\t\t${floppy1}" # defined in run-virt.sh and run-vmgrid.sh writelog "\tShared Folders '${sharename}':\t${sharepath}" @@ -340,12 +314,19 @@ fi # create machine.xml . ${PLUGINCONFVIRTUALBOX}/machine.include +# remove CD-ROM +if [ "${cdrom0}" != "TRUE" ]; then + sed -i "/HostDrive/d" ${machconfig} + sed -i '/AttachedDevice.*type="DVD"/d' ${machconfig} + sed -i "//d" ${machconfig} +fi + # if diskless remove all disks if [ ${diskless} -eq 1 ]; then sed -i "//d" ${machconfig} + sed -i "//d" ${machconfig} fi # define redirects -- cgit v1.2.3-55-g7522