summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/virtualbox
diff options
context:
space:
mode:
authorMichael Janczyk2010-04-01 21:35:54 +0200
committerMichael Janczyk2010-04-01 21:35:54 +0200
commit46fbdd6d0a6dd5896a2b798deb95aa61a089a355 (patch)
treedf83b52870688d683bcd054233a8a88a56ee8f6c /os-plugins/plugins/virtualbox
parentxen bridge change + xennet TODO: load xennet (diff)
downloadcore-46fbdd6d0a6dd5896a2b798deb95aa61a089a355.tar.gz
core-46fbdd6d0a6dd5896a2b798deb95aa61a089a355.tar.xz
core-46fbdd6d0a6dd5896a2b798deb95aa61a089a355.zip
xen nfs boot, xen boot
Diffstat (limited to 'os-plugins/plugins/virtualbox')
-rw-r--r--os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm8
-rw-r--r--os-plugins/plugins/virtualbox/files/machine.include4
-rw-r--r--os-plugins/plugins/virtualbox/files/run-virt.include71
-rw-r--r--os-plugins/plugins/virtualbox/files/virtualbox.include2
4 files changed, 47 insertions, 38 deletions
diff --git a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
index 5d8206cd..f8fad1ba 100644
--- a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
+++ b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
@@ -84,6 +84,8 @@ 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,
@@ -139,7 +141,7 @@ sub installationPhase
{
my $self = shift;
my $info = shift;
-
+
$self->{pluginRepositoryPath} = $info->{'plugin-repo-path'};
$self->{pluginTempPath} = $info->{'plugin-temp-path'};
$self->{openslxBasePath} = $info->{'openslx-base-path'};
@@ -147,7 +149,7 @@ sub installationPhase
$self->{attrs} = $info->{'plugin-attrs'};
my $engine = $self->{'os-plugin-engine'};
-
+
# Different names of the tool (should be unified somehow!?)
if (!isInPath('VirtualBox')) {
# todo: fix this
@@ -170,7 +172,7 @@ sub installationPhase
foreach my $file ( qw( run-virt.include virtualbox.include machine.include
empty-diff.vdi.gz rwimg.vdi.gz ) ) {
copyFile("$pluginBasePath/$file", "$self->{pluginRepositoryPath}/");
- chmod 0755, "$self->{pluginRepositoryPath}/$file";
+ chmod 0644, "$self->{pluginRepositoryPath}/$file";
}
return;
diff --git a/os-plugins/plugins/virtualbox/files/machine.include b/os-plugins/plugins/virtualbox/files/machine.include
index 78c4bee8..a76c7e6f 100644
--- a/os-plugins/plugins/virtualbox/files/machine.include
+++ b/os-plugins/plugins/virtualbox/files/machine.include
@@ -2,7 +2,7 @@
cat << EOF > "${machconfig}"
<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.9-linux">
- <Machine uuid="{${machineuuid}}" name="${vm_name}" OSType="${vmostype}"> <!-- stateFile="Snapshots/{1e5f5eb0-6b13-4407-9906-36114eca1e61}.sav" lastStateChange="2010-03-09T19:48:32Z"> -->
+ <Machine uuid="{${machineuuid}}" name="${vm_name}" OSType="${vmostype}">
<ExtraData>
<ExtraDataItem name="GUI/AutoresizeGuest" value="on"/>
<ExtraDataItem name="GUI/Fullscreen" value="on"/>
@@ -15,7 +15,7 @@ cat << EOF > "${machconfig}"
</ExtraData>
<Hardware version="2">
<CPU count="1">
- <HardwareVirtEx enabled="false" exclusive="true"/>
+ <HardwareVirtEx enabled="true" exclusive="true"/>
<HardwareVirtExNestedPaging enabled="false"/>
<HardwareVirtExVPID enabled="false"/>
<PAE enabled="true"/>
diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include
index f904b5f2..abf1e0be 100644
--- a/os-plugins/plugins/virtualbox/files/run-virt.include
+++ b/os-plugins/plugins/virtualbox/files/run-virt.include
@@ -185,16 +185,21 @@ else
fi
# translate network cards
-if [ "${network_card}" = "e1000" ]; then
- vb_network_card="82540EM"
-else
- network_card="pcnet"
- vb_network_card="Am79C973"
-fi
+case "${network_card}" in
+ e1000)
+ vb_network_card="82540EM"
+ ;;
+ virtio)
+ vb_network_card="virtio"
+ ;;
+ *)
+ network_card="pcnet"
+ vb_network_card="Am79C973"
+esac
# translate network kinds (nat, bridged, host-only)
case "${network_kind}" in
- bridged)
+ bridge*)
network_kind='BridgedInterface name="br0"'
;;
hostonly|host-only)
@@ -204,6 +209,33 @@ case "${network_kind}" in
network_kind="NAT"
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
+if [ -n "${boot}" ]; then
+ case ${boot} in
+ n*|tftp)
+ boot="Network"
+ if [ "${network_kind}" = "NAT" ] && [ -n "${virtualbox_tftpdir}" ]; then
+ # remove spaces from VM name to avoid Problems /w TFTP in NAT
+ 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
+ for i in $(ls ${virtualbox_tftpdir}); do
+ ln -sf ${virtualbox_tftpdir}/${i} ${confdir}/TFTP/${i}
+ done
+ fi
+ ;;
+ # later maybe c|disk|hd*|sd*) for HD and d|cd*) for CD-ROM
+ *)
+ boot="HardDisk"
+ ;;
+ esac
+else
+ boot="HardDisk"
+fi
+
# external GUI
vrdpport="590${VM_ID}"
@@ -232,31 +264,6 @@ cdrom1=${cdtest:-"FALSE"}
ide="TRUE"
hddrv="ide"
-# translate boot, use if set else set to HardDisk
-if [ -n "${boot}" ]; then
- case ${boot} in
- n*) # usually support for a,c,d,n, stands for Floppy, HD, CD-ROM, Network
- boot="Network"
- if [ "${network_kind}" = "NAT" ] && [ -n "${virtualbox_tftpdir}" ]; then
- # remove spaces from VM name to avoid Problems /w TFTP in NAT
- 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
- for i in $(ls ${virtualbox_tftpdir}); do
- ln -sf ${virtualbox_tftpdir}/${i} ${confdir}/TFTP/${i}
- done
- fi
- ;;
- # later maybe c|disk|hd*|sd*) for HD and d|cd*) for CD-ROM
- *)
- boot="HardDisk"
- ;;
- esac
-else
- boot="HardDisk"
-fi
-
[ ${diskless} -eq 0 ] && writelog "\tSnapshots dir:\t\t$snapshotdir"
writelog "Diskimage:"
[ ${diskless} -eq 0 ] && writelog "\tDisk file:\t\t$diskfile"
diff --git a/os-plugins/plugins/virtualbox/files/virtualbox.include b/os-plugins/plugins/virtualbox/files/virtualbox.include
index 49b3ce61..09a2f33b 100644
--- a/os-plugins/plugins/virtualbox/files/virtualbox.include
+++ b/os-plugins/plugins/virtualbox/files/virtualbox.include
@@ -13,7 +13,7 @@ cat << EOF > "${confdir}/VirtualBox.xml"
<ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutAutoCapture,confirmInputCapture,remindAboutWrongColorDepth,confirmGoingFullscreen,remindAboutMouseIntegrationOn,remindAboutMouseIntegrationOff,showRuntimeError.warning.DevATA_DISKFULL,remindAboutPausedVMInput,confirmVMReset"/>
<ExtraDataItem name="GUI/TrayIcon/Enabled" value="false"/>
<ExtraDataItem name="GUI/UpdateCheckCount" value="2"/>
- <ExtraDataItem name="GUI/UpdateDate" value="never"/> <!-- value="1 d, DATE, stable" -->
+ <ExtraDataItem name="GUI/UpdateDate" value="never"/>
</ExtraData>
<MachineRegistry>
<MachineEntry uuid="{${machineuuid}}" src="Machines/${vm_shortname}/${vm_shortname}.xml"/>