diff options
author | Christian Rößler | 2015-05-12 17:08:08 +0200 |
---|---|---|
committer | Christian Rößler | 2015-05-12 17:08:08 +0200 |
commit | b60f27776ba0e1cf08ed864abe19dc9ba0283f2f (patch) | |
tree | 5e8c642a90c151b20384083404c1f5dc7261bb1e /remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
download | tm-scripts-b60f27776ba0e1cf08ed864abe19dc9ba0283f2f.tar.gz tm-scripts-b60f27776ba0e1cf08ed864abe19dc9ba0283f2f.tar.xz tm-scripts-b60f27776ba0e1cf08ed864abe19dc9ba0283f2f.zip |
[vbox] CAUTION: COMPATIBILITY BREAK to V3! virtualbox runs now, needs further
work eg. fullscreen, Shared folders, less GUI messages etc.
Diffstat (limited to 'remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox')
3 files changed, 160 insertions, 64 deletions
diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include index d1c77f02..48610aea 100644 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include @@ -9,39 +9,49 @@ # # General information about OpenSLX can be found at http://openslx.org # ----------------------------------------------------------------------------- -# Include file (machine template) for run-virt.include of the OpenSLX virtual- -# box plugin +# Include file (general template) for run-virt.include of the virtualbox plugin + cat << EOF > "${machconfig}" <?xml version="1.0"?> -<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-linux"> +<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux"> <Machine uuid="{${machineuuid}}" name="${vm_name}" OSType="${vmostype}"> + <MediaRegistry> + <HardDisks> + <HardDisk uuid="{${diskuuid}}" location="${diskfile}" format="${imgfmt}" type="${imgtype}"/> + </HardDisks> + <FloppyImages/> + </MediaRegistry> +<!-- <ExtraData> - <ExtraDataItem name="GUI/AutoresizeGuest" value="on"/> - <ExtraDataItem name="GUI/Fullscreen" value="on"/> - <ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/> - <ExtraDataItem name="GUI/MiniToolBarAutoHide" value="on"/> - <ExtraDataItem name="GUI/MiniToolBarAlignment" value="top"/> - <ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/> - <ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/> - <ExtraDataItem name="GUI/Seamless" value="off"/> + <ExtraDataItem name="GUI/LastGuestSizeHint" value="1024,768"/> + <ExtraDataItem name="GUI/LastNormalWindowPosition" value="2393,123,1024,809"/> </ExtraData> +--> <Hardware version="2"> - <CPU count="${cpu_cores}"> - <HardwareVirtEx enabled="${enablevt}" exclusive="true"/> + <CPU count="${cpu_cores}" hotplug="false"> + <HardwareVirtEx enabled="${enablevt}"/> <HardwareVirtExNestedPaging enabled="${npaging}"/> - <HardwareVirtExVPID enabled="false"/> + <HardwareVirtExVPID enabled="true"/> + <HardwareVirtExUX enabled="true"/> <PAE enabled="true"/> + <LongMode enabled="false"/> + <HardwareVirtExLargePages enabled="false"/> + <HardwareVirtForce enabled="false"/> </CPU> - <Memory RAMSize="${mem}"/> + <Memory RAMSize="${mem}" PageFusion="false"/> + <HID Pointing="USBTablet" Keyboard="PS2Keyboard"/> + <HPET enabled="false"/> + <Chipset type="ICH9"/> <Boot> <Order position="1" device="${boot}"/> <!-- HardDisk, DVD, Network, Floppy --> <Order position="2" device="None"/> <Order position="3" device="None"/> <Order position="4" device="None"/> </Boot> - <!-- check for xml configured enable3d parameter --> <Display VRAMSize="${vram}" monitorCount="1" accelerate3D="${enable3d}" accelerate2DVideo="${enable2d}"/> - <!-- authType="External", "Guest", "Null" --> + +<!-- <VideoCapture enabled="false" screens="18446744073709551615" horzRes="1024" vertRes="768" rate="512" fps="25"/> --> + <RemoteDisplay enabled="false" port="${vrdpport}" authType="Null" authTimeout="5000"/> <BIOS> <ACPI enabled="true"/> @@ -51,74 +61,131 @@ cat << EOF > "${machconfig}" <TimeOffset value="0"/> <PXEDebug enabled="false"/> </BIOS> - <USBController enabled="true" enabledEhci="true"/> +<!-- ehci ussw. noch prüfen! --> + <USB> + <Controllers> + <Controller name="OHCI" type="OHCI"/> + </Controllers> + <DeviceFilters/> + </USB> <Network> <Adapter slot="0" enabled="true" MACAddress="${macaddr}" cable="true" speed="0" type="${vb_network_card}"> - <${network_kind}/> + <${network_kind}/> </Adapter> <Adapter slot="1" enabled="false" MACAddress="${vdemacaddr}" cable="true" speed="0" type="${vb_network_card}"> - <GenericInterface driver="VDE"> + <GenericInterface driver="VDE"> <Properties name="network" value="/tmp/vde-switch"/> </GenericInterface> </Adapter> - <Adapter slot="2" enabled="false" MACAddress="080027A3A3CC" cable="true" speed="0" type="Am79C973"/> - <Adapter slot="3" enabled="false" MACAddress="0800277356CC" cable="true" speed="0" type="Am79C973"/> - <Adapter slot="4" enabled="false" MACAddress="080027CEA8CC" cable="true" speed="0" type="Am79C973"/> - <Adapter slot="5" enabled="false" MACAddress="0800271B8DCC" cable="true" speed="0" type="Am79C973"/> - <Adapter slot="6" enabled="false" MACAddress="08002771BBCC" cable="true" speed="0" type="Am79C973"/> - <Adapter slot="7" enabled="false" MACAddress="080027EB6ACC" cable="true" speed="0" type="Am79C973"/> + <Adapter slot="2" enabled="false" MACAddress="080027CB8CD8" cable="true" speed="0" type="82540EM" /> + <Adapter slot="3" enabled="false" MACAddress="080027424034" cable="true" speed="0" type="82540EM" /> + <Adapter slot="4" enabled="false" MACAddress="0800272CD0EA" cable="true" speed="0" type="82540EM" /> + <Adapter slot="5" enabled="false" MACAddress="080027ED7227" cable="true" speed="0" type="82540EM" /> + <Adapter slot="6" enabled="false" MACAddress="080027B77757" cable="true" speed="0" type="82540EM" /> + <Adapter slot="7" enabled="false" MACAddress="0800272267D8" cable="true" speed="0" type="82540EM" /> + <Adapter slot="8" enabled="false" MACAddress="080027573BF5" cable="true" speed="0" type="Am79C973" /> </Network> <UART> <Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/> - <Port slot="1" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/> + <Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/> </UART> <LPT> - <Port slot="0" enabled="false" IOBase="0x378" IRQ="4"/> - <Port slot="1" enabled="false" IOBase="0x378" IRQ="4"/> + <Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/> + <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/> </LPT> +<!-- <AudioAdapter controller="${guestaudio}" driver="Pulse" enabled="true"/> --> + <AudioAdapter controller="${guestaudio}" driver="Alsa" enabled="${audio}"/> + <RTC localOrUTC="UTC"/> <!-- should be configured depending on the chosen operating system --> - <AudioAdapter controller="${guestaudio}" driver="Alsa" enabled="${audio}"/> <!-- OSS, Alsa, Pulse --> - <!-- should be configured depending on the chosen operating system --> - <SharedFolders> + $sharelist +<!-- <SharedFolders> <SharedFolder name="${sharename}" hostPath="${sharepath}" writable="true"/> - </SharedFolders> + <SharedFolder name="${homesharename}" hostPath="${homesharepath}" writable="true"/> + <SharedFolder name="${commonsharename}" hostPath="${commonsharepath}" writable="true"/> + </SharedFolders> --> +<!-- <Clipboard mode="Disabled"/> --> <Clipboard mode="Bidirectional"/> - <Guest memoryBalloonSize="0" statisticsUpdateInterval="0"/> - <!-- + <DragAndDrop mode="Disabled"/> + <IO> + <IoCache enabled="true" size="5"/> + <BandwidthGroups/> + </IO> + <HostPci> + <Devices/> + </HostPci> + <EmulatedUSB> + <CardReader enabled="false"/> + </EmulatedUSB> + <Guest memoryBalloonSize="0"/> <GuestProperties> - <GuestProperty name="/VirtualBox/HostGuest/SysprepExec" value="" timestamp="1268140071072799000" flags="TRANSIENT, RDONLYGUEST"/> - <GuestProperty name="/VirtualBox/HostGuest/SysprepArgs" value="" timestamp="1268140071072949000" flags="TRANSIENT, RDONLYGUEST"/> - <GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Linux" timestamp="1268140267864540000" flags=""/> - <GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="4.1.2" timestamp="1268140267894449000" flags=""/> - <GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsersList" value="vbox" timestamp="1268164075149967000" flags=""/> +<!-- <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxControl.exe" value="4.3.26r98988" timestamp="1430324928738330000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxCredProv.dll" value="-" timestamp="1430324928808993000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxDisp.dll" value="4.3.26r98988" timestamp="1430324928752750000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGINA.dll" value="-" timestamp="1430324928808417000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGuest.sys" value="4.3.26r98988" timestamp="1430324928908144000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxHook.dll" value="4.3.26r98988" timestamp="1430324928750553000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMMR.exe" value="-" timestamp="1430324928809525000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMMRHook.dll" value="-" timestamp="1430324928809992000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMRXNP.dll" value="4.3.26r98988" timestamp="1430324928777003000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMouse.sys" value="4.3.26r98988" timestamp="1430324928909743000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGL.dll" value="4.3.26r98988" timestamp="1430324928901186000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLarrayspu.dll" value="4.3.26r98988" timestamp="1430324928823307000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLcrutil.dll" value="4.3.26r98988" timestamp="1430324928837623000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLerrorspu.dll" value="4.3.26r98988" timestamp="1430324928846343000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLfeedbackspu.dll" value="4.3.26r98988" timestamp="1430324928884750000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLpackspu.dll" value="4.3.26r98988" timestamp="1430324928865359000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLpassthroughspu.dll" value="4.3.26r98988" timestamp="1430324928872533000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxSF.sys" value="4.3.26r98988" timestamp="1430324928911340000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxService.exe" value="4.3.26r98988" timestamp="1430324928784233000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxTray.exe" value="4.3.26r98988" timestamp="1430324928807478000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxVideo.sys" value="4.3.26r98988" timestamp="1430324928913222000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/HostVerLastChecked" value="4.3.26" timestamp="1430324950071952000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/InstallDir" value="C:/Program Files/Oracle/VirtualBox_Guest_Additions" timestamp="1430324928718085000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Revision" value="98988" timestamp="1430324928712396000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/Version" value="4.3.26" timestamp="1430324928711533000" flags=""/> + <GuestProperty name="/VirtualBox/GuestAdd/VersionExt" value="4.3.26" timestamp="1430324928711988000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/Net/0/MAC" value="080027CAF695" timestamp="1430324954369734000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/Net/0/Status" value="Up" timestamp="1430324954369295000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Broadcast" value="255.255.255.255" timestamp="1430324954368391000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/IP" value="10.0.2.15" timestamp="1430324954367074000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Netmask" value="255.255.255.0" timestamp="1430324954368890000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="1" timestamp="1430324984558751000" flags=""/> +--> +<!-- + <GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsers" value="1" timestamp="1430324933845802000" flags="TRANSIENT, TRANSRESET"/> +--> + <GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsersList" value="student" timestamp="1430324933844717000" flags="TRANSIENT, TRANSRESET"/> +<!-- + <GuestProperty name="/VirtualBox/GuestInfo/OS/NoLoggedInUsers" value="false" timestamp="1430324933847595000" flags="TRANSIENT, TRANSRESET"/> +--> + <GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Windows 7" timestamp="1430324928709396000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="6.1.7601" timestamp="1430324928710175000" flags=""/> +<!-- + <GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="1" timestamp="1430324928711029000" flags=""/> + <GuestProperty name="/VirtualBox/GuestInfo/User/student@student-PC/UsageState" value="Idle" timestamp="1430324979531817000" flags="TRANSIENT, TRANSRESET"/> + <GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="de_DE" timestamp="1430324985485377000" flags=""/> +--> </GuestProperties> - --> </Hardware> - <!-- should be configured depending on the chosen operating system --> <StorageControllers> - <StorageController name="IDE Controller" type="PIIX4" PortCount="2"> + <StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true"> <AttachedDevice type="HardDisk" port="0" device="0"> - <Image uuid="{${imageuuid}}"/> + <Image uuid="${imageuuid}"/> </AttachedDevice> <!-- PLEASE DO NOT REMOVE THIS COMMENT (HD)!!! --> <AttachedDevice passthrough="false" type="DVD" port="0" device="1"> <HostDrive src="${cdrom_0}"/> +<!-- <Image uuid="{849a61c7-ad64-4594-b0c8-fbe17dc3d2a6}"/> --> </AttachedDevice> <!-- PLEASE DO NOT REMOVE THIS COMMENT (CD)!!! --> </StorageController> - <StorageController name="Floppy Controller" type="I82078" PortCount="1"> - <AttachedDevice type="Floppy" port="0" device="0"> - </AttachedDevice> - <AttachedDevice type="Floppy" port="0" device="1"> - <Image uuid="{288d5452-2dd3-44f2-bfc8-78e205a4fa87}"/> - </AttachedDevice> - </StorageController> - <!-- - <StorageController name="SCSI Controller" type="LsiLogic" PortCount="16"> - <AttachedDevice type="HardDisk" port="0" device="0"> - <Image uuid="{812c82bf-bd1a-4f59-a5b6-b54ae2f6c669}"/> - </AttachedDevice> + <StorageController name="Floppy Controller" type="I82078" PortCount="1"> + <AttachedDevice type="Floppy" port="0" device="0"> + </AttachedDevice> + <AttachedDevice type="Floppy" port="0" device="1"> + <Image uuid="{288d5452-2dd3-44f2-bfc8-78e205a4fa87}"/> + </AttachedDevice> </StorageController> - --> </StorageControllers> </Machine> </VirtualBox> EOF + 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 diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include index 477eebde..36c8ab80 100644 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2010..2013 - OpenSLX GmbH +# Copyright (c) 2010..2012 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -10,9 +10,9 @@ # General information about OpenSLX can be found at http://openslx.org # ----------------------------------------------------------------------------- # Include file (general template) for run-virt.include of the virtualbox plugin + cat << EOF > "${confdir}/VirtualBox.xml" -<?xml version="1.0"?> -<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-linux"> <!-- 1.12-linux --> +<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-linux"> <Global> <ExtraData> <ExtraDataItem name="GUI/Input/AutoCapture" value="true"/> |