summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk2012-11-27 15:49:43 +0100
committerDirk2012-11-27 15:49:43 +0100
commit74be7469519e6201dd345359e5a396b2a8fafd6b (patch)
tree1f33648ecbf56fb786d7d98c29fa43236a68a9ea
parentSupport older X86 OS in VMware ... (diff)
downloadcore-74be7469519e6201dd345359e5a396b2a8fafd6b.tar.gz
core-74be7469519e6201dd345359e5a396b2a8fafd6b.tar.xz
core-74be7469519e6201dd345359e5a396b2a8fafd6b.zip
Working on VirtualBox for OpenSLX clients ... (including changes for vmchooser)
-rw-r--r--src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Base.pm4
-rw-r--r--src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm4
-rw-r--r--src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Suse.pm8
-rw-r--r--src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm5
-rw-r--r--src/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm31
-rw-r--r--src/os-plugins/plugins/virtualbox/XX_virtualbox.sh9
-rw-r--r--src/os-plugins/plugins/virtualbox/files/machine.include78
-rw-r--r--src/os-plugins/plugins/virtualbox/files/run-virt.include71
-rw-r--r--src/os-plugins/plugins/virtualbox/files/virtualbox.include16
-rw-r--r--src/os-plugins/plugins/vmchooser/XX_vmchooser.sh7
-rw-r--r--src/os-plugins/plugins/vmchooser/files/run-virt.sh2
-rw-r--r--src/os-plugins/plugins/vmware/XX_vmware.sh7
-rw-r--r--src/os-plugins/plugins/vmware/files/README2
-rw-r--r--src/os-plugins/plugins/vmware/files/run-virt.include95
14 files changed, 185 insertions, 154 deletions
diff --git a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Base.pm b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Base.pm
index d26cdfcc..fb23c4f8 100644
--- a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Base.pm
+++ b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Base.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 - OpenSLX GmbH
+# Copyright (c) 2012 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -50,7 +50,7 @@ sub installVbox
my $engine = $self->{'engine'};
- # lets try it... we can't loose anything :)
+ # lets try it ... but better have it installed in the clone source system
$engine->installPackages('virtualbox-ose');
return;
diff --git a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm
index edd117ca..eeaa0627 100644
--- a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm
+++ b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 - OpenSLX GmbH
+# Copyright (c) 2012 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -34,7 +34,6 @@ sub installVbox
my $release = `lsb_release -rs`;
chomp($release);
- # lenny(5.0) has v1.6
# testing is ok. but no clue which lsb_release -rs it has...
if ( $release eq "999999.0") {
#the usual "in stage1 chroot we get another kernel vers. problem"
@@ -43,6 +42,7 @@ sub installVbox
#system('/etc/init.d/virtualbox-ose setup');
} else {
print "Couldn't install VirtualBox, no package from distribution\n";
+ print "Install and configure VirtualBox in your clone source\n";
exit;
}
diff --git a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Suse.pm b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Suse.pm
index 9af3191e..6b571d6b 100644
--- a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Suse.pm
+++ b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Suse.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 - OpenSLX GmbH
+# Copyright (c) 2012 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -35,10 +35,12 @@ sub installVbox
my $release = `lsb_release -rs`;
chomp($release);
- if ( $release eq "11.1" || $release eq "11.0" || $release eq "10.3") {
- $engine->installPackages('virtualbox-ose');
+ if ( $release eq "12.2" || $release eq "12.1" ) {
+ $engine->installPackages('VirtualBox');
} else {
print "Couldn't install VirtualBox, no package from distribution\n";
+ print "Install and configure VirtualBox in your clone source\n";
+
exit;
}
diff --git a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm
index 44695680..ac270747 100644
--- a/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm
+++ b/src/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 - OpenSLX GmbH
+# Copyright (c) 2012 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -36,7 +36,7 @@ sub installVbox
my $release = `lsb_release -rs`;
chomp($release);
- # hardy (8.04LTS): only version VBox v1.5
+ # does not really makes sense to install it into stage2
if ( $release eq "8.10" || $release eq "9.04") {
#the usual "in stage1 chroot we get another kernel vers. problem"
# kernel modules need to be installed from the cloned system
@@ -44,6 +44,7 @@ sub installVbox
#system('/etc/init.d/virtualbox-ose setup');
} else {
print "Couldn't install VirtualBox, no package from distribution!\n";
+ print "Install and configure VirtualBox in your clone source\n";
exit;
}
diff --git a/src/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm b/src/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
index 07ec9dc0..d07cd92f 100644
--- a/src/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
+++ b/src/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
@@ -1,5 +1,5 @@
# Copyright (c) 2009..2010 - RZ Uni Freiburg
-# Copyright (c) 2009..2010 - OpenSLX GmbH
+# Copyright (c) 2009..2012 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -85,8 +85,6 @@ sub getAttrInfo
},
# attribute 'bridge' defines if bridged network mode should be
# switched on
- # TODO: change to net -> nat, bridge, hostonly?
- # TODO: since we use def in XML maybe use to override
'virtualbox::bridge' => {
applies_to_systems => 1,
applies_to_clients => 1,
@@ -98,30 +96,6 @@ sub getAttrInfo
content_descr => '0 or 1',
default => '1',
},
- # attribute 'mem' defines if memory should be forced
- 'virtualbox::mem' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- Do you want to force a ralative amount of RAM?
- (Not implemented right now!)
- End-of-Here
- content_regex => qr{^(\d\d??)$},
- content_descr => 'Between 0 - 99',
- default => undef,
- },
- # attribute 'kvm' defines if KVM modules should be forced
- 'virtualbox::kvm' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- Do you want to force the usage of KVM modules where applicable?
- (Not implemented right now!)
- End-of-Here
- content_regex => qr{^(0|1)$},
- content_descr => '0 or 1',
- default => undef,
- },
# attribute 'tftpdir' defines TFTP dir for network boots /w NAT
'virtualbox::tftpdir' => {
applies_to_systems => 1,
@@ -192,7 +166,6 @@ sub checkStage3AttrValues
my $self = shift;
my $stage3Attrs = shift;
my $vendorOSAttrs = shift;
- #my @problems;
#my $vmimg = $stage3Attrs->{'virtualbox::imagesrc'} || '';
@@ -209,7 +182,7 @@ sub _writeRunlevelScript
$initfile->setName("vbox-slx");
$initfile->setDesc("Setup environment for virtualbox. Part of OpenSLX virtualbox plugin.");
- # todo: Function need to be formated proper... not important right now
+ # todo: Function need to be formated properly ...
$initfile->addFunction(
'running',
'lsmod | grep -q "$1[^_-]"'
diff --git a/src/os-plugins/plugins/virtualbox/XX_virtualbox.sh b/src/os-plugins/plugins/virtualbox/XX_virtualbox.sh
index b54b4bec..e92b930d 100644
--- a/src/os-plugins/plugins/virtualbox/XX_virtualbox.sh
+++ b/src/os-plugins/plugins/virtualbox/XX_virtualbox.sh
@@ -1,5 +1,5 @@
# Copyright (c) 2009..2010 - RZ Uni Freiburg
-# Copyright (c) 2009..2010 - OpenSLX GmbH
+# Copyright (c) 2009..2012 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -89,6 +89,13 @@ if [ -e ${CONFFILE} ]; then
mknod -m 0660 /dev/vboxdrv c 10 59
chown root:vboxusers /dev/vboxdrv
+ # setting the base samba configuration
+# [ -f /mnt/opt/openslx/plugins/virtualization/smb.conf -a -f /mnt/usr/sbin/smbd ] && \
+# sed -e "s,NWIF,vboxnet0,;s,PIDDIR,/var/run/vbox," \
+# /mnt/opt/openslx/plugins/virtualization/smb.conf \
+# >/mnt/etc/vbox/smb.conf
+ fi
+
# finished ...
[ $DEBUGLEVEL -gt 0 ] && echo "done with 'virtualbox' os-plugin ..."
fi
diff --git a/src/os-plugins/plugins/virtualbox/files/machine.include b/src/os-plugins/plugins/virtualbox/files/machine.include
index 96acd7a2..7b81390d 100644
--- a/src/os-plugins/plugins/virtualbox/files/machine.include
+++ b/src/os-plugins/plugins/virtualbox/files/machine.include
@@ -1,17 +1,17 @@
-# Include file (machine template) for run-virt.include of the virtualbox plugin
+# Include file (machine template) for run-virt.include of the OpenSLX virtualbox plugin
cat << EOF > "${machconfig}"
<?xml version="1.0"?>
-<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.9-linux">
+<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-linux">
<Machine uuid="{${machineuuid}}" name="${vm_name}" OSType="${vmostype}">
<ExtraData>
<ExtraDataItem name="GUI/AutoresizeGuest" value="on"/>
<ExtraDataItem name="GUI/Fullscreen" value="on"/>
<ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/>
- <ExtraDataItem name="GUI/MiniToolBarAlignment" value="top"/>
<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/ShowMiniToolBar" value="yes"/>
</ExtraData>
<Hardware version="2">
<CPU count="${cpu_cores}">
@@ -27,7 +27,8 @@ cat << EOF > "${machconfig}"
<Order position="3" device="None"/>
<Order position="4" device="None"/>
</Boot>
- <Display VRAMSize="24" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/>
+ <!-- check for xml configured enable3d parameter -->
+ <Display VRAMSize="24" monitorCount="1" accelerate3D="${enable3d}" accelerate2DVideo="true"/>
<!-- authType="External", "Guest", "Null" -->
<RemoteDisplay enabled="false" port="${vrdpport}" authType="Null" authTimeout="5000"/>
<BIOS>
@@ -43,13 +44,13 @@ cat << EOF > "${machconfig}"
<Adapter slot="0" enabled="true" MACAddress="${macaddr}" cable="true" speed="0" type="${vb_network_card}">
<${network_kind}/>
</Adapter>
- <Adapter slot="1" enabled="false" MACAddress="0800279312FB" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="2" enabled="false" MACAddress="080027A3A3CA" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="3" enabled="false" MACAddress="0800277356F6" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="4" enabled="false" MACAddress="080027CEA83A" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="5" enabled="false" MACAddress="0800271B8D7A" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="6" enabled="false" MACAddress="08002771BBD7" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="7" enabled="false" MACAddress="080027EB6A12" cable="true" speed="0" type="Am79C973"/>
+ <Adapter slot="1" enabled="false" MACAddress="0800279312CC" cable="true" speed="0" type="Am79C973"/>
+ <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"/>
</Network>
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
@@ -59,7 +60,9 @@ cat << EOF > "${machconfig}"
<Port slot="0" enabled="false" IOBase="0x378" IRQ="4"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="4"/>
</LPT>
- <AudioAdapter controller="AC97" driver="Alsa" enabled="${audio}"/> <!-- OSS, Alsa, Pulse (HANGS!) -->
+ <!-- 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>
<SharedFolder name="${sharename}" hostPath="${sharepath}" writable="true"/>
</SharedFolders>
@@ -67,48 +70,17 @@ cat << EOF > "${machconfig}"
<Guest memoryBalloonSize="0" statisticsUpdateInterval="0"/>
<!--
<GuestProperties>
- <GuestProperty name="/VirtualBox/HostGuest/SysprepExec" value="" timestamp="1268140071072779000" flags="TRANSIENT, RDONLYGUEST"/>
- <GuestProperty name="/VirtualBox/HostGuest/SysprepArgs" value="" timestamp="1268140071072939000" flags="TRANSIENT, RDONLYGUEST"/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Linux" timestamp="1268140265864540000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="2.6.27.21" timestamp="1268140265894019000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/Version" value="#3 SMP Fri Feb 26 16:38:21 CET 2010" timestamp="1268140265898448000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="" timestamp="1268140265899571000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestAdd/Revision" value="57640" timestamp="1268140265900144000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestAdd/Version" value="3.1.4" timestamp="1268140265899937000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsers" value="1" timestamp="1268164075148440000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="4" timestamp="1268164075148790000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/IP" value="132.230.4.224" timestamp="1268164075149053000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Broadcast" value="132.230.4.255" timestamp="1268164075149297000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Netmask" value="255.255.255.0" timestamp="1268164075149596000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/0/Status" value="Up" timestamp="1268164075149829000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/1/V4/IP" value="192.168.112.1" timestamp="1268164075150037000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/1/V4/Broadcast" value="192.168.112.255" timestamp="1268164075150238000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/1/V4/Netmask" value="255.255.255.0" timestamp="1268164075150439000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/1/Status" value="Up" timestamp="1268164075150635000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/2/V4/IP" value="192.168.54.1" timestamp="1268164075150835000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/2/V4/Broadcast" value="192.168.54.255" timestamp="1268164075151072000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/2/V4/Netmask" value="255.255.255.0" timestamp="1268164075151282000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/2/Status" value="Up" timestamp="1268164075151479000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/NoLoggedInUsers" value="false" timestamp="1268140276063587000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestAdd/Vbgl/Video/SavedMode" value="1024x768x32" timestamp="1268140287190297000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestAdd/HostVerLastChecked" value="3.1.4" timestamp="1268140310962236000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/3/V4/IP" value="192.168.122.1" timestamp="1268164075152293000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/3/V4/Broadcast" value="192.168.122.255" timestamp="1268164075152615000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/3/V4/Netmask" value="255.255.255.0" timestamp="1268164075152828000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/3/Status" value="Up" timestamp="1268164075153029000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/4/V4/IP" value="169.254.4.104" timestamp="1265728007966805000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/4/V4/Broadcast" value="169.254.255.255" timestamp="1265728007967184000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/4/V4/Netmask" value="255.255.0.0" timestamp="1265728007967487000" flags=""/>
- <GuestProperty name="/VirtualBox/GuestInfo/Net/4/Status" value="Up" timestamp="1265728007967829000" flags=""/>
- <GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="de_DE" timestamp="1268140070610343000" flags=""/>
- <GuestProperty name="/VirtualBox/HostInfo/VBoxVer" value="3.1.4" timestamp="1268154582522485000" flags="TRANSIENT, RDONLYGUEST"/>
- <GuestProperty name="/VirtualBox/HostInfo/VBoxRev" value="57640" timestamp="1268154582522507000" flags="TRANSIENT, RDONLYGUEST"/>
- <GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsersList" value="vmuser" timestamp="1268164075147867000" flags=""/>
+ <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=""/>
</GuestProperties>
-->
</Hardware>
+ <!-- should be configured depending on the chosen operating system -->
<StorageControllers>
- <StorageController name="IDE-Controller" type="PIIX4" PortCount="2">
+ <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 (HD)!!! -->
@@ -117,10 +89,10 @@ cat << EOF > "${machconfig}"
</AttachedDevice> <!-- PLEASE DO NOT REMOVE THIS COMMENT (CD)!!! -->
</StorageController>
<!--
- <StorageController name="Disketten-Controller" type="I82078" PortCount="1">
+ <StorageController name="Floppy Controller" type="I82078" PortCount="1">
<AttachedDevice type="Floppy" port="0" device="0"/>
</StorageController>
- <StorageController name="SCSI-Controller" type="LsiLogic" PortCount="16">
+ <StorageController name="SCSI Controller" type="LsiLogic" PortCount="16">
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{812c82bf-bd1a-4f59-a5b6-b54ae2f6c669}"/>
</AttachedDevice>
diff --git a/src/os-plugins/plugins/virtualbox/files/run-virt.include b/src/os-plugins/plugins/virtualbox/files/run-virt.include
index 9d3f785d..0c858bee 100644
--- a/src/os-plugins/plugins/virtualbox/files/run-virt.include
+++ b/src/os-plugins/plugins/virtualbox/files/run-virt.include
@@ -1,7 +1,7 @@
# run-virt.include
# -----------------------------------------------------------------------------
# Copyright (c) 2009..2011 - RZ Uni Freiburg
-# Copyright (c) 2009..2011 - OpenSLX GmbH
+# Copyright (c) 2009..2012 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -50,8 +50,12 @@ snapshotdir=${machfolder}/${vm_shortname}/Snapshots
mkdir -p ${diskfolder} ${snapshotdir} 2>/dev/null
# check if diskless var empty?
[ -z "${diskless}" ] && diskless=0
+# default guest audio controller
+guestaudio="AC97"
+# default guest network adaptor
+vb_network_card="Am79C973"
-# configure our own rwimg, empty image which we support
+# configure our own rwimg, empty image which we provide
if [ "${imgmode}" = "rwimg" ]; then
# what is our rwimg called?
imgname="${vm_shortname}.vdi"
@@ -73,9 +77,37 @@ elif [ ${diskless} -eq 0 ]; then
cleanexit 1
fi
-# TODO: maybe rewrite, to reduce checks, merge it with network option,
-# so we can have a "compatibility to vmware config" section
+# nested paging
+npaging="false"
+# enable VT
+enablevt="false"
+# check for VT, if not available use only 1 cpu (only 1 supported)
+[ ${vtflag} -eq 0 ] && cpu_cores=1
+[ ${vtflag} -eq 1 ] && enablevt="true"
+
+# set some base configuration depending on the guest operating system
case "${vmostype}" in
+ win31*)
+ guestaudio="SB16"
+ vmostype="Windows31"
+ mem="32"
+ cpu_cores=1
+ ;;
+ win95*)
+ vmostype="Windows95"
+ mem="92"
+ cpu_cores=1
+ ;;
+ win98*)
+ vmostype="Windows98"
+ mem="256"
+ cpu_cores=1
+ ;;
+ winme*)
+ vmostype="WindowsMe"
+ mem="256"
+ cpu_cores=1
+ ;;
winxp*|windowsxp*)
vmostype="WindowsXP"
;;
@@ -103,7 +135,9 @@ case "${vmostype}" in
fi
;;
os2*)
+ mem="256"
vmostype="OS2eCS"
+ cpu_cores=1
;;
macos*|MacOS*)
vmostype="MacOS"
@@ -171,7 +205,7 @@ elif [ ${diskless} -eq 0 ]; then
skip=392 bs=1 count=16 conv=notrunc
fi
-# TODO: MEM muss noch angepasst werden. Maschine crasht wenn nehr als 50% MEM
+# TODO: MEM muss noch angepasst werden. Maschine crasht wenn mehr als 50% MEM
# memory part equal to vmware plugin
# percentage of memory to use for virtualbox in standard case
#if [ -n "${forcemem}" ]; then
@@ -238,6 +272,16 @@ case "${network_kind}" in
network_kind="NAT"
esac
+# configure 3d settings
+case "${enable3d}" in
+ *true*|*yes*)
+ enable3d="true"
+ ;;
+ *)
+ enable3d="false"
+ ;;
+esac
+
# translate boot, use if set else set to HardDisk
# usually support for a,c,d,n, stands for Floppy, HD, CD-ROM, Network
# support nfs and tftp as well
@@ -267,14 +311,6 @@ case ${boot} in
;;
esac
-# nested paging
-npaging="false"
-# enable VT
-enablevt="false"
-# check for VT, if not available use only 1 cpu (only 1 supported)
-[ ${vtflag} -eq 0 ] && cpu_cores=1
-[ ${vtflag} -eq 1 ] && enablevt="true"
-
# external GUI
vrdpport=${remotedesktopport}
@@ -326,7 +362,7 @@ fi
# create machine.xml
. ${PLUGINCONFVIRTUALBOX}/machine.include
-# remove CD-ROM
+# remove CD-ROM if not available
if [ "${cdrom0}" != "TRUE" ]; then
sed -i "/HostDrive/d" ${machconfig}
sed -i '/AttachedDevice.*type="DVD"/d' ${machconfig}
@@ -366,6 +402,13 @@ fi
### finally set env for run-virt.sh
################################################################################
+# configure and start samba service to provide user's home directory
+if [ -f /usr/sbin/smbd ] ; then
+ sudo /opt/openslx/rootfs/bin/sed -i /etc/vbox/smb.conf -e "s,$USER,USER,"
+ sudo /usr/sbin/nmbd -c /etc/vbox/smb.conf
+ sudo /usr/sbin/smbd -c /etc/vbox/smb.conf
+fi
+
# wait for a certain command to settle
# get the PID of the right process
# kill PID, seems to work
diff --git a/src/os-plugins/plugins/virtualbox/files/virtualbox.include b/src/os-plugins/plugins/virtualbox/files/virtualbox.include
index 7dddc432..0c7ba3ee 100644
--- a/src/os-plugins/plugins/virtualbox/files/virtualbox.include
+++ b/src/os-plugins/plugins/virtualbox/files/virtualbox.include
@@ -1,7 +1,7 @@
# 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.9-linux"> <!-- 1.7-linux -->
+<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-linux"> <!-- 1.12-linux -->
<Global>
<ExtraData>
<ExtraDataItem name="GUI/Input/AutoCapture" value="true"/>
@@ -9,11 +9,10 @@ cat << EOF > "${confdir}/VirtualBox.xml"
<ExtraDataItem name="GUI/LastVMSelected" value="${machineuuid}"/>
<ExtraDataItem name="GUI/LicenseAgreed" value="1,2,3,4,5,6,7,8,9"/>
<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,showRuntimeError.warning.HostAudioNotResponding,showRuntimeError.warning.ExtPackNoEhci"/>
- <ExtraDataItem name="GUI/TrayIcon/Enabled" value="false"/>
<ExtraDataItem name="GUI/UpdateCheckCount" value="2"/>
<ExtraDataItem name="GUI/UpdateDate" value="never"/>
+ <ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutAutoCapture,confirmInputCapture,remindAboutWrongColorDepth,confirmGoingFullscreen,remindAboutMouseIntegrationOn,remindAboutMouseIntegrationOff,showRuntimeError.warning.DevATA_DISKFULL,remindAboutPausedVMInput,confirmVMReset,showRuntimeError.warning.HostAudioNotResponding,showRuntimeError.warning.ExtPackNoEhci"/>
+ <ExtraDataItem name="GUI/TrayIcon/Enabled" value="false"/>
</ExtraData>
<MachineRegistry>
<MachineEntry uuid="{${machineuuid}}" src="Machines/${vm_shortname}/${vm_shortname}.xml"/>
@@ -25,22 +24,19 @@ cat << EOF > "${confdir}/VirtualBox.xml"
</HardDisk>
</HardDisks>
<!--
- <DVDImages>
- <Image uuid="{dcd1e32a-729f-4faa-b319-67adca15e4a4}" location="/.../gpxe-1.0.0+-virtio-net.iso"/>
- <Image uuid="{b71450c6-b8ff-43c1-a290-2a793b3023d8}" location="/.../gpxe-1.0.0+-e1000.iso"/>
- </DVDImages>
+ <DVDImages/>
-->
<FloppyImages/>
</MediaRegistry>
<NetserviceRegistry>
<DHCPServers>
- <DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.56.100" networkMask="255.255.255.0" lowerIP="192.168.56.101" upperIP="192.168.56.254" enabled="1"/>
+ <DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.102.100" networkMask="255.255.255.0" lowerIP="192.168.102.101" upperIP="192.168.102.254" enabled="1"/>
<!--
<DHCPServer networkName="HostInterfaceNetworking-vboxnet1" IPAddress="0.0.0.0" networkMask="0.0.0.0" lowerIP="0.0.0.0" upperIP="0.0.0.0" enabled="0"/>
-->
</DHCPServers>
</NetserviceRegistry>
- <SystemProperties defaultMachineFolder="${machfolder}" defaultHardDiskFolder="${diskfolder}" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" LogHistoryCount="3"/>
+ <SystemProperties defaultMachineFolder="${machfolder}" defaultHardDiskFolder="${diskfolder}" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VBoxAuth" webServiceAuthLibrary="VBoxAuth" LogHistoryCount="3"/>
<USBDeviceFilters/>
</Global>
</VirtualBox>
diff --git a/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh
index cd6d54e5..9fcc1c39 100644
--- a/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh
+++ b/src/os-plugins/plugins/vmchooser/XX_vmchooser.sh
@@ -78,11 +78,18 @@ if [ -e $CONFFILE ]; then
# enable normal users to setup the extended virtual machine redo file space
# and image source via network block device (NBD only at the moment)
+ # allow to start/stop samba on virtual devices (latter one ignores multiple
+ # independent daemons)
cat >> /mnt/etc/sudoers << EOF
# allow to start and stop the special /tmp redo file space (RAM + NBD/NFS server RAID)
ALL ALL=NOPASSWD: /sbin/losetup /dev/loop*
ALL ALL=NOPASSWD: /sbin/mdadm -C /dev/md0 -l linear --raid-devices=2 /dev/loop* /dev/*
ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/sbin/nbd-client * * /dev/nbd*
+# allow to configure and start/stop samba services
+ALL ALL=NOPASSWD: /opt/openslx/rootfs/bin/sed -i /etc/*/smb.conf -e *
+ALL ALL=NOPASSWD: /usr/sbin/nmbd -c /etc/*/smb.conf
+ALL ALL=NOPASSWD: /usr/sbin/smbd -c /etc/*/smb.conf
+ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/bin/killall nmbd smbd
EOF
# finished ...
diff --git a/src/os-plugins/plugins/vmchooser/files/run-virt.sh b/src/os-plugins/plugins/vmchooser/files/run-virt.sh
index 5a03e63f..b3863a2e 100644
--- a/src/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/src/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -364,7 +364,7 @@ esac
# Enable 3D
enable3d=$(grep -i "<enable3d param=.*" ${xmlfile} 2>/dev/null | \
- awk -F '=' {'print $2'})
+ awk -F '=' {'print $2'} | tr "[A-Z]" "[a-z]")
# Add rw share
sharepath="${HOME}"
diff --git a/src/os-plugins/plugins/vmware/XX_vmware.sh b/src/os-plugins/plugins/vmware/XX_vmware.sh
index 59996db6..7a953eae 100644
--- a/src/os-plugins/plugins/vmware/XX_vmware.sh
+++ b/src/os-plugins/plugins/vmware/XX_vmware.sh
@@ -1,5 +1,5 @@
# Copyright (c) 2007..2009 - RZ Uni Freiburg
-# Copyright (c) 2008..2011 - OpenSLX GmbH
+# Copyright (c) 2008..2012 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -75,6 +75,11 @@ stage3 setup" > ${PLUGINCONFDIR}/vmware.conf
-e "s,CNETWORK,$vmsub,;s,PIDFILE,/var/run/vmware/udhcpd-vmnet1.pid," \
-e "s,LEASEFILE,/var/run/vmware/udhcpd-vmnet1.leases," \
/mnt/etc/opt/openslx/udhcpd.conf >/mnt/etc/vmware/udhcpd/udhcpd-vmnet1.conf
+ # setting the base samba configuration if available
+ [ -f /mnt/opt/openslx/plugins/virtualization/smb.conf -a -f /mnt/usr/sbin/smbd ] && \
+ sed -e "s,NWIF,$vmsub,;s,PIDDIR,/var/run/vmware," \
+ /mnt/opt/openslx/plugins/virtualization/smb.conf \
+ >/etc/vmware/smb.conf
fi
# vmware nat interface configuration
diff --git a/src/os-plugins/plugins/vmware/files/README b/src/os-plugins/plugins/vmware/files/README
index ae8bf1e7..8e33187b 100644
--- a/src/os-plugins/plugins/vmware/files/README
+++ b/src/os-plugins/plugins/vmware/files/README
@@ -1,5 +1,5 @@
Files
-- nvram (version from VMware5)
+- nvram (version from VMware5, compatible for newer machines too)
This nvram supports a second Floppy drive. Helpfull if you want to
get some data from linux to your Windows VirtualMachine (like
Scanner-IP or Userinformation)
diff --git a/src/os-plugins/plugins/vmware/files/run-virt.include b/src/os-plugins/plugins/vmware/files/run-virt.include
index 3ec8eafc..86efb1a8 100644
--- a/src/os-plugins/plugins/vmware/files/run-virt.include
+++ b/src/os-plugins/plugins/vmware/files/run-virt.include
@@ -22,74 +22,86 @@ runvmwareconfheader ()
{
echo "# This configuration file was generated by $0" >${conffile}
-case "$vmversion" in
- *)
- svga_autodetect="TRUE"
- numvcpus="1"
- shared_folder="FALSE"
- echo ".encoding = \"UTF-8\"
-# version specific stuff - all versions
-config.version = \"8\"" >>${conffile}
- ;;
-esac
-case "$vmversion" in
- 2.*|3.*|4.*|6.*|7.*|8.*)
- shared_folder="TRUE"
- echo "
-# version specific stuff - ver. 2.*|3.*|6.*|7.*
-sharedFolder.option = \"alwaysEnabled\"" >>${conffile}
- ;;
-esac
-case "$vmversion" in
- 2.5|3.*|4.*|6.5|7.*|8.*)
- if [ "${cpu_cores}" -ge "2" 2>/dev/null ]; then
- numvcpus="2"
- fi
- cap3d="TRUE" # helper var for loging output
- echo "
-# version specific stuff - ver. 2.5|3.*|6.5|7.*
-ehci.present = \"TRUE\"
-mks.enable3d = \"${enable3d}\"" >>${conffile}
- ;;
-esac
# check for the ostype
case "${vmostype}" in
win31*)
mem="32"
cpu_cores="1"
sound="sb16"
+ shfolders="FALSE"
;;
win95*)
mem="92"
cpu_cores="1"
+ shfolders="FALSE"
;;
win98*|winme*)
mem="256"
cpu_cores="1"
+ shfolders="FALSE"
;;
winxp*|windowsxp*)
+ shfolders="TRUE"
;;
winvista*|windowsvista*)
+ shfolders="TRUE"
;;
windows7*)
+ shfolders="TRUE"
+ ;;
+ windows8*)
+ shfolders="TRUE"
;;
linux*|*ubuntu*|*suse*|debian*|*sci*)
vmostype="linux"
+ shfolders="TRUE"
;;
macos*)
cpu_cores="1"
vmostype="other"
+ shfolders="FALSE"
;;
beos*)
cpu_cores="1"
vmostype="other"
+ shfolders="FALSE"
;;
*)
vmostype="other"
+ shfolders="FALSE"
+ ;;
+esac
+case "$vmversion" in
+ *)
+ svga_autodetect="TRUE"
+ numvcpus="1"
+ shfolders="FALSE"
+ echo ".encoding = \"UTF-8\"
+# version specific stuff - all versions
+config.version = \"8\"" >>${conffile}
+ ;;
+esac
+case "$vmversion" in
+ 2.*|3.*|4.*|6.*|7.*|8.*|9.*)
+ echo "
+# version specific stuff - ver. 2.*|3.*|6.*|7.*|8.*|9.*
+sharedFolder.option = \"alwaysEnabled\"" >>${conffile}
+ ;;
+esac
+case "$vmversion" in
+ 2.5|3.*|4.*|6.5|7.*|8.*)
+ if [ "${cpu_cores}" -ge "2" 2>/dev/null ]; then
+ numvcpus="2"
+ fi
+ cap3d="TRUE" # helper var for loging output
+ echo "
+# version specific stuff - ver. 2.5|3.*|6.5|7.*
+ehci.present = \"TRUE\"
+mks.enable3d = \"${enable3d}\"" >>${conffile}
;;
esac
case "$vmversion" in
- 3.*|4.*|7.*|8.*)
+ 3.*|4.*|7.*|8.*|9.*)
numvcpus="${cpu_cores}"
if [ "${cpu_cores}" -ge "4" 2>/dev/null ]; then
numvcpus="4"
@@ -176,9 +188,15 @@ svga.autodetect = \"${svga_autodetect}\"
usb.present = \"TRUE\"
usb.generic.autoconnect = \"TRUE\"
+# pci configuration
+usb.pciSlotNumber = "16"
+ethernet0.pciSlotNumber = "17"
+sound.pciSlotNumber = "18"
+ehci.pciSlotNumber = "19"
+
# shared folders
-sharedFolder0.present = \"TRUE\"
-sharedFolder0.enabled = \"${shared_folder}\"
+sharedFolder0.present = \"${shfolders}\"
+sharedFolder0.enabled = \"${shfolders}\"
sharedFolder0.expiration = \"never\"
sharedFolder0.guestName = \"${sharename}\"
sharedFolder0.hostPath = \"${sharepath}\"
@@ -306,8 +324,8 @@ fi
sound="es1371"
# check for 3D configuration setting
-case "$enable3d" in
- *true*|*TRUE*|*yes*|*YES*)
+case "${enable3d}" in
+ *true*|*yes*)
enable3d="TRUE"
;;
*)
@@ -492,6 +510,13 @@ writelog ""
# finally set env for run-virt.sh
################################################################################
+# configure and start samba service to provide user's home directory
+if [ -f /usr/sbin/smbd ] ; then
+ sudo /opt/openslx/rootfs/bin/sed -i /etc/vmware/smb.conf -e "s,$USER,USER,"
+ sudo /usr/sbin/nmbd -c /etc/vmware/smb.conf
+ sudo /usr/sbin/smbd -c /etc/vmware/smb.conf
+fi
+
# using the modified version of the wrapper script
VIRTCMD="${OPENSLX_DEFAULT_BINDIR}/vmplayer"
VIRTCMDOPTS="${vmopt} ${conffile}"