diff options
author | Michael Janczyk | 2010-08-22 14:30:51 +0200 |
---|---|---|
committer | Michael Janczyk | 2010-08-22 14:30:51 +0200 |
commit | bafde168ea55336dbf3efec9e61ebb236da673f1 (patch) | |
tree | 6509e5eeb2c9703a14142d31f41a0c4427b0f061 /os-plugins/plugins/virtualbox | |
parent | ... (diff) | |
download | core-bafde168ea55336dbf3efec9e61ebb236da673f1.tar.gz core-bafde168ea55336dbf3efec9e61ebb236da673f1.tar.xz core-bafde168ea55336dbf3efec9e61ebb236da673f1.zip |
cdrom support for vbox added
Diffstat (limited to 'os-plugins/plugins/virtualbox')
-rw-r--r-- | os-plugins/plugins/virtualbox/files/machine.include | 10 | ||||
-rw-r--r-- | os-plugins/plugins/virtualbox/files/run-virt.include | 43 |
2 files changed, 16 insertions, 37 deletions
diff --git a/os-plugins/plugins/virtualbox/files/machine.include b/os-plugins/plugins/virtualbox/files/machine.include index 8d1e23c4..96acd7a2 100644 --- a/os-plugins/plugins/virtualbox/files/machine.include +++ b/os-plugins/plugins/virtualbox/files/machine.include @@ -111,12 +111,10 @@ cat << EOF > "${machconfig}" <StorageController name="IDE-Controller" type="PIIX4" PortCount="2"> <AttachedDevice type="HardDisk" port="0" device="0"> <Image uuid="{${imageuuid}}"/> - </AttachedDevice> <!-- PLEASE DO NOT REMOVE THIS COMMENT!!! --> - <!-- - <AttachedDevice passthrough="false" type="DVD" port="0" device="0"> - <Image uuid="{dcd1e32a-729f-4faa-b319-67adca15e4a4}"/> - </AttachedDevice> - --> + </AttachedDevice> <!-- PLEASE DO NOT REMOVE THIS COMMENT (HD)!!! --> + <AttachedDevice passthrough="false" type="DVD" port="0" device="1"> + <HostDrive src="${cdrom_0}"/> + </AttachedDevice> <!-- PLEASE DO NOT REMOVE THIS COMMENT (CD)!!! --> </StorageController> <!-- <StorageController name="Disketten-Controller" type="I82078" PortCount="1"> 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 "/<!-- PLEASE DO NOT REMOVE THIS COMMENT (CD)!!! -->/d" ${machconfig} +fi + # if diskless remove all disks if [ ${diskless} -eq 1 ]; then sed -i "/<HardDisk/d;/<\/HardDisk/d" "${confdir}/VirtualBox.xml" sed -i "/${imageuuid}/d" ${machconfig} sed -i '/AttachedDevice type="HardDisk"/d' ${machconfig} - sed -i "/<!-- PLEASE DO NOT REMOVE THIS COMMENT!!! -->/d" ${machconfig} + sed -i "/<!-- PLEASE DO NOT REMOVE THIS COMMENT (HD)!!! -->/d" ${machconfig} fi # define redirects |