diff options
author | Michael Janczyk | 2010-04-08 21:07:44 +0200 |
---|---|---|
committer | Michael Janczyk | 2010-04-08 21:07:44 +0200 |
commit | 8ac3d72cd1ba2d9b76f6c201b6cb9f3389915cb6 (patch) | |
tree | 96242f130329608c1d97bec48576c802208635ed /os-plugins/plugins/virtualbox | |
parent | Merge branch 'master' into vmgrid (diff) | |
download | core-8ac3d72cd1ba2d9b76f6c201b6cb9f3389915cb6.tar.gz core-8ac3d72cd1ba2d9b76f6c201b6cb9f3389915cb6.tar.xz core-8ac3d72cd1ba2d9b76f6c201b6cb9f3389915cb6.zip |
virtualization plugin refurbished ;). booting 64bit guest on 32 bit hosts now possible /w virtualbox
Diffstat (limited to 'os-plugins/plugins/virtualbox')
4 files changed, 41 insertions, 13 deletions
diff --git a/os-plugins/plugins/virtualbox/XX_virtualbox.sh b/os-plugins/plugins/virtualbox/XX_virtualbox.sh index 07e58428..807ef0a8 100644 --- a/os-plugins/plugins/virtualbox/XX_virtualbox.sh +++ b/os-plugins/plugins/virtualbox/XX_virtualbox.sh @@ -87,7 +87,11 @@ if [ -e ${CONFFILE} ]; then mknod -m 0660 /dev/vboxdrv c 10 59 chown root:vboxusers /dev/vboxdrv + + # finished ... + [ $DEBUGLEVEL -gt 0 ] && echo "done with 'virtualbox' os-plugin ..." fi else - [ $DEBUGLEVEL -gt 0 ] && echo " * Configuration of virtualbox plugin failed" + [ $DEBUGLEVEL -gt 0 ] \ + && echo " * Configuration of 'virtualbox' plugin failed" fi diff --git a/os-plugins/plugins/virtualbox/files/machine.include b/os-plugins/plugins/virtualbox/files/machine.include index a76c7e6f..0482d03a 100644 --- a/os-plugins/plugins/virtualbox/files/machine.include +++ b/os-plugins/plugins/virtualbox/files/machine.include @@ -14,7 +14,7 @@ cat << EOF > "${machconfig}" <ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/> </ExtraData> <Hardware version="2"> - <CPU count="1"> + <CPU count="${cpu_cores}"> <HardwareVirtEx enabled="true" exclusive="true"/> <HardwareVirtExNestedPaging enabled="false"/> <HardwareVirtExVPID enabled="false"/> diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include index 5fc0641a..af5595ee 100644 --- a/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/os-plugins/plugins/virtualbox/files/run-virt.include @@ -66,7 +66,7 @@ diskfile="${diskfolder}/${imgname}" [ ${diskless} -eq 0 ] && ln -sf ${vmpath} ${diskfile} # check the file type -if echo ${imgname} | grep -iE "vdi|vmdk|vhd" && [ ${diskless} -eq 0 ]; then +if echo ${imgname} | grep -qiE "vdi|vmdk|vhd" && [ ${diskless} -eq 0 ]; then imgfmt=$(echo ${imgname##*.} | tr [a-z] [A-Z]) elif [ ${diskless} -eq 0 ]; then writelog "${imgname} is not a valid image format (vdi|vmdk|vhd), exiting!" @@ -76,17 +76,31 @@ fi # TODO: maybe rewrite, to reduce checks, merge it with network option, # so we can have a "compatibility to vmware config" section case "${vmostype}" in - winxp*) + winxp*|windowsxp*) vmostype="WindowsXP" ;; - winvista*) + winvista*|windowsvista*) vmostype="WindowsVista" ;; - Windows7*) + windows7*) vmostype="Windows7" ;; - linux*) - vmostype="Linux26" + linux*|*ubuntu*|*suse*|debian*|*sci*) + if echo "${vmostype}" | grep -q "64"; then + vmostype="Linux26_64" + # check for vtflag + if [ ${vtflag} -ne 1 ]; then + writelog "You are trying to boot a 64 bit OS without a VT enabled CPU" + writelog "This is not supported, exiting!" + exit 1 + fi + # check if host is only 32 bit, then use only 1 cpu (only 1 supported) + if echo "${host_arch}" | grep -qE "i.86"; then + cpu_cores=1 + fi + else + vmostype="Linux26" + fi ;; esac @@ -123,7 +137,7 @@ if echo "${imgmode}" | grep -q rw; then # lock existing? if [ -e "${vmpath}.lock" ]; then writelog "This rw image is already in use: ${vmpath}, exiting!" - writelog "Remove lock if you are shure that this is not the case" + writelog "Remove lock if you are sure that this is not the case" exit 1 # image rw? elif ! [ -w ${vmpath} ]; then @@ -144,6 +158,9 @@ elif [ ${diskless} -eq 0 ]; then | gunzip > "${snapshotdir}/{${snapshotuuid}}.vdi" fi +# make sure cpu_cores is not empty +cpu_cores=${cpu_cores:-"1"} + # TODO: MEM muss noch angepasst werden. Maschine crasht wenn nehr als 50% MEM # memory part equal to vmware plugin # percentage of memory to use for virtualbox in standard case @@ -222,7 +239,13 @@ case ${boot} in vm_name=$(echo ${vm_name} | sed -e "s, ,-,g") # link TFTP dir for NAT TFTP boots mkdir -p ${confdir}/TFTP - cp ${virtualbox_tftpdir}/pxelinux.0 ${confdir}/TFTP/${vm_name}.pxe + if [ -e ${virtualbox_tftpdir}/pxelinux.0 ]; then + cp ${virtualbox_tftpdir}/pxelinux.0 ${confdir}/TFTP/${vm_name}.pxe + else + writelog "${virtualbox_tftpdir}/pxelinux.0 not found!" + writelog "Network boot won't work, exiting!" + exit 1 + fi for i in $(ls ${virtualbox_tftpdir}); do ln -sf ${virtualbox_tftpdir}/${i} ${confdir}/TFTP/${i} done @@ -271,6 +294,7 @@ writelog "Diskimage:" writelog "\tMachine UUID:\t\t$machineuuid" [ ${diskless} -eq 0 ] && writelog "\tDisk UUID:\t\t$diskuuid" writelog "Virtual Hardware:" +[ ${vtflag} -eq 1 ] && writelog "\tVT enabled CPU" writelog "\tGuest RAM:\t\t${mem} MB" # echo nur wenn memhost gesetzt [ -n "${memhost}" ] && writelog "\tHost RAM:\t\t${memhost} MB" @@ -315,8 +339,8 @@ if [ ${diskless} -eq 1 ]; then sed -i "/<!-- PLEASE DO NOT REMOVE THIS COMMENT!!! -->/d" ${machconfig} fi -# add ssh port if linux and NAT -if [ "${vmostype}" = "Linux26" ] && [ "${network_kind}" = "NAT" ]; then +# add ssh port if Linux26* and NAT +if echo "${vmostype}" | grep -q "Linux26" && [ "${network_kind}" = "NAT" ]; then vmsshport="220${VM_ID}" extradataitem='<ExtraDataItem name="VBoxInternal/Devices' \ extradataitem="${extradataitem}/${network_card}/0/LUN#0/Config/ssh/" diff --git a/os-plugins/plugins/virtualbox/files/virtualbox.include b/os-plugins/plugins/virtualbox/files/virtualbox.include index 09a2f33b..2a7af026 100644 --- a/os-plugins/plugins/virtualbox/files/virtualbox.include +++ b/os-plugins/plugins/virtualbox/files/virtualbox.include @@ -10,7 +10,7 @@ cat << EOF > "${confdir}/VirtualBox.xml" <ExtraDataItem name="GUI/LicenseAgreed" value="7"/> <ExtraDataItem name="GUI/MaxGuestResolution" value="any"/> <!-- auto, width,height --> <ExtraDataItem name="GUI/SUNOnlineData" value="triesLeft=0"/> - <ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutAutoCapture,confirmInputCapture,remindAboutWrongColorDepth,confirmGoingFullscreen,remindAboutMouseIntegrationOn,remindAboutMouseIntegrationOff,showRuntimeError.warning.DevATA_DISKFULL,remindAboutPausedVMInput,confirmVMReset"/> + <ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutAutoCapture,confirmInputCapture,remindAboutWrongColorDepth,confirmGoingFullscreen,remindAboutMouseIntegrationOn,remindAboutMouseIntegrationOff,showRuntimeError.warning.DevATA_DISKFULL,remindAboutPausedVMInput,confirmVMReset,showRuntimeError.warning.HostAudioNotResponding"/> <ExtraDataItem name="GUI/TrayIcon/Enabled" value="false"/> <ExtraDataItem name="GUI/UpdateCheckCount" value="2"/> <ExtraDataItem name="GUI/UpdateDate" value="never"/> |