From 12661ab55f252b14aaab3dd4af2060c634480e6b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 5 Nov 2015 11:02:37 +0100 Subject: [vmware] Create shared folter vmx entries in non-legacy mode --- .../vmchooser/vmware/includes/parse_vmx.inc | 40 +++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'remote/modules/vmware') diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc index c15b956d..6c41d8d4 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc @@ -17,7 +17,8 @@ writelog "Guest MAC: $macaddr" echo 'ethernet0.addressType = "static"' >> "$TMPDIR/$IMGUUID" echo 'ethernet0.address = "'"${macaddr}"'"' >> "$TMPDIR/$IMGUUID" -# Massenspeicher: DVD, CDROM +# DVD, CDROM +# XXX: For now it's save to assume ide channel 1 is free, as we support only one HDD, and it it's IDE, it's on channel 0 cat >> "$TMPDIR/$IMGUUID" <<-HEREEND ide1:0.present = "$cdrom0" ide1:0.autodetect = "TRUE" @@ -29,7 +30,7 @@ ide1:1.fileName = "auto detect" ide1:1.deviceType = "cdrom-raw" HEREEND -# Floppies: +# Floppies: cat >> "$TMPDIR/$IMGUUID" <<-HEREEND floppy0.present = "$floppy0" floppy0.startConnected = "FALSE" @@ -41,6 +42,29 @@ floppy1.fileType = "file" floppy1.fileName = "$floppy1name" HEREEND +# Shared Folders +cat >> "$TMPDIR/$IMGUUID" <<-HEREEND +$ENABLE_SHARE +sharedFolder0.present = "$shfolders" +sharedFolder0.enabled = "$shfolders" +sharedFolder0.expiration = "never" +sharedFolder0.guestName = "$homesharename" +sharedFolder0.hostPath = "$homesharepath" +sharedFolder0.readAccess = "TRUE" +sharedFolder0.writeAccess = "TRUE" +sharedFolder1.present = "$shfolders" +sharedFolder1.enabled = "$shfolders" +sharedFolder1.expiration = "never" +sharedFolder1.guestName = "$commonsharename" +sharedFolder1.hostPath = "$commonsharepath" +sharedFolder1.readAccess = "TRUE" +sharedFolder1.writeAccess = "TRUE" +sharedFolder.maxNum = "2" +isolation.tools.hgfs.disable = "FALSE" +#hgfs.mapRootShare = "true" +HEREEND + + writelog "numvcpus = ${cpu_cores} - maxvcpus=${real_core_count}" # RAM, CPUs @@ -59,15 +83,15 @@ usb.present = "TRUE" usb.generic.autoconnect = "TRUE" HEREEND -# Seriell, Parallel: Empty, nothing is being currently set. TODO later. +# Serial, Parallel: Empty, nothing is being currently set. TODO later. -# Graphics, GPU: 3D will be activated if FORCE3D is set. +# Graphics, GPU: 3D will be forced if FORCE3D is set. # Force3D is set in set_hardware.inc if SLX_VMWARE_3D is set in config. if [ -n "$FORCE3D" ]; then - writelog "FORCE3D set - enabling 3D in vmx file." + writelog "FORCE3D set - overriding 3D in vmx file." echo 'mks.gl.allowBlacklistedDrivers = "TRUE"' >> "$TMPDIR/$IMGUUID" else - writelog "FORCE3D not set - not enabling 3D in vmx file." + writelog "FORCE3D not set - 3D will only work if GPU/driver is whitelisted by vmware." fi # rausziehen: Hardwareversion @@ -78,12 +102,12 @@ fi # rausziehen: GuestOS -# Killing duplicate lines (output much nicer as sort -u): +# Killing duplicate lines (output much nicer than sort -u): awk '!a[$0]++' "${TMPDIR}/${IMGUUID}" > "${TMPDIR}/${IMGUUID}.tmp" && mv "${TMPDIR}/${IMGUUID}.tmp" "${TMPDIR}/${IMGUUID}" # At last_ Let's copy it to $confdir/run-vmware.conf cp -p "$TMPDIR/$IMGUUID" "$conffile" && writelog "Copied TMPDIR/IMGUUID ${TMPDIR}/${IMGUUID} to conffile ${conffile}" || \ - ( writelog "Could not copy TMPDIR/IMGUUID -$TMPDIR/$IMGUUID- to conffile ${conffile}!"; cleanexit 1 ) + ( writelog "Could not copy TMPDIR/IMGUUID -$TMPDIR/$IMGUUID- to conffile ${conffile}!"; cleanexit 1 ) # TODO: Move this to cleanexit. # rm -f "$TMPDIR/$IMGUUID" || writelog "Could not delete $TMPDIR/$IMGUUID." -- cgit v1.2.3-55-g7522 From 5a2e0af7b018e07e901a2befc6daa91781c5277d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 12 Nov 2015 14:35:51 +0100 Subject: [vmware] Map and link shared folders, disable dpi scaling --- remote/clean_module_funcs.inc | 23 ++++++++++++++++++++++ .../vmchooser/vmware/includes/parse_vmx.inc | 9 +++++++-- remote/setup_target | 5 ++++- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 remote/clean_module_funcs.inc (limited to 'remote/modules/vmware') diff --git a/remote/clean_module_funcs.inc b/remote/clean_module_funcs.inc new file mode 100644 index 00000000..91f13942 --- /dev/null +++ b/remote/clean_module_funcs.inc @@ -0,0 +1,23 @@ +# Called when the sources for this module need to be fetched. +# Not called if fetched_source.flag exists +fetch_source() { + : +} + +# Called when the module should be built. +# Not called if build_complete.flag exists +build() { + : +} + +# Called after the relevant files from the module's build dir +# have been copied to the target dir. +post_copy() { + : +} + +# Called when this module is about to be handled, before fetching the source. +module_load() { + : +} + diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc index 6c41d8d4..fff387f2 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc @@ -58,10 +58,11 @@ sharedFolder1.expiration = "never" sharedFolder1.guestName = "$commonsharename" sharedFolder1.hostPath = "$commonsharepath" sharedFolder1.readAccess = "TRUE" -sharedFolder1.writeAccess = "TRUE" +sharedFolder1.writeAccess = "FALSE" sharedFolder.maxNum = "2" isolation.tools.hgfs.disable = "FALSE" -#hgfs.mapRootShare = "true" +hgfs.mapRootShare = "TRUE" +hgfs.linkRootShare = "TRUE" HEREEND @@ -94,6 +95,10 @@ else writelog "FORCE3D not set - 3D will only work if GPU/driver is whitelisted by vmware." fi +# Disable DPI scaling information passing via vmware tools +sed -i '/^gui.applyHostDisplayScaling/d' "$TMPDIR/$IMGUUID" +echo 'gui.applyHostDisplayScalingToGuest = "FALSE"' >> "$TMPDIR/$IMGUUID" + # rausziehen: Hardwareversion # hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}') # writelog "hwver: $hwver" diff --git a/remote/setup_target b/remote/setup_target index 927fde01..42975ef1 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -415,13 +415,16 @@ process_module() { fi # Source .build script of module pdebug "## Reading .build of $MODULE" - read_build + . "${MODE_DIR}/clean_module_funcs.inc" # Clean all hooks, in case the module doesn't define them all + read_build # Read all the hooks from the module # Install module's dependencies pdebug "## Installing dependencies" cd "${MODULE_DIR}" || perror "cd to '${MODULE_DIR}' failed." install_dependencies # update kernel version variables before running a module, as the last one might have been the kernel... get_kernel_version + # Execute load-hook before anything else + module_load # Fetch source code if [ ! -e "$SOURCE_FLAG" ]; then pinfo "## Fetching source" -- cgit v1.2.3-55-g7522