From 022a4eaa948b8145401f74cdda282c18cfa82bda Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 29 Sep 2014 16:07:57 +0200 Subject: [vmware] Decouple volume controls of VM from host system --- .../opt/openslx/vmchooser/vmware/run-virt.include | 261 +++++++++++---------- 1 file changed, 131 insertions(+), 130 deletions(-) diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include index e867a888..ef54218e 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include @@ -16,6 +16,7 @@ ################################################################################ ### configuration writer functions +### This needs bash, not dash or ash! (indented HEREDOC) ################################################################################ vmostype=$(rv_clean_string "$vmostype") @@ -172,152 +173,152 @@ runvmwareconfheader () MAXCORES="1" ;; esac - - svga_autodetect="TRUE" real_core_count="$cpu_cores" [ "$cpu_cores" -gt "$MAXCORES" ] && cpu_cores="$MAXCORES" # It currently makes no sense to set the virtual number of cores # to a different value than the virtual number of cores per virtual CPU. cores_per_socket="$cpu_cores" - + if [ "x$shfolders" != "xFALSE" ]; then ENABLE_SHARE='sharedFolder.option = "alwaysEnabled"' else ENABLE_SHARE='' fi - + [ "$mem" -ge "$MAXMEM" ] && mem="$MAXMEM" [ "$hwver" -lt "7" -a "$mem" -gt "3500" ] && mem="3500" - + cap3d="WHAT IS THIS VAR USED FOR?" # helper var for loging output - - cat >> "$conffile" <> "$conffile" <<-HEREEND + .encoding = "UTF-8" + config.version = "8" + + # general hardware (ehci, 3d accel) + ehci.present = "TRUE" + $FORCE3D + mks.enable3d = "$enable3d" + + monitor.virtual_mmu = "automatic" + monitor.virtual_exec = "automatic" + floppy1.clientDevice = "FALSE" + floppy1.readonly = "TRUE" + + # id + virtualHW.version = "$hwver" + displayName = "$displayname" + guestOS = "$vmostype" + + # CPU/MEM + numvcpus = "$cpu_cores" + cpuid.coresPerSocket = "$cores_per_socket" + maxvcpus = "$real_core_count" + memsize = "$mem" + MemAllowAutoScaleDown = "FALSE" + MemTrimRate = "-1" + + # ide-disks + ide0:0.present = "$ide" + ide0:0.fileName = "$vm_diskfile" + ## Edited for persistent mode. + ide0:0.mode = "independent-${diskmode}" + ## + ide1:0.present = "$cdrom0" + ide1:0.autodetect = "TRUE" + ide1:0.fileName = "auto detect" + ide1:0.deviceType = "cdrom-raw" + ide1:1.present = "$cdrom1" + ide1:1.autodetect = "TRUE" + ide1:1.fileName = "auto detect" + ide1:1.deviceType = "cdrom-raw" + + # scsi-disks + scsi0.present = "$scsi" + scsi0:0.present = "$scsi" + scsi0:0.fileName = "$vm_diskfile" + scsi0.virtualDev = "$hddrv" + ## Edited for persistent mode. + scsi0:0.mode = "independent-${diskmode}"$stateFileConfiguration + ## + + # floppies + floppy0.present = "$floppy0" + floppy0.startConnected = "FALSE" + floppy0.autodetect = "TRUE" + floppy0.fileName = "auto detect" + + # we need floppy b: for the client configuration + floppy1.present = "$floppy1" + floppy1.startConnected = "TRUE" + floppy1.fileType = "file" + floppy1.fileName = "$floppy1name" + + # nics + ethernet0.present = "TRUE" + ethernet0.addressType = "static" + $network_virtualDev + ethernet0.connectionType = "hostonly" + #ethernet1.connectionType = "custom" + ethernet0.vnet = "$hostdev" + ethernet0.address = "00:50:56:$macaddrsuffix" + ethernet0.wakeOnPcktRcv = "FALSE" + + # sound + sound.present = "TRUE" + sound.fileName = "-1" + sound.autodetect = "TRUE" + sound.virtualdev = "$sound" + pciSound.enableVolumeControl = "FALSE" + sound.enableVolumeControl = "FALSE" + + # svga + svga.autodetect = "TRUE" + + # usb + usb.present = "TRUE" + usb.generic.autoconnect = "TRUE" + + # pci configuration + usb.pciSlotNumber = "16" + ethernet0.pciSlotNumber = "17" + sound.pciSlotNumber = "18" + ehci.pciSlotNumber = "19" + scsi0.pciSlotNumber = "20" + + # shared folders + $ENABLE_SHARE + sharedFolder0.present = "$shfolders" + sharedFolder0.enabled = "$shfolders" + sharedFolder0.expiration = "never" + sharedFolder0.guestName = "$sharename" + sharedFolder0.hostPath = "$sharepath" + sharedFolder0.readAccess = "TRUE" + sharedFolder0.writeAccess = "TRUE" + sharedFolder.maxNum = "1" + + # dirs/configs + tmpDirectory = "$redodir" + redoLogDir = "$redodir" + mainMem.useNamedFile = "TRUE" + snapshot.disabled = "TRUE" + tools.syncTime = "TRUE" + isolation.tools.hgfs.disable = "FALSE" + hgfs.mapRootShare = "TRUE" + isolation.tools.dnd.disable = "FALSE" + isolation.tools.copy.enable = "TRUE" + isolation.tools.paste.enabled = "TRUE" + + # serial port + serial0.present = "$serial" + $serialdev + + # parallel port + parallel0.present = "$parallel" + parallel0.bidirectional = "$paralbidi" + $paraldev + HEREEND -# shared folders -$ENABLE_SHARE -sharedFolder0.present = "$shfolders" -sharedFolder0.enabled = "$shfolders" -sharedFolder0.expiration = "never" -sharedFolder0.guestName = "$sharename" -sharedFolder0.hostPath = "$sharepath" -sharedFolder0.readAccess = "TRUE" -sharedFolder0.writeAccess = "TRUE" -sharedFolder.maxNum = "1" - -# dirs/configs -tmpDirectory = "$redodir" -redoLogDir = "$redodir" -mainMem.useNamedFile = "TRUE" -snapshot.disabled = "TRUE" -tools.syncTime = "TRUE" -isolation.tools.hgfs.disable = "FALSE" -hgfs.mapRootShare = "TRUE" -isolation.tools.dnd.disable = "FALSE" -isolation.tools.copy.enable = "TRUE" -isolation.tools.paste.enabled = "TRUE" - -# serial port -serial0.present = "$serial" -$serialdev - -# parallel port -parallel0.present = "$parallel" -parallel0.bidirectional = "$paralbidi" -$paraldev -HEREEND - # set the appropriate permissions for the vmware config file chmod u+rwx "${conffile}" >/dev/null 2>&1 } -- cgit v1.2.3-55-g7522