Wenn der X-Server von X.org in einem Gast-Betriebssystem eingesetzt wird, läuft das VMware-eigene vmware-config-tools.pl Skript nicht vollständig durch. Daher wird ein Skript benötigt, welches ein installiertes XFree86 vortäuscht.
Aufruf:
Bei einem installiertes X.org X11-Server:
install_vmconfixx.sh
#!/bin/sh
# install_vmconffix.sh
# Version 1.0.1
# Installs vmconffix.sh by Gatewood Green <woody@linif.org>,
# which allows vmware-config-tools.pl to run on systems with Xorg installed,
# It creates vmware-config-tools-xorg which should be run
# instead of original vmware-config-tools.pl
#
# Should be installed after vmware tools installed, but before
# vmware-config-tools.pl first time executed
# (you have to reject run vmware-config-tools.pl right from
# vmware tools install script).
#
# Installer created by Desummoner (stated for reference only)
#
# 2005-03-20 - Initial version
# 2005-03-20 - Version 1.0.1 (concept fix)
#
# Use at your OWN risk
# ALWAYS, ALWAYS, ALWAYS backup first (Snapshot -> Save Snapshot)
VMCONF_FIXER=/usr/bin/vmconffix.sh
VMCONF=/usr/bin/vmware-config-tools.pl
VMCONF_FIXED=/usr/bin/vmware-config-tools-xorg
# Create 'vmconffix.sh' fixer script
cat > ${VMCONF_FIXER} << 'FILE_VMCONF_FIXER'
#!/bin/sh
# vmconffix.sh
# Created by Gatewood Green <woody@linif.org>
# This script allows vmware-config-tools.pl to run on systems with Xorg installed
# Created on Nov 27 2004
# Use at your OWN risk
# ALWAYS, ALWAYS, ALWAYS backup first (Snapshot -> Save Snapshot)
# File locations
XFREE86=/usr/X11R6/bin/XFree86
XORG=/usr/X11R6/bin/Xorg
X=/usr/X11R6/bin/X
XETC=/etc/X11
XF86CONFIG=xorg.conf
### Nothing below here should need changing
# Capture the VMWare tool argument
VMWCT=${1}
# Make this critical variable available to the VMWare tool
export XF86CONFIG
function usage() {
echo "
Usage:
(First time)
./vmconffix.sh /tmp/vmware-tools-distrib/vmware-install.pl
(Reconfiguring)
./vmconffix.sh /usr/bin/vmware-config-tools.pl
"
exit
}
# Check and see if we got a command to run
if [ "${1}" == "" ]; then
echo "No VMWare tool argument"
usage
fi
# See if the VMWare tool argument makes sense
REGEX1="vmware-config-tools.pl"
REGEX2="vmware-install.pl"
RESULT1=`echo ${VMWCT} | /bin/grep -c $REGEX1`
RESULT2=`echo ${VMWCT} | /bin/grep -c $REGEX2`
if [ "$RESULT1" != "1" ] && [ "$RESULT2" != "1" ] ; then
echo "Invalid VMWare tool argument"
usage
fi
# See if Xorg is actually installed
if [ ! -e ${XORG} ]; then
echo "Xorg does not appear to be instaled."
exit
fi
# Test for and backup orginal file XFree86
if [ -e ${XFREE86} ]; then
/bin/mv -f ${XFREE86} ${XFREE86}-bak
fi
# Create 'fix' XFree86 file
cat > ${XFREE86} << EOF
#!/bin/sh
echo "XFree86 Version 4.3.0.1"
EOF
# Make our 'fix' executable
/bin/chmod a+x ${XFREE86}
# Run VMWare config tools
${VMWCT}
# Test for and restore orginal file XFree86
if [ -e ${XFREE86}-bak ]; then
/bin/mv -f ${XFREE86}-bak ${XFREE86}
else
# No original XFree86 existed so simply delete our 'fix'
/bin/rm -f ${XFREE86}
fi
# Account for odds and ends issues I have come across
# Clean up possible case error from vmware-config-tools.pl
/usr/bin/perl -pi.kbak -e 's|(Driver\s*)"Keyboard"|$1"keyboard"|;' ${XETC}/${XF86CONFIG}
# Clean up possible mouse device issue from vmware-config-tools.pl
/usr/bin/perl -pi.mbak -e 's|(Option\s*"Device"\s*)"/dev/mouse"|$1"/dev/input/mice"|;' ${XETC}/${XF86CONFIG}
# Clean up X links (vmware thinks we have XFree86)
/bin/rm -f ${XETC}/X ${X}
/bin/ln -s $XORG ${XETC}/X
if [ -e /usr/X11R6/bin/Xwrapper ]; then
# Account for a Mandrakeism
/bin/ln -s Xwrapper ${X}
else
/bin/ln -s Xorg ${X}
fi
FILE_VMCONF_FIXER
chmod a+x $VMCONF_FIXER
# Creating new (fixed) config script
cat > ${VMCONF_FIXED} << FILE_VMCONF_NEW
#!/bin/sh
$VMCONF_FIXER $VMCONF
FILE_VMCONF_NEW
chmod a+x $VMCONF_FIXED