diff options
author | Jean-Marc Lenoir | 2018-09-29 13:27:04 +0200 |
---|---|---|
committer | Jean-Marc Lenoir | 2018-09-29 13:27:04 +0200 |
commit | 013fc11c135dadd4f45e611e087c2c164cd76e36 (patch) | |
tree | 7c885fed26513102e5b5d5bd6f434a0785fcea3a | |
download | aur-013fc11c135dadd4f45e611e087c2c164cd76e36.tar.gz |
Initial commit.
-rw-r--r-- | .SRCINFO | 91 | ||||
-rw-r--r-- | Makefile | 24 | ||||
-rw-r--r-- | PKGBUILD | 441 | ||||
-rw-r--r-- | bootstrap | 11 | ||||
-rw-r--r-- | config | 26 | ||||
-rw-r--r-- | config.xml | 880 | ||||
-rwxr-xr-x | configure-initscript.sh | 97 | ||||
-rw-r--r-- | datastores.xml | 16 | ||||
-rw-r--r-- | dkms.conf.in | 30 | ||||
-rw-r--r-- | environments.xml | 46 | ||||
-rw-r--r-- | pam.d-vmware-authd | 5 | ||||
-rw-r--r-- | proxy.xml | 50 | ||||
-rw-r--r-- | unlocker.py | 399 | ||||
-rw-r--r-- | vmAutoStart.xml | 9 | ||||
-rw-r--r-- | vmmon.patch | 47 | ||||
-rw-r--r-- | vmnet.patch | 16 | ||||
-rw-r--r-- | vmware-environment.sh | 14 | ||||
-rw-r--r-- | vmware-hostd-certificates.service | 11 | ||||
-rw-r--r-- | vmware-hostd.service | 11 | ||||
-rw-r--r-- | vmware-networks-configuration.service | 14 | ||||
-rw-r--r-- | vmware-networks.service | 14 | ||||
-rw-r--r-- | vmware-usbarbitrator.service | 8 | ||||
-rw-r--r-- | vmware-vix-bootstrap | 2 | ||||
-rw-r--r-- | vmware-workstation.install | 19 |
24 files changed, 2281 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..92a89249a2d2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,91 @@ +pkgbase = vmware-workstation14 + pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC. + pkgver = 14.1.3 + pkgrel = 1 + url = https://www.vmware.com/products/workstation-for-linux.html + install = vmware-workstation.install + arch = x86_64 + license = custom + makedepends = sqlite + makedepends = python2 + makedepends = unzip + depends = dkms + depends = ncurses5-compat-libs + depends = fuse2 + depends = gtk3 + depends = gtkmm3 + depends = libcanberra + depends = pcsclite + depends = hicolor-icon-theme + optdepends = linux-headers: build modules against Arch kernel + provides = vmware-workstation=14.1.3 + provides = vmware-ovftool + conflicts = vmware-workstation + conflicts = vmware-modules-dkms + conflicts = vmware-ovftool + conflicts = vmware-patch + conflicts = vmware-systemd-services + options = !strip + options = emptydirs + backup = etc/vmware/config + backup = etc/vmware/hostd/authorization.xml + backup = etc/vmware/hostd/config.xml + backup = etc/vmware/hostd/datastores.xml + backup = etc/vmware/hostd/dispatcher.xml + backup = etc/vmware/hostd/proxy.xml + backup = etc/vmware/hostd/tagExtractor.xml + backup = etc/vmware/netmap.conf + backup = etc/vmware/ssl/hostd.ssl.config + backup = etc/pam.d/vmware-authd + backup = etc/conf.d/vmware + source = https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-14.1.3-9474260.x86_64.bundle + source = bootstrap + source = vmware-vix-bootstrap + source = config + source = pam.d-vmware-authd + source = configure-initscript.sh + source = vmware-environment.sh + source = config.xml + source = datastores.xml + source = environments.xml + source = proxy.xml + source = vmAutoStart.xml + source = vmware-hostd-certificates.service + source = vmware-hostd.service + source = vmware-networks-configuration.service + source = vmware-networks.service + source = vmware-usbarbitrator.service + source = dkms.conf.in + source = Makefile + source = vmmon.patch + source = vmnet.patch + source = https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/10.1.3/9472307/packages/com.vmware.fusion.tools.darwinPre15.zip.tar + source = https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/10.1.3/9472307/packages/com.vmware.fusion.tools.darwin.zip.tar + source = unlocker.py + sha256sums = 29d128ad6e1f2fc72414fd80d5bc8f82f186f1e21ab09db44441f1e84b5e0373 + sha256sums = 12e7b16abf8d7e858532edabb8868919c678063c566a6535855b194aac72d55e + sha256sums = da1698bf4e73ae466c1c7fc93891eba4b9c4581856649635e6532275dbfea141 + sha256sums = d9a5f8b919d52aa2f279d8eaf0bb495780eb9fd8bbc2c58bba223cdca78cc991 + sha256sums = d50aa0a3fe94025178965d988e18d41eb60aa1ce2b28ee6e3ca15edeabfa2ca7 + sha256sums = 8e4d08668a66be79a900521792b39c16a026cc90659241edee80b64e701bfbcd + sha256sums = de71ada1f5d5132fa75646a4f35cac2e50c54f250c315461633719c4b9cb3614 + sha256sums = 9f508d5f7ce4b69d9f40f6fb0ff0fb3d5b26a3c48658da994bf63975d1b589ab + sha256sums = 434cd4aa440d36b75ee20e0b588aaad874bb0d796173990bc4046667c66f5099 + sha256sums = 57c7568a89e8af1914cf7aea84d8fefd6e7af4155557081292344326d652ae70 + sha256sums = 3c802523606184a5e8ebbe931d9c6c70d83ff8c6833b9f48aa264f0bd5a18a88 + sha256sums = ad522a8cbc6103134ce5e677a01b503cd21875cbceb37bd13fd870ebd9ad0e6d + sha256sums = f9440479f3ae5ad0a39bba3150276627878bf83d6879444fb327c53a1dbb5a4d + sha256sums = 70301aa4eff4f42d7d39b276445dc7d8f44b8a0e184775e8a9e3055bb9d8590a + sha256sums = e3812b78158672c7d96b6a58877681462f3fbdfe99a948b32c80c755c8682450 + sha256sums = a651de50e91f386057d69d11e2cdf6e020229aae0631f25073ca09fbb878d1db + sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d + sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487 + sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d + sha256sums = 9f93fa48c658474080482f2714c30bf0a850f40c2d7c739473dc9c489ce3da7b + sha256sums = c2e981d5d6a4fab4d33d4e3df394bdb597834fae14ebb535a40271c3f2677f0d + sha256sums = 87a5356c947af3651c240b5ebf3f1e1bcf2c4bba58c466a23bd1d7f5adba0830 + sha256sums = bcd4fafd41e627c2ab9a86d562f74ef27822b61a346306e848a67161732005aa + sha256sums = cb9ecff2d9210ea0022d5ac1b2c274dba0ec9b79c031386627f2a668913e1a38 + +pkgname = vmware-workstation14 + diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..4b589921549f --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +MODULES = \ + vmmon \ + vmnet \ + #vmblock \ + #vmci \ + #vsock + +all: $(foreach m, $(MODULES), $m.ko) + +%.ko: % + $(MAKE) KVERSION=$(KVERSION) VM_KBUILD=yes -C $*-only + +$(MODULES): %: + cp -r $(SRCDIR)/$*-only $*-only + +vsock.ko: vmci.ko + +clean: + rm -rf $(MODULES) + rm -rf $(foreach m, $(MODULES), $m-only) + rm -f $(foreach m, $(MODULES), $m.ko) + rm -f $(foreach m, $(MODULES), $m.o) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..60de572a7d0b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,441 @@ +# Maintainer: Jean-Marc Lenoir <archlinux "at" jihemel "dot" com> + +############################################################################ +# Patch VMware Workstation to enable macOS guests support +# Uncomment the line below to enable it + +#_enable_macOS_guests=y + +# CAUTION: Run macOS on a non Apple computer may be forbidden in your country. +# Source of the patch: https://github.com/DrDonk/unlocker +# Forum: http://www.insanelymac.com/forum/topic/303311-workstation-1112-player-712-fusion-78-and-esxi-6-mac-os-x-unlocker-2 +############################################################################ + +#PKGEXT=.pkg.tar +pkgname=vmware-workstation14 +pkgver=14.1.3 +_buildver=9474260 +_pkgver=${pkgver}_${_buildver} +pkgrel=1 +pkgdesc='The industry standard for running multiple operating systems as virtual machines on a single Linux PC.' +arch=(x86_64) +url='https://www.vmware.com/products/workstation-for-linux.html' +license=(custom) +install="vmware-workstation.install" +conflicts=( + vmware-workstation + vmware-modules-dkms + vmware-ovftool + vmware-patch + vmware-systemd-services +) +provides=( + vmware-workstation=$pkgver + vmware-ovftool +) +depends=( + dkms + ncurses5-compat-libs + fuse2 + gtk3 # for gtk-query-settings binary + gtkmm3 + libcanberra + pcsclite + hicolor-icon-theme + # needed to replace internal libs: + #zlib +) +optdepends=( + 'linux-headers: build modules against Arch kernel' +) +makedepends=( + sqlite +) +backup=( + 'etc/vmware/config' + 'etc/vmware/hostd/authorization.xml' + 'etc/vmware/hostd/config.xml' + 'etc/vmware/hostd/datastores.xml' + 'etc/vmware/hostd/dispatcher.xml' + 'etc/vmware/hostd/proxy.xml' + 'etc/vmware/hostd/tagExtractor.xml' + 'etc/vmware/netmap.conf' + 'etc/vmware/ssl/hostd.ssl.config' + 'etc/pam.d/vmware-authd' + 'etc/conf.d/vmware' +) +source=( + "https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-${_pkgver/_/-}.${CARCH}.bundle" + + 'bootstrap' + 'vmware-vix-bootstrap' + 'config' + 'pam.d-vmware-authd' + 'configure-initscript.sh' + 'vmware-environment.sh' + + 'config.xml' + 'datastores.xml' + 'environments.xml' + 'proxy.xml' + 'vmAutoStart.xml' + + 'vmware-hostd-certificates.service' + 'vmware-hostd.service' + 'vmware-networks-configuration.service' + 'vmware-networks.service' + 'vmware-usbarbitrator.service' + + 'dkms.conf.in' + 'Makefile' + 'vmmon.patch' + 'vmnet.patch' +) +sha256sums=( + '29d128ad6e1f2fc72414fd80d5bc8f82f186f1e21ab09db44441f1e84b5e0373' + + '12e7b16abf8d7e858532edabb8868919c678063c566a6535855b194aac72d55e' + 'da1698bf4e73ae466c1c7fc93891eba4b9c4581856649635e6532275dbfea141' + 'd9a5f8b919d52aa2f279d8eaf0bb495780eb9fd8bbc2c58bba223cdca78cc991' + 'd50aa0a3fe94025178965d988e18d41eb60aa1ce2b28ee6e3ca15edeabfa2ca7' + '8e4d08668a66be79a900521792b39c16a026cc90659241edee80b64e701bfbcd' + 'de71ada1f5d5132fa75646a4f35cac2e50c54f250c315461633719c4b9cb3614' + + '9f508d5f7ce4b69d9f40f6fb0ff0fb3d5b26a3c48658da994bf63975d1b589ab' + '434cd4aa440d36b75ee20e0b588aaad874bb0d796173990bc4046667c66f5099' + '57c7568a89e8af1914cf7aea84d8fefd6e7af4155557081292344326d652ae70' + '3c802523606184a5e8ebbe931d9c6c70d83ff8c6833b9f48aa264f0bd5a18a88' + 'ad522a8cbc6103134ce5e677a01b503cd21875cbceb37bd13fd870ebd9ad0e6d' + + 'f9440479f3ae5ad0a39bba3150276627878bf83d6879444fb327c53a1dbb5a4d' + '70301aa4eff4f42d7d39b276445dc7d8f44b8a0e184775e8a9e3055bb9d8590a' + 'e3812b78158672c7d96b6a58877681462f3fbdfe99a948b32c80c755c8682450' + 'a651de50e91f386057d69d11e2cdf6e020229aae0631f25073ca09fbb878d1db' + 'd7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d' + + '05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487' + '6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d' + '9f93fa48c658474080482f2714c30bf0a850f40c2d7c739473dc9c489ce3da7b' + 'c2e981d5d6a4fab4d33d4e3df394bdb597834fae14ebb535a40271c3f2677f0d' +) +options=(!strip emptydirs) + + +_isoimages=(freebsd linux linuxPreGlibc25 netware solaris windows winPre2k winPreVista) + +if [ -n "$_enable_macOS_guests" ]; then + +_vmware_fusion_ver=10.1.3_9472307 +# List of VMware Fusion versions: https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/ + +makedepends+=( + python2 + unzip +) + +source+=( + "https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/${_vmware_fusion_ver/_//}/packages/com.vmware.fusion.tools.darwinPre15.zip.tar" + "https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/${_vmware_fusion_ver/_//}/packages/com.vmware.fusion.tools.darwin.zip.tar" + 'unlocker.py' +) +sha256sums+=( + '87a5356c947af3651c240b5ebf3f1e1bcf2c4bba58c466a23bd1d7f5adba0830' + 'bcd4fafd41e627c2ab9a86d562f74ef27822b61a346306e848a67161732005aa' + 'cb9ecff2d9210ea0022d5ac1b2c274dba0ec9b79c031386627f2a668913e1a38' +) + +_fusion_isoimages=(darwin darwinPre15) +fi + + +_create_database_file() { + # Create a database which contains the list of guest tools (necessary to avoid that vmware try to download them) + local database_filename="$pkgdir/etc/vmware-installer/database" + echo -n "" > "$database_filename" + + sqlite3 "$database_filename" "CREATE TABLE settings(key VARCHAR PRIMARY KEY, value VARCHAR NOT NULL, component_name VARCHAR NOT NULL);" + sqlite3 "$database_filename" "INSERT INTO settings(key,value,component_name) VALUES('db.schemaVersion','2','vmware-installer');" + sqlite3 "$database_filename" "CREATE TABLE components(id INTEGER PRIMARY KEY, name VARCHAR NOT NULL, version VARCHAR NOT NULL, buildNumber INTEGER NOT NULL, component_core_id INTEGER NOT NULL, longName VARCHAR NOT NULL, description VARCHAR, type INTEGER NOT NULL);" + + for isoimage in ${_isoimages[@]} + do + local version=$(cat "$srcdir/extracted/vmware-tools-$isoimage/manifest.xml" | grep -oPm1 "(?<=<version>)[^<]+") + sqlite3 "$database_filename" "INSERT INTO components(name,version,buildNumber,component_core_id,longName,description,type) VALUES(\"vmware-tools-$isoimage\",\"$version\",\"${_pkgver#*_}\",1,\"$isoimage\",\"$isoimage\",1);" + done + +if [ -n "$_enable_macOS_guests" ]; then + for isoimage in ${_fusion_isoimages[@]} + do + sqlite3 "$database_filename" "INSERT INTO components(name,version,buildNumber,component_core_id,longName,description,type) VALUES(\"vmware-tools-$isoimage\",\"1\",\"${_vmware_fusion_ver#*_}\",1,\"$isoimage\",\"$isoimage\",1);" + done +fi +} + +prepare() { + extracted_dir="$srcdir/extracted" + [[ -d "$extracted_dir" ]] && rm -r "$extracted_dir" + + bash \ + "$(readlink -f "$srcdir/VMware-Workstation-Full-${_pkgver/_/-}.${CARCH}.bundle")" \ + --extract "$extracted_dir" + +if [ -n "$_enable_macOS_guests" ]; then + for isoimage in ${_fusion_isoimages[@]} + do + unzip -q com.vmware.fusion.tools.$isoimage.zip + rm manifest.plist + done + + sed -i -e "s|/usr/lib/vmware/|${pkgdir}/usr/lib/vmware/|" "$srcdir/unlocker.py" +fi +} + +package() { + local vmware_installer_version=$(cat "$srcdir/extracted/vmware-installer/manifest.xml" | grep -oPm1 "(?<=<version>)[^<]+") + + # Make directories and copy files. + + mkdir -p \ + "$pkgdir/etc"/{cups,pam.d,modprobe.d,profile.d,thnuclnt,vmware} \ + "$pkgdir/usr"/{share,bin} \ + "$pkgdir/usr/include/vmware-vix" \ + "$pkgdir/usr/lib"/{vmware/{setup,lib/libvmware-vim-cmd.so},vmware-vix,vmware-ovftool,vmware-installer/"$vmware_installer_version",cups/filter,modules-load.d} \ + "$pkgdir/usr/share"/{doc/vmware-vix,licenses/"$pkgname"} \ + "$pkgdir/var/lib/vmware/Shared VMs" + + cd "$srcdir/extracted" + + cp -r \ + vmware-workstation/share/* \ + vmware-workstation/man \ + vmware-network-editor-ui/share/* \ + vmware-player-app/share/* \ + "$pkgdir/usr/share" + + cp -r \ + vmware-workstation/bin/* \ + vmware-vmx/{,s}bin/* \ + vmware-vix-core/bin/* \ + vmware-vprobe/bin/* \ + vmware-workstation-server/{vmware-hostd,vmware-vim-cmd,vmware-wssc-adminTool} \ + vmware-network-editor-ui/bin/* \ + vmware-player-app/bin/* \ + "$pkgdir/usr/bin" + + cp -r \ + vmware-workstation/lib/* \ + vmware-player-app/lib/* \ + vmware-vmx/{lib/*,roms} \ + vmware-vprobe/lib/* \ + vmware-workstation-server/{bin,lib,hostd} \ + vmware-usbarbitrator/bin \ + vmware-network-editor/lib \ + "$pkgdir/usr/lib/vmware" + + cp -r \ + vmware-player-setup/vmware-config \ + "$pkgdir/usr/lib/vmware/setup" + + cp -rL \ + vmware-workstation-server/config/etc/vmware/* \ + vmware-workstation-server/etc/vmware/* \ + "$srcdir"/{bootstrap,config} \ + "$pkgdir/etc/vmware" + + cp -r \ + vmware-vix-lib-Workstation1400/lib/Workstation-14.0.0 \ + vmware-vix-core/{lib/*,vixwrapper-config.txt} \ + "$pkgdir/usr/lib/vmware-vix" + cp vmware-vix-core/vix-perl.tar.nogz "$pkgdir/usr/lib/vmware-vix/vix-perl.tar.gz" + + cp -r \ + vmware-vix-core/doc/* \ + "$pkgdir/usr/share/doc/vmware-vix" + + cp -r \ + vmware-ovftool/* \ + "$pkgdir/usr/lib/vmware-ovftool" + + cp -r \ + vmware-installer/{python,sopython,vmis,vmis-launcher,vmware-installer,vmware-installer.py} \ + "$pkgdir/usr/lib/vmware-installer/$vmware_installer_version" + + cp -r \ + vmware-player-app/etc/cups/* \ + "$pkgdir/etc/cups" + cp -r \ + vmware-player-app/extras/.thnumod \ + "$pkgdir/etc/thnuclnt" + cp -r \ + vmware-player-app/extras/thnucups \ + "$pkgdir/usr/lib/cups/filter" + + cp -r \ + vmware-vix-core/include/* \ + "$pkgdir/usr/include/vmware-vix" + + for isoimage in ${_isoimages[@]} + do + install -Dm 644 "vmware-tools-$isoimage/$isoimage.iso" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso" + install -Dm 644 "vmware-tools-$isoimage/$isoimage.iso.sig" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso.sig" + done + + install -Dm 644 "vmware-workstation/doc/EULA" "$pkgdir/usr/share/licenses/$pkgname/VMware Workstation - EULA.txt" + install -Dm 644 "vmware-workstation/doc"/*open_source_licenses.txt "$pkgdir/usr/share/licenses/$pkgname" + mv "$pkgdir/usr/lib/vmware-ovftool/vmware.eula" "$pkgdir/usr/share/licenses/$pkgname/VMware OVF Tool component for Linux - EULA.txt" + rm "$pkgdir/usr/lib/vmware-ovftool"/{vmware-eula.rtf,open_source_licenses.txt,manifest.xml} + + install -Dm 755 "$srcdir/configure-initscript.sh" "$pkgdir/usr/lib/vmware-installer/$vmware_installer_version/bin/configure-initscript.sh" + + install -Dm 644 "vmware-vmx/etc/modprobe.d/modprobe-vmware-fuse.conf" "$pkgdir/etc/modprobe.d/vmware-fuse.conf" + + install -Dm 644 vmware-player-app/lib/isoimages/tools-key.pub "$pkgdir/usr/lib/vmware/isoimages/tools-key.pub" + + install -Dm 644 vmware-vmx/extra/modules.xml "$pkgdir/usr/lib/vmware/modules/modules.xml" + install -Dm 644 vmware-installer/bootstrap "$pkgdir/etc/vmware-installer/bootstrap" + install -Dm 644 "$srcdir/vmware-vix-bootstrap" "$pkgdir/etc/vmware-vix/bootstrap" + + for hostd_file in config datastores environments proxy vmAutoStart; do + install -Dm 644 "$srcdir/$hostd_file.xml" "$pkgdir/etc/vmware/hostd/$hostd_file.xml" + done + + install -Dm 644 "$srcdir/pam.d-vmware-authd" "$pkgdir/etc/pam.d/vmware-authd" + + echo -e "vmw_vmci\nvmmon" > "$pkgdir/usr/lib/modules-load.d/vmware.conf" + + for service_file in \ + vmware-hostd-certificates.service \ + vmware-hostd.service \ + vmware-networks-configuration.service \ + vmware-networks.service \ + vmware-usbarbitrator.service + do + install -Dm 644 \ + "$srcdir/$service_file" \ + "$pkgdir/usr/lib/systemd/system/$service_file" + done + + + # Apply permissions where necessary. + + chmod +x \ + "$pkgdir/usr/bin"/* \ + "$pkgdir/usr/lib/vmware/bin"/* \ + "$pkgdir/usr/lib/vmware/setup"/* \ + "$pkgdir/usr/lib/vmware/lib"/libvmware-gksu.so/gksu-run-helper \ + "$pkgdir/usr/lib/vmware-ovftool"/{ovftool,ovftool.bin} \ + "$pkgdir/usr/lib/vmware-installer/$vmware_installer_version"/{vmware-installer,vmis-launcher} \ + "$pkgdir/usr/lib/cups/filter"/* \ + "$pkgdir/usr/lib/vmware-vix/setup"/* \ + "$pkgdir/etc/thnuclnt/.thnumod" + + chmod -R 600 "$pkgdir/etc/vmware/ssl" + chmod +s \ + "$pkgdir/usr/bin"/vmware-authd \ + "$pkgdir/usr/lib/vmware/bin"/{vmware-vmx,vmware-vmx-debug,vmware-vmx-stats} + + + # Add symlinks the installer would create. + + for link in \ + licenseTool \ + vmplayer \ + vmware \ + vmware-app-control \ + vmware-enter-serial \ + vmware-fuseUI \ + vmware-gksu \ + vmware-hostd \ + vmware-modconfig \ + vmware-modconfig-console \ + vmware-mount \ + vmware-netcfg \ + vmware-tray \ + vmware-vim-cmd \ + vmware-vmblock-fuse \ + vmware-vprobe \ + vmware-wssc-adminTool \ + vmware-zenity \ + #vmware-unity-helper + do + ln -s /usr/lib/vmware/bin/appLoader "$pkgdir/usr/lib/vmware/bin/$link" + done + + for link in \ + vmware-mount \ + vmware-usbarbitrator + do + ln -s /usr/lib/vmware/bin/$link "$pkgdir/usr/bin/$link" + done + + ln -s /usr/lib/vmware/icu "$pkgdir/etc/vmware/icu" + ln -s /usr/lib/vmware/lib/diskLibWrapper.so/diskLibWrapper.so "$pkgdir/usr/lib/diskLibWrapper.so" + ln -s /usr/lib/vmware/lib/libvmware-hostd.so/libvmware-hostd.so "$pkgdir/usr/lib/vmware/lib/libvmware-vim-cmd.so/libvmware-vim-cmd.so" + ln -s /usr/lib/vmware-ovftool/ovftool "$pkgdir/usr/bin/ovftool" + ln -s /usr/lib/vmware-vix/libvixAllProducts.so "$pkgdir/usr/lib/libvixAllProducts.so" + + + # Replace placeholder "variables" with real paths. + + for file in \ + gtk-3.0/gdk-pixbuf.loaders + do + sed -i 's,@@LIBCONF_DIR@@,/usr/lib/vmware/libconf,g' "$pkgdir/usr/lib/vmware/libconf/etc/$file" + done + + sed -i 's,@@BINARY@@,/usr/bin/vmware,' "$pkgdir/usr/share/applications/vmware-workstation.desktop" + sed -i 's,@@BINARY@@,/usr/bin/vmplayer,' "$pkgdir/usr/share/applications/vmware-player.desktop" + sed -i 's,@@BINARY@@,/usr/bin/vmware-netcfg,' "$pkgdir/usr/share/applications/vmware-netcfg.desktop" + + sed -i 's,@@AUTHD_PORT@@,902,' "$pkgdir/usr/lib/vmware/hostd/docroot/client/clients.xml" + + sed \ + -e "s/@@VERSION@@/$vmware_installer_version/" \ + -e "s,@@VMWARE_INSTALLER@@,/usr/lib/vmware-installer/$vmware_installer_version," \ + -i "$pkgdir/etc/vmware-installer/bootstrap" + + + # Patch up the VMware kernel sources and configure DKMS. + + dkms_dir="$pkgdir/usr/src/$pkgname-$_pkgver" + + install -Dm 644 "$srcdir/Makefile" "$dkms_dir/Makefile" + install -Dm 644 "$srcdir/dkms.conf.in" "$dkms_dir/dkms.conf" + + sed \ + -e "s/@PKGNAME@/$pkgname/g" \ + -e "s/@PKGVER@/$_pkgver/g" \ + -i "$dkms_dir/dkms.conf" + + for module in vmmon vmnet; do # vmblock vmci vsock + tar -xf "vmware-vmx/lib/modules/source/$module.tar" -C "$dkms_dir" + msg "Patching $module module for DKMS" + patch -p2 --read-only=ignore --directory="$dkms_dir/$module-only" < "$srcdir/$module.patch" + done + + rm -r "$pkgdir/usr/lib/vmware/modules/source" + +if [ -n "$_enable_macOS_guests" ]; then + msg "Patching VMware for macOS guest support" + python2 "$srcdir/unlocker.py" > /dev/null + + for isoimage in ${_fusion_isoimages[@]} + do + install -Dm 644 "$srcdir/payload/$isoimage.iso" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso" + install -Dm 644 "$srcdir/payload/$isoimage.iso.sig" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso.sig" + done +fi + + _create_database_file + + # Define some environment variables for VMware and remove the tests about kernel modules + install -Dm 644 "$srcdir/vmware-environment.sh" "$pkgdir/etc/conf.d/vmware" + for program in vmware vmplayer vmware-netcfg vmware-tray; do + sed -e '/export PRODUCT_NAME/asource /etc/conf.d/vmware' \ + -e 's/if "$BINDIR"\/vmware-modconfig --appname=.*/if true ||/' \ + -i "$pkgdir/usr/bin/$program" + done + + # to solve bugs with incompatibles library versions: + #ln -sf /usr/lib/libz.so.1 "$pkgdir/usr/lib/vmware/lib/libz.so.1/" +} diff --git a/bootstrap b/bootstrap new file mode 100644 index 000000000000..981b82191cca --- /dev/null +++ b/bootstrap @@ -0,0 +1,11 @@ +PREFIX="/usr" +BINDIR="/usr/bin" +SBINDIR="/usr/sbin" +LIBDIR="/usr/lib" +DATADIR="/usr/share" +SYSCONFDIR="/etc" +DOCDIR="/usr/share/doc" +MANDIR="/usr/share/man" +INCLUDEDIR="/usr/include" +INITDIR="" +INITSCRIPTDIR="/usr/lib/systemd/scripts" diff --git a/config b/config new file mode 100644 index 000000000000..fce6aadfbde5 --- /dev/null +++ b/config @@ -0,0 +1,26 @@ +.encoding = "UTF-8" +VMCI_CONFED = "yes" +NETWORKING = "yes" +initscriptdir = "/usr/lib/systemd/scripts" +VMBLOCK_CONFED = "yes" +authd.fullpath = "/usr/bin/vmware-authd" +gksu.rootMethod = "su" +VSOCK_CONFED = "yes" +libdir = "/usr/lib/vmware" +bindir = "/usr/bin" +vmware.fullpath = "/usr/bin/vmware" +vix.libdir = "/usr/lib/vmware-vix" +installerDefaults.componentDownloadEnabled = "no" +installerDefaults.autoSoftwareUpdateEnabled.epoch = "4641104763" +vix.config.version = "1" +player.product.version = "14.0.0" +installerDefaults.dataCollectionEnabled.epoch = "7910652514" +installerDefaults.dataCollectionEnabled = "no" +installerDefaults.transferVersion = "1" +installerDefaults.autoSoftwareUpdateEnabled = "no" +product.buildNumber = "6661328" +authd.client.port = "902" +authd.proxy.nfc = "vmware-hostd:ha-nfc" +product.version = "14.0.0" +workstation.product.version = "14.0.0" +product.name = "VMware Workstation" diff --git a/config.xml b/config.xml new file mode 100644 index 000000000000..68f851ad72dd --- /dev/null +++ b/config.xml @@ -0,0 +1,880 @@ +<!-- VMware Host Agent configuration file --> + +<config> + <!-- current working directory --> + <workingDir>./</workingDir> + + <!-- location to examine for configuration files that are needed --> + <defaultConfigPath> /etc/vmware/ </defaultConfigPath> + + <!-- location for docroot, plugins, libraries, etc. --> + <defaultInstallPath> /usr/lib/vmware </defaultInstallPath> + + <!-- stdout for hostd process --> + <!-- <stdoutFile>/var/log/vmware/hostd-stdout.txt</stdoutFile> --> + + <!-- stderr for hostd process --> + <!-- <stderrFile>/var/log/vmware/hostd-stderr.txt</stderrFile> --> + + <!-- Memory death point for hostd --> + <!-- <hostdStopMemInMB> 250 </hostdStopMemInMB> --> + <!-- <hostdStopMemInPercent> 80 </hostdStopMemInPercent> --> + + <!-- Memory watermark for hostd --> + <!-- <hostdWarnMemInMB> 180 </hostdWarnMemInMB> --> + <!-- <hostdWarnMemInPercent> 60 </hostdWarnMemInPercent> --> + + <!-- hostd min num of fds --> + <!-- Override by vmacore/threadPool/MaxFdsPerThread --> + <!-- hostdMinFds> 2048 </hostdMinFds --> + + <!-- hostd absolute max num of fds --> + <!-- hostdMaxFds> 4096 </hostdMaxFds --> + + <!-- hostd mmap threshold in kilo bytes --> + <hostdMmapThreshold> 32 </hostdMmapThreshold> + + <!-- Mode in which hostd runs: defines product type --> + <hostdMode> ws </hostdMode> + + <!-- True if hostd is running in simulator mode --> + <mockup> + <enabled> false </enabled> + <!-- Bump the count if hostd runs out of memory in simulator mode when + you create more VMs --> + <supportedVMs> 128 </supportedVMs> + </mockup> + + <!-- Frequency of memory checker --> + <!-- <memoryCheckerTimeInSecs> 30 </memoryCheckerTimeInSecs> --> + + <log> + <!-- controls where rolling log files are stored + If directory is changed from default, may also want to + pass '-l some-dir' to hostd program at startup. + --> + + <directory>/var/log/vmware/</directory> + + <!-- name of log file --> + <name>hostd</name> + + <!-- If true, redirect stderr to stdout. stdout inherits from + parent process. Log() (limited to default log level (see below)) + will then be written to stdout. If false, stderr and stdout + are redirected to /dev/null on linux. On win32 this option is + not used. + At runtime, see vimsh internalsvc/redirect_stdout|err + --> + <outputToConsole>true</outputToConsole> + + <!-- If true, logs to syslog --> + <outputToSyslog>false</outputToSyslog> + + <!-- If true, log to files on disk --> + <!-- <outputToFiles>true</outputToFiles> --> + + <!-- syslog configuration. Only used if outputToSyslog is true. --> + <syslog> + <!-- syslog identifier to use when logging --> + <ident>Hostd</ident> + + <!-- syslog facility to use when logging --> + <facility>local4</facility> + + <!-- The section header contents are placed in this file at startup. + When vmsyslogd rotates the hostd log file, it logs the content of this + file to syslog. This is being done so that we don't lose context on log + rotations. + IMPORTANT: Value needs to match that in onrotate entry in + vmsyslog.d/hostd.conf + --> + <logHeaderFile>/var/run/vmware/hostdLogHeader.txt</logHeaderFile> + + </syslog> + + <!-- default size(in bytes) of each log file before rolling over to next --> + <!-- <maxFileSize>10485760</maxFileSize> --> + + <!-- default number of log files to rotate amongst --> + <!-- <maxFileNum>10</maxFileNum> --> + + <!-- default log level --> + <level>verbose</level> + + <!-- if false disable logging to memory buffer --> + <!-- <outputToMemory>true</outputToMemory> --> + + <!-- default memory log level --> + <!-- <memoryLevel>verbose</memoryLevel> --> + + <!-- memory log buffer size in KB --> + <!-- <memoryLogSizeK>64</memoryLogSizeK> --> + </log> + + <!-- The root password will expire if this value is set to true --> + <rootPasswdExpiration>false</rootPasswdExpiration> + + <!-- Log level configuration (Rules are applied in order) + <level id = "0"> + <logName> App </logName> + <logLevel> info </logLevel> + <memoryLevel>verbose</memoryLevel> + <prefix> true </prefix> + </level> + <level id = "1"> + <logName> BaseLibs </logName> + <logLevel> quiet </logLevel> + <memoryLevel>verbose</memoryLevel> + <prefix> false </prefix> + </level> + <level id = "2"> + <logName> Vmsvc </logName> + <logLevel> info </logLevel> + <memoryLevel>verbose</memoryLevel> + <prefix> true </prefix> + </level> + <level id = "3"> + <logName> /vmfs/volumes/foo/foo.vmx </logName> + <logLevel> trivia </logLevel> + <memoryLevel>verbose</memoryLevel> + <prefix> false </prefix> + </level> + <level id = "Vigor"> + <logName> Vigor </logName> + <logLevel> info </logLevel> + <memoryLevel>verbose</memoryLevel> + <prefix> true </prefix> + </level> + --> + <level id = "4"> + <logName> SoapAdapter.HTTPService </logName> + <logLevel> info </logLevel> + <prefix> false </prefix> + </level> + + <level id="TCP"> + <logName>TCP</logName> + <logLevel>error</logLevel> + <prefix>false</prefix> + </level> + + <!-- + <level id="IO"> + <logName>IO</logName> + <logLevel>error</logLevel> + <prefix>false</prefix> + </level> + --> + + <!-- + Logger for the data passed through the proxy + Uncomment the following block to enable it. + + WARNING: this data may contain sensitive informatino, such as + passwords, session IDs, etc. + --> + <!-- + <level id="ProxyReqData"> + <logName>Proxy Req Data</logName> + <logLevel>trivia</logLevel> + <prefix>true</prefix> + </level> + --> + + <!-- Remove the following node to disable SSL --> + <ssl> + <!-- The server private key file --> + <privateKey>/etc/vmware/ssl/rui.key</privateKey> + + <!-- The server side certificate file --> + <certificate>/etc/vmware/ssl/rui.crt</certificate> + + <!-- The SSL version to use --> + <!-- <sslVersion>all</sslVersion> --> + </ssl> + + <!-- Directory on the Console OS accessible to the DatastoreBrowser --> + <browsableConsoleDir>/vmimages</browsableConsoleDir> + + <!-- Location of vm inventory file on legacy host --> + <!-- <legacyVmInventory>/etc/vmware/vm-list</legacyVmInventory> --> + + <!-- VMOMI configuration --> + <vmomi> + <!-- MOB configuration --> + <mob> + <!-- Max size of POST requests in KB --> + <!-- <maxPostRequestSizeKB>1024</maxPostRequestSizeKB> --> + </mob> + <!-- VMOMI validator configuration --> + <validation> + <!-- The validation is enabled by default --> + <!-- <enabled>true</enabled> --> + </validation> + </vmomi> + + <vmacore> + <pluginBaseDir>./</pluginBaseDir> + <!-- default thread pool configuration for Posix impl --> + <threadPool> + <IoMin>2</IoMin> + <IoMax>32</IoMax> + <TaskMin>2</TaskMin> + <TaskMax>12</TaskMax> + <MaxFdsPerThread> 2048 </MaxFdsPerThread> + <NumKeepAlive>8</NumKeepAlive> + <ThreadCheckTimeSecs>600</ThreadCheckTimeSecs> + <ThreadStackSizeKb>256</ThreadStackSizeKb> + <threadNamePrefix>hostd</threadNamePrefix> + <!-- <threadCountWarningThreshold>2</threadCountWarningThreshold> --> + + <!-- Use fair work queues thread pool. --> + <!-- <fairThreadPool>true</fairThreadPool> --> + + <!-- defaults to 14, Max number of threads used for FWQ items --> + <!-- <maxThreads>14</maxThreads> --> + + <!-- defaults to 5, Initial number of threads used for FWQ items --> + <!-- <minThreads>5</minThreads> --> + + <!-- defaults to 2, number of IO threads used by the FWQ thread pool --> + <!-- These threads perform the asynchronous IO and provide timer services. + Generally small number should be enough as no blocking operations + are executed within IO threads. + A CPU intensive operation performed in these threads is SSL handling, + so on multi-CPU machine with high volume of SSL traffic it may be + beneficial increasing this number. + --> + <!-- <ioThreads>2</ioThreads> --> + + <!-- defaults to 3, Ratio between the number of concurrent items in a + priority and threads reserved for higher priority queues. + One thread is reserver for every N concurrent items. --> + <!-- <reservationRatio>3</reservationRatio> --> + + </threadPool> + <ssl> + <doVersionCheck> false </doVersionCheck> + <libraryPath>/usr/lib/vmware</libraryPath> + <!-- allowed SSL/TLS protocol versions --> + <!-- <protocols>tls1.0,tls1.1,tls1.2</protocols> --> + + <!-- timeouts for the SSL handshake. the default is 20 sec. --> + <!-- <handshakeTimeoutMs>60000</handshakeTimeoutMs> --> + </ssl> + + <http> + <!-- timeouts for HTTP connections. the defaults are infinite. --> + <!-- <readTimeoutMs>60000</readTimeoutMs> --> + <!-- <writeTimeoutMs>60000</writeTimeoutMs> --> + + <!-- Num of max proxy connections --> + <!-- PR 604415: Temporary lower the connections limit to 128 --> + <maxConnections> 128 </maxConnections> + </http> + + <vmdb> + <!-- maximum number of VMDB connections allowed --> + <!-- <maxConnectionCount>100</maxConnectionCount> --> + + <!-- timeouts for VMDB connections. the defaults are infinite. --> + <!-- <readTimeoutMs>60000</readTimeoutMs> --> + <!-- <writeTimeoutMs>60000</writeTimeoutMs> --> + </vmdb> + + <!-- enable plugin loading --> + <loadPlugins> true </loadPlugins> + + <!-- enable/disable the dynamic loading of plugins --> + <loadDynamicPlugins> false </loadDynamicPlugins> + + <!-- Enable/disable the stack tracer --> + <!-- <useStackTracer>false</useStackTracer> --> + + <xml> + <doc> + <!-- maximum size of each XML message. --> + <maxChars>104857600</maxChars> + <!-- maximum nodes in of each XML message. --> + <maxNodes>524288</maxNodes> + <!-- maximum node depth of each XML message. --> + <maxDepth>1000</maxDepth> + </doc> + </xml> + </vmacore> + + <dispatcher> + <!-- turns dispatcher on/off --> + <!-- <enabled>true</enabled> --> + + <!-- Enables debugging output --> + <!-- <debug>false</debug> --> + + <!-- Debug flags --> + <!-- <flags>0</flags> --> + + <!-- The file containing dispatcher policies --> + <dispatcherConfig>/etc/vmware/hostd/dispatcher.xml</dispatcherConfig> + + <!-- The file containing tag extraction rules --> + <tagExtractorConfig>/etc/vmware/hostd/tagExtractor.xml</tagExtractorConfig> + </dispatcher> + + <plugins> + <vimsvc> + <path>libvimsvc.so</path> + + <!-- default administrator principal --> + <!-- <defaultPrincipal>root</defaultPrincipal> --> + + <!-- default file used to persist ACL data --> + <!-- <authorization>/etc/vmware/hostd/authorization.xml</authorization> --> + + <!-- default file used to supply required privileges for dynamic methods --> + <!-- <dynMethodPrivConfig>/etc/vmware/hostd/dynMethodPriv.xml</dynMethodPrivConfig> --> + + <!-- default setting for performing authorization checks --> + <enableAuthCheck>true</enableAuthCheck> + + <!-- default setting for where vmware-hostd-ticket directory is created --> + <!-- <localTicketParentDir>/var/run</localTicketParentDir> --> + + <!-- default setting for life time of a local ticket --> + <!-- <localTicketLifeSecs>10</localTicketLifeSecs> --> + + <!-- default setting for maximum number of times a ticket can be used --> + <!-- <localTicketMaxUse>1</localTicketMaxUse> --> + + <!-- time to retain tasks after they complete --> + <!-- <taskRetentionInMins> 10 </taskRetentionInMins> --> + + <!-- cleanup interval time between task reaping --> + <!-- <taskCleanupIntervalInMins> 1 </taskCleanupIntervalInMins> --> + + <!-- maximum number of events to store --> + <!-- <maxEvents>1000</maxEvents> --> + + <!-- development build default setting for license mockup --> + <licenseMockup>false</licenseMockup> + + <!-- Disable i18nFilter --> + <!-- <i18nFilterDisabled> false </i18nFilterDisabled> --> + <!-- cloning of objects by i18nFilter --> + <!-- <i18nCloneDisabled> true </i18nCloneDisabled> --> + <license> + <!-- location of the read-write flexlm configuration file --> + <!-- <config> /etc/vmware/license.cfg </config> --> + </license> + <userManager> + <!-- Max time in seconds to wait for a subcommand to complete --> + <!-- <subcommandWait> 10 </subcommandWait> --> + </userManager> + + <!-- VC API lockdown mode (MN) - true to enable handling it --> + <apiLockdown>true</apiLockdown> + + <requires>hostsvc solo</requires> + + </vimsvc> + <hostsvc> + <path>libhostsvc.so</path> + + <vflash> + <defaultVFlashModule>vfc</defaultVFlashModule> + <vffsUuid>0</vffsUuid> + <refreshVffsInterval>30</refreshVffsInterval> + </vflash> + + <datastore> + <!-- default datastore inventory--> + <!-- <inventory>/etc/vmware/hostd/datastores.xml</inventory> --> + + <!-- default datastore refresh interval in minutes --> + <!-- use 0 to disable the auto refresh --> + <!-- <refreshInterval>0</refreshInterval> --> + + <!-- default refresh interval for datastore-freespace when provisioning virtual disks --> + <!-- <refreshVdiskInterval>30</refreshVdiskInterval> --> + </datastore> + + <mockup> + <!-- turns mockup impl on/off --> + <enabled>false</enabled> + + <!-- default filepath for host info --> + <filepath>/etc/vmware/hostd/mockup-host-config.xml</filepath> + </mockup> + <vmResources>/etc/vmware/hostd/vmResources.xml</vmResources> + + <!-- default location of the hostsvc config file --> + <!-- <config>/etc/vmware/hostd/hostsvc.xml</config> --> + + <!-- default location of the resource pool config file --> + <!-- <pools>/etc/vmware/hostd/pools.xml</pools> --> + + <!-- default location of the host service list --> + <services>/etc/vmware/service/</services> + + <storage> + <!-- storage data synchronization policy--> + + <!-- policy: invalidate on configuration change (default) --> + <!-- <syncpolicy>invalid_change</syncpolicy> --> + + <!-- policy: always fetch data when queried --> + <!-- <syncpolicy>fetch_always</syncpolicy> --> + + <!-- policy: fetch data on configuration change --> + <!-- <syncpolicy>fetch_change</syncpolicy> --> + + <!-- default storage inventory refetch interval, after getting multiple Path-state change events, in seconds --> + <refetchStorageInterval>120</refetchStorageInterval> + </storage> + + <rsrc> + <!-- Refresh interval (in seconds) for root resource pool capacity --> + <!-- <refreshInterval>60</refreshInterval> --> + </rsrc> + <vmfs2upgrade> + <!-- <undoattempts>15</undoattempts> --> + <!-- <timeoutmsec>2000</timeoutmsec> --> + </vmfs2upgrade> + + <!-- Controls to enable/disable expressions in the datastore filter --> + <!-- <datastoresystem> --> + <!-- <diskfilter> --> + <!-- <NoUsbDisks>true</NoUsbDisks> --> + <!-- <UsedAsVmRdm>true</UsedAsVmRdm> --> + <!-- </diskfilter> --> + <!-- </datastoresystem> --> + + <!-- Controls to enable/disable expressions in the SCSI LUN filter --> + <!-- <scsilunfilter> --> + <!-- <NoUsbDisks>true</NoUsbDisks> --> + <!-- </scsilunfilter> --> + + <!-- Controls to enable/disable expressions in the RDM filter --> + <!-- <rdmfilter> --> + <!-- <RdmCapable>true</RdmCapable> --> + <!-- </rdmfilter> --> + <!-- <maxVms> 512 </maxVms> --> + <NetmapFile> /etc/vmware/netmap.conf </NetmapFile> + + + <!-- Storage I/O Resource Manager settings --> + <storageiorm> + <enabled>false</enabled> + <congestionThreshold.min>5</congestionThreshold.min> + <congestionThreshold.max>100</congestionThreshold.max> + <congestionThreshold.default>30</congestionThreshold.default> + </storageiorm> + </hostsvc> + <vmsvc> + <path>libvmsvc.so</path> + <mockup> + <enabled>false</enabled> + </mockup> + <enableMockup>false</enableMockup> + + <!-- + Check for version mismatches against the vmkernel. + This is disabled by default for developers but for all other + users, they must keep their vmkernels upto date. + --> + <checkVersionMismatch> false </checkVersionMismatch> + <!-- <vmDirectory> /home/vmware </vmDirectory> --> + <!-- <maxSnapshotDepth> 32 </maxSnapshotDepth> --> + + <!-- Configuration options for quiesced snapshots --> + <quiescedSnap> + <!-- Seconds that quiesce requests will queue before continuing. --> + <!-- <serializeTimeout> 120 </serializeTimeout> --> + </quiescedSnap> + + <!-- The maximum number of virtual disks allowed on this host --> + <!-- <maxDisksPerVirtualMachine> 120 </maxDisksPerVirtualMachine> --> + + <!-- The timer interval for task updates in microseconds --> + <!-- <taskTimerInterval> 1000000 </taskTimerInterval> --> + + <!-- Default user context to use to perform VM operations --> + <!-- <datastorePrincipal>root</datastorePrincipal> --> + + <!-- Virtual machine VMotion parameters --> + <vmotion> + <!-- Timeout for VMotion prepare operation (milliseconds) --> + <!-- <prepareTimeout> 30000 </prepareTimeout> --> + + <!-- Timeout for VMotion source initiate operation (milliseconds) --> + <!-- <srcInitiateTimeout> 30000 </srcInitiateTimeout> --> + + <!-- Timeout for VMotion destination ID population (milliseconds) --> + <!-- <dstIdTimeout> 120000 </dstIdTimeout> --> + </vmotion> + <!-- <defaultPowerOffType> soft </defaultPowerOffType> --> + <!-- <defaultSuspendType> hard </defaultSuspendType> --> + <!-- <defaultResetType> hard </defaultResetType> --> + <!-- <validateVMId> false </validateVMId> --> + <!-- <heartbeatCheckTimeInSecs> 30 </heartbeatCheckTimeInSecs> --> + <!-- <heartbeatRedAlert> 0.40 </heartbeatRedAlert> --> + <!-- <heartbeatYellowAlert> 0.80 </heartbeatYellowAlert> --> + + <!-- Setting to enable/disable activation of change tracking --> + <!-- when upgrading a virtual machine's HW version to HW7 or newer --> + <!-- or when adding a new disk to a HW7 or newer VM. --> + <!-- <useChangeTracking> true </useChangeTracking> --> + + <!-- Setting to enable/disable the use of vigorVim to read the --> + <!-- vm configuration information --> + <useVigorVim> true </useVigorVim> + + <requires>vimsvc</requires> + + </vmsvc> + <vcsvc> + <path>libvcsvc.so</path> + <mockup> + <enabled>false</enabled> + </mockup> + <!-- VMotion parameters --> + <vmotion> + <!-- Location of the VMotion journal; either an absolute --> + <!-- path or relative to the default log path --> + <!-- <journalDir> journal </journalDir> --> + + <!-- Source-side VMotion timeout (milliseconds) --> + <!-- <srcBeginTimeout> 240000 </srcBeginTimeout> --> + + <!-- Destination-side VMotion timeout (milliseconds) --> + <!-- <dstBeginTimeout> 60000 </dstBeginTimeout> --> + </vmotion> + + <!-- AgentManager parameters --> + <agentMgr> + <!-- Timeout (in seconds) for the upgrade command --> + <!-- <timeout> 360 </timeout> --> + + <!-- Name of the upgrade directory (relative to a provided tmpdir) --> + <!-- <upgradeDir> ha-agentmgr </upgradeDir> --> + + <!-- upgradeCerts is a path to a file containing accepted signer certificates --> + <!-- <upgradeCerts>/usr/share/certs/vmware.cert</upgradeCerts> --> + + <!-- Path to shell --> + <!-- <shellPath>/bin/sh</shellPath> --> + + </agentMgr> + + <requires>hostsvc</requires> + + </vcsvc> + <solo> + <path>libsolo.so</path> + <mockup> + <enabled>false</enabled> + </mockup> + + <!-- The file containing the list of environment description files --> + <environments>/etc/vmware/hostd/environments.xml</environments> + + <!-- The file containing the virtual machine inventory --> + <vmInventory>/etc/vmware/hostd/vmInventory.xml</vmInventory> + + <!-- The file containing the AutoStart settings --> + <!-- <vmAutoStart>/etc/vmware/hostd/vmAutoStart.xml</vmAutoStart> --> + + <!-- The file containing the resource pool and VM resource settings --> + <!-- <resources>/etc/vmware/hostd/resources.xml</resources> --> + + <!-- The file containing the provisoning policies --> + <provisioningPolicy>/etc/vmware/hostd/env/provisioningPolicy.xml</provisioningPolicy> + + <!-- The file containing the hardware info mockup --> + <hwInfo>/etc/vmware/hostd/hwInfo.xml</hwInfo> + + <!-- Controls to enable/disable expressions in the RDM filter --> + <!-- <rdmfilter> --> + <!-- Only show disks that are attached to shared storage. --> + <!-- <HbaIsShared>true</HbaIsShared> --> + + <!-- Only show disks that are not an extent of a VMFS volume. --> + <!-- <UsedByVmfs>true</UsedByVmfs> --> + + <!-- Only show disks that are not already used as an RDM target. --> + <!-- <UsedAsVmRdm>true</UsedAsVmRdm> --> + <!-- </rdmfilter> --> + + <!-- Disable Resource Pool Initialization --> + <!-- <disableResourcePoolInit> false </disableResourcePoolInit> --> + + <!-- Soap port. Also turns on proxy forwarding to a TCP port --> + <soapPort> 8307 </soapPort> + + <!-- Secure Soap port for accecpting SSL tunneling from proxy --> + <!-- If disabled, SSL tunneling is done over a named pipe. --> + <!-- <secureSoapPort> 8306 </secureSoapPort> --> + + <!-- Whether to enable secure Soap adapter --> + <enableSecureSoap> false </enableSecureSoap> + + <!-- 64 bit support --> + <!-- <support64bit> true </support64bit> --> + + <!-- Enable Vmomi tracing --> + <!-- <traceVmomi> true </traceVmomi> --> + + <!-- The log level at which to output vmomi tracing --> + <traceAt> verbose </traceAt> + + <!-- Whether to only trace faults in the return --> + <!-- <traceFaultsOnly> true </traceFaultsOnly> --> + + <!-- Cause segv --> + <!-- <causeSegv> false </causeSegv> --> + + <!-- Cause exception --> + <!-- <causeException> false </causeException> --> + + <loglevels> + <module> + <name> disklib </name> + <level> 0 </level> + </module> + <!-- <module> --> + <!-- <name> baz </name> --> + <!-- <level> 2 </level> --> + <!-- <extension> bar </extension> --> + <!-- </module> --> + </loglevels> + + <!-- web server settings --> + <webServer> + + <docRoot> /usr/lib/vmware/hostd/docroot/</docRoot> + <cgiBinPath> /usr/lib/vmware/hostd/cgi-bin/</cgiBinPath> + </webServer> + + <!-- Enable managed object browser --> + <!-- <enableMob>true</enableMob> --> + + <!-- periodic keep alive logging --> + <!-- <runTimerTest> false </runTimerTest> --> + <!-- <runTimerIntervalInSecs> 3 </runTimerIntervalInSecs> --> + + <dynamo> + <enabled> false </enabled> + + <manager id="0"> + <enabled> true </enabled> + <moId>ha-dynamic-type-manager-python</moId> + <type>soap-stdio</type> + <soap-stdio> + <command>/usr/bin/sh</command> + <arg id="0">-l</arg> + <arg id="1">-c</arg> + <arg id="2">/usr/bin/python -m PyVmomiServer -g --loglevel info -s PyVmomiServer</arg> + </soap-stdio> + </manager> + + <manager id="1"> + <enabled> false </enabled> + <moId>ha-dynamic-type-manager-vapi</moId> + <type>soap-http</type> + <soap-http> + <port>8088</port> + <command>/usr/bin/sh</command> + <arg id="0">-l</arg> + <arg id="1">-c</arg> + <arg id="2">/sbin/vapid -s vapid</arg> + </soap-http> + </manager> + + <manager id="2"> + <enabled> true </enabled> + <moId>ha-dynamic-type-manager-local-cli</moId> + <type>vmware-cli</type> + <vmware-cli> + <path>/usr/lib/vmware/esxcli</path> + </vmware-cli> + </manager> + </dynamo> + + <!-- Managed method executer --> + <!-- <mme> --> + <!-- <enabled> true </enabled> --> + <!-- </mme> --> + + <requires>hostsvc</requires> + </solo> + + <!-- Reverse HTTP Proxy service --> + <proxysvc> + <path>libproxysvc.so</path> + + <!-- default location of the proxy config file for hosted products--> + <config>/etc/vmware/hostd/proxy.xml</config> + <!-- default location of proxy config file for ESX--> + <endpoints>/etc/vmware/rhttpproxy/endpoints.conf</endpoints> + <requires>hostsvc</requires> + + </proxysvc> + + <statssvc> + <path>libstatssvc.so</path> + <enabled>false</enabled> + <mockup> + <!-- turns mockup impl on/off --> + <enabled>false</enabled> + </mockup> + + <!-- Directory to store stats related files in --> + <!-- <depotDir> /var/lib/vmware/hostd/stats/ </depotDir> --> + + <!-- Name of the StatsDepot --> + <!-- <depotName> hostAgentStats </depotName> --> + + <!-- Max number of stats to purge in one shot --> + <!-- <maxStatsPurged> 1000 </maxStatsPurged> --> + + <!-- Real time stats collection interval --> + <!-- <collectionInterval> 20 </collectionInterval> --> + + <!-- Enable historical stats collection --> + <!-- <historicalStatsEnabled> true </historicalStatsEnabled> --> + <!-- Enable collection of virtual disk stats --> + <!-- <collectVdiskStats> true </collectVdiskStats> --> + <!-- Enable collection of Host Datastore stats --> + <!-- <collectHostDsStats> true </collectHostDsStats> --> + <!-- Enable collection of Storage Path and Adapter stats --> + <!-- <collectPathAdapterStats> true </collectPathAdapterStats> --> + <!-- Enable collection of VM Datastore stats --> + <!-- <collectVmDsStats>true </collectVmDsStats> --> + <!-- Enable collection of VFlash Module stats --> + <!-- <collectVFlashModuleStats> true </collectVFlashModuleStats> --> + <!-- Enable collection of VSAN DOM stats --> + <!-- <collectVSanDomStats> false </collectVSanDomStats> --> + + </statssvc> + + <partitionsvc> + <path>libpartitionsvc.so</path> + <enabled>false</enabled> + </partitionsvc> + + <internalsvc> + <path>libinternalsvc.so</path> + <requires>hostsvc</requires> + </internalsvc> + + <!-- The nfc service --> + <nfcsvc> + <path>libnfcsvc.so</path> + <enabled>true</enabled> + <mockup> + <enabled>false</enabled> + </mockup> + </nfcsvc> + + <snmpsvc> + <enabled>false</enabled> + <path>libsnmpsvc.so</path> + </snmpsvc> + + <blklistsvc> + <path>libblklistsvc.so</path> + <enabled>false</enabled> + <!-- <leaseTimeoutSecs> 150 </leaseTimeoutSecs> --> + <!-- <wblEnabled> true </wblEnabled> --> + </blklistsvc> + + <cimsvc> + <path>libcimsvc.so</path> + <enabled>false</enabled> + <maxSelEntries>40</maxSelEntries> + <pollTime>90</pollTime> + </cimsvc> + + <directorysvc> + <path>libdirectorysvc.so</path> + <enabled>false</enabled> + <mockup> + <enabled>false</enabled> + </mockup> + </directorysvc> + + <vdisksvc> + <path>libvdisksvc.so</path> + <enabled>false</enabled> + <mockup> + <enabled>false</enabled> + </mockup> + </vdisksvc> + + <vslmsvc> + <path>libvslmsvc.so</path> + <enabled>false</enabled> + <mockup> + <enabled>false</enabled> + </mockup> + </vslmsvc> + + <httpnfcsvc> + <path>libhttpnfcsvc.so</path> + <enabled>false</enabled> + <mockup> + <enabled>false</enabled> + </mockup> + <requires>proxysvc</requires> + </httpnfcsvc> + + <ovfmgrsvc> + <path>libovfmgrsvc.so</path> + <enabled>true</enabled> + </ovfmgrsvc> + + <dynsvc> + <path>libdynsvc.so</path> + <enabled>false</enabled> + <dynamic>true</dynamic> + </dynsvc> + + <guestsvc> + <path>libguestsvc.so</path> + <enabled>false</enabled> + </guestsvc> + + <hbrsvc> + <path>libhbrsvc.so</path> + <enabled>false</enabled> + <mockup> + <!-- Mock HBR is on if running in the the simulator --> + <enabled>false</enabled> + </mockup> + <requires>vmsvc</requires> + </hbrsvc> + + <cbrcsvc> + <path>libcbrcsvc.so</path> + <enabled>false</enabled> + </cbrcsvc> + + <hostspecsvc> + <path>libhostspecsvc.so</path> + <enabled>false</enabled> + </hostspecsvc> + + + </plugins> + + <!--Locale preferences--> + <!--DefaultLocale - this is the preferred default locale --> + <!--InstallPath - this is the location of the locale files--> + <!-- + <locale> + <DefaultLocale>en_US</DefaultLocale> + <InstallPath>./locale/</InstallPath> + </locale> + --> + +</config>
\ No newline at end of file diff --git a/configure-initscript.sh b/configure-initscript.sh new file mode 100755 index 000000000000..95d9e9cc5bb8 --- /dev/null +++ b/configure-initscript.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +action="$1" # add, remove, or status +serviceName="$2" +startLevel="$3" +stopLevel="$4" + +# Notes: +# This package does not need a vmware service to make VMware usable, so this script says that vmware service is always started. +# vmware-workstation-server service is named vmware-hostd in this package. + +case "$serviceName" in + vmware-workstation-server) + serviceName="vmware-hostd" + ;; +esac + +#echo $serviceName && exit # DEBUG + +addService() { + if [ "$serviceName" != "vmware" ]; then + systemctl start $serviceName.service + systemctl enable $serviceName.service + fi +} + +removeService() { + if [ "$serviceName" != "vmware" ]; then + systemctl stop $serviceName.service + systemctl disable $serviceName.service + fi +} + +# Check to see whether a program is set to start on boot. +checkService() { + if [ "$serviceName" = "vmware" ]; then + retval=0 + else + systemctl is-active $serviceName.service > /dev/null + retval=$? + fi + + if [ "$retval" = "0" ]; then + echo 'on' + exit 5 + else + echo 'off' + exit 6 + fi +} + +usage() { + echo "Syntax for this script is as follows:" + echo "" + echo " $0 <action> <serviceName>" + echo "" + echo " action - add or remove" + echo " serviceName - The name of the service" + echo "" + echo "" + echo " $0 status <serviceName>" + echo " serviceName - The name of the service" + echo "" +} + + + +case $action in + add) + # Don't allow any empty arguments for add + if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ] || [ "$4" = "" ]; then + usage + exit 1 + fi + addService + ;; + remove) + # Don't allow any empty arguments for remove + if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ] || [ "$4" = "" ]; then + usage + exit 1 + fi + removeService + ;; + status) + # We only need the serviceName to check status + if [ "$1" = "" ] || [ "$2" = "" ]; then + usage + exit 1 + fi + checkService + ;; + *) + usage + exit 1 + ;; +esac diff --git a/datastores.xml b/datastores.xml new file mode 100644 index 000000000000..a457a95241fc --- /dev/null +++ b/datastores.xml @@ -0,0 +1,16 @@ +<ConfigRoot> + <LocalDatastores> + <_length>1</_length> + <_type>hostd.host.LocalDatastoreEntry[]</_type> + <e id="0"> + <_type>hostd.host.LocalDatastoreEntry</_type> + <id>1</id> + <name>standard</name> + <path>/var/lib/vmware/Shared VMs</path> + </e> + </LocalDatastores> + <NasVolumes> + <_length>0</_length> + <_type>hostd.host.NasDatastoreEntry[]</_type> + </NasVolumes> +</ConfigRoot>
\ No newline at end of file diff --git a/dkms.conf.in b/dkms.conf.in new file mode 100644 index 000000000000..64c93aa0c18c --- /dev/null +++ b/dkms.conf.in @@ -0,0 +1,30 @@ +# Linux DKMS config script for the VMware guest kernel modules + +PACKAGE_NAME="@PKGNAME@" +PACKAGE_VERSION="@PKGVER@" +MAKE="make KVERSION=$kernelver SRCDIR=/usr/src/$PACKAGE_NAME-$PACKAGE_VERSION" +CLEAN="make clean" +AUTOINSTALL="YES" + +BUILT_MODULE_NAME[0]="vmmon" +BUILT_MODULE_LOCATION[0]='vmmon-only' +DEST_MODULE_LOCATION[0]="/kernel/drivers/misc" + +BUILT_MODULE_NAME[1]="vmnet" +BUILT_MODULE_LOCATION[1]='vmnet-only' +DEST_MODULE_LOCATION[1]="/kernel/drivers/net" + +# seems that this module is never used +#BUILT_MODULE_NAME[2]="vmblock" +#BUILT_MODULE_LOCATION[2]='vmblock-only' +#DEST_MODULE_LOCATION[2]="/kernel/fs/vmblock" + +# vmci is already provided by the kernel with vmw_vmci +#BUILT_MODULE_NAME[3]="vmci" +#BUILT_MODULE_LOCATION[3]='vmci-only' +#DEST_MODULE_LOCATION[3]="/kernel/drivers/misc" + +# vsock is already provided by the kernel +#BUILT_MODULE_NAME[4]="vsock" +#BUILT_MODULE_LOCATION[4]='vsock-only' +#DEST_MODULE_LOCATION[4]="/kernel/net/vmw_vsock" diff --git a/environments.xml b/environments.xml new file mode 100644 index 000000000000..57a099d3a52d --- /dev/null +++ b/environments.xml @@ -0,0 +1,46 @@ +<Environment> + <Cfg id = "1"> + <Descriptor> /etc/vmware/hostd/env/ws-hw3.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw3.xml</Options> + </Cfg> + <Cfg id = "2"> + <Descriptor> /etc/vmware/hostd/env/ws-hw4.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw4.xml</Options> + </Cfg> + <Cfg id = "3"> + <Descriptor> /etc/vmware/hostd/env/ws-hw6.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw6.xml</Options> + </Cfg> + <Cfg id = "4"> + <Descriptor> /etc/vmware/hostd/env/ws-hw7.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw7.xml</Options> + </Cfg> + <Cfg id = "5"> + <Descriptor> /etc/vmware/hostd/env/ws-hw8.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw8.xml</Options> + </Cfg> + <Cfg id = "6"> + <Descriptor> /etc/vmware/hostd/env/ws-hw9.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw9.xml</Options> + </Cfg> + <Cfg id = "7"> + <Descriptor> /etc/vmware/hostd/env/ws-hw10.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw10.xml</Options> + </Cfg> + <Cfg id = "8"> + <Descriptor> /etc/vmware/hostd/env/ws-hw11.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw11.xml</Options> + </Cfg> + <Cfg id = "9"> + <Descriptor> /etc/vmware/hostd/env/ws-hw12.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw12.xml</Options> + </Cfg> + <Cfg id = "10"> + <Descriptor> /etc/vmware/hostd/env/ws-hw13.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw13.xml</Options> + </Cfg> + <Cfg id = "11"> + <Descriptor> /etc/vmware/hostd/env/ws-hw14.xml </Descriptor> + <Options> /etc/vmware/hostd/env/vmconfigoption-ws-hw14.xml</Options> + </Cfg> +</Environment> diff --git a/pam.d-vmware-authd b/pam.d-vmware-authd new file mode 100644 index 000000000000..44391264ebf9 --- /dev/null +++ b/pam.d-vmware-authd @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth required pam_unix.so +account required pam_unix.so +password required pam_permit.so +session required pam_unix.so diff --git a/proxy.xml b/proxy.xml new file mode 100644 index 000000000000..d9ab5039838c --- /dev/null +++ b/proxy.xml @@ -0,0 +1,50 @@ +<ConfigRoot> + <httpPort>-1</httpPort> + <httpsPort>443</httpsPort> + <EndpointList> + <_length>7</_length> + <_type>vim.ProxyService.EndpointSpec[]</_type> + <e id="0"> + <_type>vim.ProxyService.NamedPipeServiceSpec</_type> + <accessMode>httpAndHttps</accessMode> + <pipeName>/var/run/vmware/proxy-webserver</pipeName> + <serverNamespace>/</serverNamespace> + </e> + <e id="1"> + <_type>vim.ProxyService.LocalServiceSpec</_type> + <accessMode>httpsWithRedirect</accessMode> + <port>8307</port> + <serverNamespace>/sdk</serverNamespace> + </e> + <e id="2"> + <_type>vim.ProxyService.LocalServiceSpec</_type> + <accessMode>httpsWithRedirect</accessMode> + <port>8308</port> + <serverNamespace>/ui</serverNamespace> + </e> + <e id="3"> + <_type>vim.ProxyService.NamedPipeServiceSpec</_type> + <accessMode>httpsOnly</accessMode> + <pipeName>/var/run/vmware/proxy-vpxa</pipeName> + <serverNamespace>/vpxa</serverNamespace> + </e> + <e id="4"> + <_type>vim.ProxyService.NamedPipeServiceSpec</_type> + <accessMode>httpsWithRedirect</accessMode> + <pipeName>/var/run/vmware/proxy-mob</pipeName> + <serverNamespace>/mob</serverNamespace> + </e> + <e id="5"> + <_type>vim.ProxyService.LocalServiceSpec</_type> + <accessMode>httpAndHttps</accessMode> + <port>12001</port> + <serverNamespace>/ha-nfc</serverNamespace> + </e> + <e id="6"> + <_type>vim.ProxyService.LocalServiceSpec</_type> + <accessMode>httpAndHttps</accessMode> + <port>12000</port> + <serverNamespace>/nfc</serverNamespace> + </e> + </EndpointList> +</ConfigRoot> diff --git a/unlocker.py b/unlocker.py new file mode 100644 index 000000000000..2787e65d689e --- /dev/null +++ b/unlocker.py @@ -0,0 +1,399 @@ +#!/usr/bin/env python +""" +The MIT License (MIT) + +Copyright (c) 2014-2016 Dave Parsons & Sam Bingner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the 'Software'), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +vSMC Header Structure +Offset Length Struct Type Description +---------------------------------------- +0x00/00 0x08/08 Q ptr Offset to key table +0x08/08 0x04/4 I int Number of private keys +0x0C/12 0x04/4 I int Number of public keys + +vSMC Key Data Structure +Offset Length Struct Type Description +---------------------------------------- +0x00/00 0x04/04 4s int Key name (byte reversed e.g. #KEY is YEK#) +0x04/04 0x01/01 B byte Length of returned data +0x05/05 0x04/04 4s int Data type (byte reversed e.g. ui32 is 23iu) +0x09/09 0x01/01 B byte Flag R/W +0x0A/10 0x06/06 6x byte Padding +0x10/16 0x08/08 Q ptr Internal VMware routine +0x18/24 0x30/48 48B byte Data +""" + +from __future__ import print_function +import codecs +import os +import struct +import sys + +if sys.version_info < (2, 7): + sys.stderr.write('You need Python 2.7 or later\n') + sys.exit(1) + +# Setup imports depending on whether IronPython or CPython +if sys.platform == 'win32' \ + or sys.platform == 'cli': + # noinspection PyUnresolvedReferences + from _winreg import * + + +def bytetohex(data): + if sys.version_info > (3, 0): + # Python 3 code in this block + return "".join("{:02X} ".format(c) for c in data) + else: + # Python 2 code in this block + return "".join("{:02X} ".format(ord(c)) for c in data) + + +def joinpath(folder, filename): + return os.path.join(folder, filename) + + +def printkey(i, offset, smc_key, smc_data): + print(str(i + 1).zfill(3) + + ' ' + hex(offset) + + ' ' + smc_key[0][::-1].decode('UTF-8') + + ' ' + str(smc_key[1]).zfill(2) + + ' ' + smc_key[2][::-1].replace(b'\x00', b' ').decode('UTF-8') + + ' ' + '{0:#0{1}x}'.format(smc_key[3], 4) + + ' ' + hex(smc_key[4]) + + ' ' + bytetohex(smc_data)) + + +def set_bit(value, bit): + return value | (1 << bit) + + +def clear_bit(value, bit): + return value & ~(1 << bit) + + +def test_bit(value, bit): + return value & bit + + +E_CLASS64 = 2 +E_SHT_RELA = 4 + + +def patchelf(f, oldoffset, newoffset): + f.seek(0) + magic = f.read(4) + if not magic == b'\x7fELF': + raise Exception('Magic number does not match') + + ei_class = struct.unpack('=B', f.read(1))[0] + if ei_class != E_CLASS64: + raise Exception('Not 64bit elf header: ' + ei_class) + + f.seek(40) + e_shoff = struct.unpack('=Q', f.read(8))[0] + f.seek(58) + e_shentsize = struct.unpack('=H', f.read(2))[0] + e_shnum = struct.unpack('=H', f.read(2))[0] + e_shstrndx = struct.unpack('=H', f.read(2))[0] + + print('e_shoff: 0x{:x} e_shentsize: 0x{:x} e_shnum:0x{:x} e_shstrndx:0x{:x}'.format(e_shoff, e_shentsize, + e_shnum, e_shstrndx)) + + for i in range(0, e_shnum): + f.seek(e_shoff + i * e_shentsize) + e_sh = struct.unpack('=LLQQQQLLQQ', f.read(e_shentsize)) + # e_sh_name = e_sh[0] + e_sh_type = e_sh[1] + e_sh_offset = e_sh[4] + e_sh_size = e_sh[5] + e_sh_entsize = e_sh[9] + if e_sh_type == E_SHT_RELA: + e_sh_nument = int(e_sh_size / e_sh_entsize) + # print 'RELA at 0x{:x} with {:d} entries'.format(e_sh_offset, e_sh_nument) + for j in range(0, e_sh_nument): + f.seek(e_sh_offset + e_sh_entsize * j) + rela = struct.unpack('=QQq', f.read(e_sh_entsize)) + r_offset = rela[0] + r_info = rela[1] + r_addend = rela[2] + if r_addend == oldoffset: + r_addend = newoffset + f.seek(e_sh_offset + e_sh_entsize * j) + f.write(struct.pack('=QQq', r_offset, r_info, r_addend)) + print('Relocation modified at: ' + hex(e_sh_offset + e_sh_entsize * j)) + + +def patchkeys(f, key): + # Setup struct pack string + key_pack = '=4sB4sB6xQ' + # smc_old_memptr = 0 + smc_new_memptr = 0 + + # Do Until OSK1 read + i = 0 + while True: + + # Read key into struct str and data byte str + offset = key + (i * 72) + f.seek(offset) + smc_key = struct.unpack(key_pack, f.read(24)) + smc_data = f.read(smc_key[1]) + + # Reset pointer to beginning of key entry + f.seek(offset) + + if smc_key[0] == b'SKL+': + # Use the +LKS data routine for OSK0/1 + smc_new_memptr = smc_key[4] + print('+LKS Key: ') + printkey(i, offset, smc_key, smc_data) + + elif smc_key[0] == b'0KSO': + # Write new data routine pointer from +LKS + print('OSK0 Key Before:') + printkey(i, offset, smc_key, smc_data) + # smc_old_memptr = smc_key[4] + f.seek(offset) + f.write(struct.pack(key_pack, smc_key[0], smc_key[1], smc_key[2], smc_key[3], smc_new_memptr)) + f.flush() + + # Write new data for key + f.seek(offset + 24) + smc_new_data = codecs.encode('bheuneqjbexolgurfrjbeqfthneqrqcy', 'rot_13') + f.write(smc_new_data.encode('UTF-8')) + f.flush() + + # Re-read and print key + f.seek(offset) + smc_key = struct.unpack(key_pack, f.read(24)) + smc_data = f.read(smc_key[1]) + print('OSK0 Key After:') + printkey(i, offset, smc_key, smc_data) + + elif smc_key[0] == b'1KSO': + # Write new data routine pointer from +LKS + print('OSK1 Key Before:') + printkey(i, offset, smc_key, smc_data) + smc_old_memptr = smc_key[4] + f.seek(offset) + f.write(struct.pack(key_pack, smc_key[0], smc_key[1], smc_key[2], smc_key[3], smc_new_memptr)) + f.flush() + + # Write new data for key + f.seek(offset + 24) + smc_new_data = codecs.encode('rnfrqbagfgrny(p)NccyrPbzchgreVap', 'rot_13') + f.write(smc_new_data.encode('UTF-8')) + f.flush() + + # Re-read and print key + f.seek(offset) + smc_key = struct.unpack(key_pack, f.read(24)) + smc_data = f.read(smc_key[1]) + print('OSK1 Key After:') + printkey(i, offset, smc_key, smc_data) + + # Finished so get out of loop + break + + else: + pass + + i += 1 + return smc_old_memptr, smc_new_memptr + + +def patchsmc(name, sharedobj): + with open(name, 'r+b') as f: + + smc_old_memptr = 0 + smc_new_memptr = 0 + + # Read file into string variable + vmx = f.read() + + print('File: ' + name + '\n') + + # Setup hex string for vSMC headers + # These are the private and public key counts + smc_header_v0 = b'\xF2\x00\x00\x00\xF0\x00\x00\x00' + smc_header_v1 = b'\xB4\x01\x00\x00\xB0\x01\x00\x00' + + # Setup hex string for #KEY key + key_key = b'\x59\x45\x4B\x23\x04\x32\x33\x69\x75' + + # Setup hex string for $Adr key + adr_key = b'\x72\x64\x41\x24\x04\x32\x33\x69\x75' + + # Find the vSMC headers + smc_header_v0_offset = vmx.find(smc_header_v0) - 8 + smc_header_v1_offset = vmx.find(smc_header_v1) - 8 + + # Find '#KEY' keys + smc_key0 = vmx.find(key_key) + smc_key1 = vmx.rfind(key_key) + + # Find '$Adr' key only V1 table + smc_adr = vmx.find(adr_key) + + # Print vSMC0 tables and keys + print('appleSMCTableV0 (smc.version = "0")') + print('appleSMCTableV0 Address : ' + hex(smc_header_v0_offset)) + print('appleSMCTableV0 Private Key #: 0xF2/242') + print('appleSMCTableV0 Public Key #: 0xF0/240') + + if (smc_adr - smc_key0) != 72: + print('appleSMCTableV0 Table : ' + hex(smc_key0)) + smc_old_memptr, smc_new_memptr = patchkeys(f, smc_key0) + elif (smc_adr - smc_key1) != 72: + print('appleSMCTableV0 Table : ' + hex(smc_key1)) + smc_old_memptr, smc_new_memptr = patchkeys(f, smc_key1) + + print() + + # Print vSMC1 tables and keys + print('appleSMCTableV1 (smc.version = "1")') + print('appleSMCTableV1 Address : ' + hex(smc_header_v1_offset)) + print('appleSMCTableV1 Private Key #: 0x01B4/436') + print('appleSMCTableV1 Public Key #: 0x01B0/432') + + if (smc_adr - smc_key0) == 72: + print('appleSMCTableV1 Table : ' + hex(smc_key0)) + smc_old_memptr, smc_new_memptr = patchkeys(f, smc_key0) + elif (smc_adr - smc_key1) == 72: + print('appleSMCTableV1 Table : ' + hex(smc_key1)) + smc_old_memptr, smc_new_memptr = patchkeys(f, smc_key1) + + print() + + # Find matching RELA record in .rela.dyn in ESXi ELF files + # This is temporary code until proper ELF parsing written + if sharedobj: + print('Modifying RELA records from: ' + hex(smc_old_memptr) + ' to ' + hex(smc_new_memptr)) + patchelf(f, smc_old_memptr, smc_new_memptr) + + # Tidy up + f.flush() + f.close() + + +def patchbase(name): + # Patch file + print('GOS Patching: ' + name) + f = open(name, 'r+b') + + # Entry to search for in GOS table + # Should work for 12 & 14 of Workstation... + darwin = b'\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00' \ + '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + + # Read file into string variable + base = f.read() + + # Loop through each entry and set top bit + # 0xBE --> 0xBF (WKS 12) + # 0x3E --> 0x3F (WKS 14) + offset = 0 + while offset < len(base): + offset = base.find(darwin, offset) + if offset == -1: + break + f.seek(offset + 32) + flag = ord(f.read(1)) + flag = set_bit(flag, 0) + flag = chr(flag) + f.seek(offset + 32) + f.write(flag) + print('GOS Patched flag @: ' + hex(offset)) + offset += 40 + + # Tidy up + f.flush() + f.close() + print('GOS Patched: ' + name) + + +def patchvmkctl(name): + # Patch file + print('smcPresent Patching: ' + name) + f = open(name, 'r+b') + + # Read file into string variable + vmkctl = f.read() + applesmc = vmkctl.find(b'applesmc') + f.seek(applesmc) + f.write(b'vmkernel') + + # Tidy up + f.flush() + f.close() + print('smcPresent Patched: ' + name) + + +# noinspection PyUnresolvedReferences +def main(): + # Work around absent Platform module on VMkernel + if os.name == 'nt' or os.name == 'cli': + osname = 'windows' + else: + osname = os.uname()[0].lower() + + # vmwarebase = '' + vmx_so = False + + # Setup default paths + if osname == 'linux': + vmx_path = '/usr/lib/vmware/bin/' + vmx = joinpath(vmx_path, 'vmware-vmx') + vmx_debug = joinpath(vmx_path, 'vmware-vmx-debug') + vmx_stats = joinpath(vmx_path, 'vmware-vmx-stats') + if os.path.isfile('/usr/lib/vmware/lib/libvmwarebase.so/libvmwarebase.so'): + vmx_so = True + vmwarebase = '/usr/lib/vmware/lib/libvmwarebase.so/libvmwarebase.so' + else: + vmwarebase = '/usr/lib/vmware/lib/libvmwarebase.so.0/libvmwarebase.so.0' + + elif osname == 'windows': + reg = ConnectRegistry(None, HKEY_LOCAL_MACHINE) + key = OpenKey(reg, r'SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation') + vmwarebase_path = QueryValueEx(key, 'InstallPath')[0] + vmx_path = QueryValueEx(key, 'InstallPath64')[0] + vmx = joinpath(vmx_path, 'vmware-vmx.exe') + vmx_debug = joinpath(vmx_path, 'vmware-vmx-debug.exe') + vmx_stats = joinpath(vmx_path, 'vmware-vmx-stats.exe') + vmwarebase = joinpath(vmwarebase_path, 'vmwarebase.dll') + + else: + print('Unknown Operating System: ' + osname) + return + + # Patch the vmx executables skipping stats version for Player + patchsmc(vmx, vmx_so) + patchsmc(vmx_debug, vmx_so) + if os.path.isfile(vmx_stats): + patchsmc(vmx_stats, vmx_so) + + # Patch vmwarebase for Workstation and Player + patchbase(vmwarebase) + + +if __name__ == '__main__': + main() diff --git a/vmAutoStart.xml b/vmAutoStart.xml new file mode 100644 index 000000000000..422da117572b --- /dev/null +++ b/vmAutoStart.xml @@ -0,0 +1,9 @@ +<ConfigRoot> + <SystemDefaults> + <_type>vim.host.AutoStartManager.SystemDefaults</_type> + <startDelay>120</startDelay> + <stopAction>PowerOff</stopAction> + <stopDelay>120</stopDelay> + <waitForHeartbeat>false</waitForHeartbeat> + </SystemDefaults> +</ConfigRoot>
\ No newline at end of file diff --git a/vmmon.patch b/vmmon.patch new file mode 100644 index 000000000000..2aff1e3a7347 --- /dev/null +++ b/vmmon.patch @@ -0,0 +1,47 @@ +diff --git a/vmmon/Makefile b/vmmon/Makefile +index de8162e..6124a71 100644 +--- a/vmmon/Makefile ++++ b/vmmon/Makefile +@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared + endif + + ++ifdef KVERSION ++VM_UNAME = $(KVERSION) ++else + VM_UNAME = $(shell uname -r) ++endif + + # Header directory for the running kernel + ifdef LINUXINCLUDE +From: Michal Kubecek <mkubecek@suse.cz> +Date: Mon, 26 Mar 2018 13:33:32 +0200 +Subject: [PATCH] vmmon: fix indirect call with retpoline build +diff --git a/vmmon/common/task.c b/vmmon/common/task.c +index 98cc74a..400ebfe 100644 +--- a/vmmon/common/task.c ++++ b/vmmon/common/task.c +@@ -2203,12 +2203,23 @@ TaskSwitchToMonitor(VMCrossPage *crosspage) + { + uint64 raxGetsWiped, rcxGetsWiped; + ++#ifdef CALL_NOSPEC ++ __asm__ __volatile__(CALL_NOSPEC ++ : "=a" (raxGetsWiped), ++ "=c" (rcxGetsWiped) ++ : "0" (codePtr), ++ "1" (crosspage), ++ THUNK_TARGET(codePtr) ++ : "rdx", "r8", "r9", "r10", "r11", "cc", "memory"); ++#else + __asm__ __volatile__("call *%%rax" + : "=a" (raxGetsWiped), + "=c" (rcxGetsWiped) + : "0" (codePtr), + "1" (crosspage) + : "rdx", "r8", "r9", "r10", "r11", "cc", "memory"); ++#endif ++ + } + #elif defined(_MSC_VER) + /* diff --git a/vmnet.patch b/vmnet.patch new file mode 100644 index 000000000000..d2c620705ca3 --- /dev/null +++ b/vmnet.patch @@ -0,0 +1,16 @@ +diff --git a/vmnet/Makefile b/vmnet/Makefile +index 459846e..cd29652 100644 +--- a/vmnet/Makefile ++++ b/vmnet/Makefile +@@ -43,7 +43,11 @@ INCLUDE += -I$(SRCROOT)/shared + endif + + ++ifdef KVERSION ++VM_UNAME = $(KVERSION) ++else + VM_UNAME = $(shell uname -r) ++endif + + # Header directory for the running kernel + ifdef LINUXINCLUDE diff --git a/vmware-environment.sh b/vmware-environment.sh new file mode 100644 index 000000000000..7afe1c0f1598 --- /dev/null +++ b/vmware-environment.sh @@ -0,0 +1,14 @@ +# Uncomment the line below if you have a problem of incompatible libraries +#export VMWARE_USE_SHIPPED_LIBS=yes + +# Avoid an issue with some keyboard layouts using iBus +export GTK_IM_MODULE_FILE=/dev/null + +# Workaround to use the GTK theme +if [ -z "$GTK_THEME" ]; then + theme=$(gtk-query-settings gtk-theme-name | cut -d '"' -f2) + # Hack to know if the theme is compatible with GTK 3.14 (used by VMware) + if [ \( -d ~/.themes/"$theme" -a -d ~/.themes/"$theme"/gtk-3.20 \) -o \( -d /usr/share/themes/"$theme" -a -d /usr/share/themes/"$theme"/gtk-3.20 \) ]; then + export GTK_THEME="$theme" + fi +fi diff --git a/vmware-hostd-certificates.service b/vmware-hostd-certificates.service new file mode 100644 index 000000000000..8891ebe775ef --- /dev/null +++ b/vmware-hostd-certificates.service @@ -0,0 +1,11 @@ +[Unit] +Description=VMware Host Daemon Certificates Generation +ConditionPathExists=|!/etc/vmware/ssl/rui.key +ConditionPathExists=|!/etc/vmware/ssl/rui.crt + +[Service] +UMask=0077 +Environment=LD_LIBRARY_PATH=/usr/lib/vmware/lib/libssl.so.1.0.1:/usr/lib/vmware/lib/libcrypto.so.1.0.1 +ExecStart=/usr/lib/vmware/bin/openssl req -x509 -days 365 -newkey rsa:2048 -sha256 -keyout /etc/vmware/ssl/rui.key -out /etc/vmware/ssl/rui.crt -config /etc/vmware/ssl/hostd.ssl.config +Type=oneshot +RemainAfterExit=yes diff --git a/vmware-hostd.service b/vmware-hostd.service new file mode 100644 index 000000000000..5d755b770a2e --- /dev/null +++ b/vmware-hostd.service @@ -0,0 +1,11 @@ +[Unit] +Description=VMware Host Daemon +Wants=vmware-hostd-certificates.service +After=vmware-hostd-certificates.service + +[Service] +ExecStartPre=/usr/bin/mkdir -p /var/run/vmware +ExecStart=/usr/bin/vmware-hostd -a /etc/vmware/hostd/config.xml + +[Install] +WantedBy=multi-user.target diff --git a/vmware-networks-configuration.service b/vmware-networks-configuration.service new file mode 100644 index 000000000000..779b01a3171a --- /dev/null +++ b/vmware-networks-configuration.service @@ -0,0 +1,14 @@ +[Unit] +Description=VMware Networks Configuration Generation +ConditionPathExists=|!/etc/vmware/networking +ConditionPathExists=|!/etc/vmware/vmnet1/dhcpd/dhcpd.conf +ConditionPathExists=|!/etc/vmware/vmnet1/dhcpd/dhcpd.leases +ConditionPathExists=|!/etc/vmware/vmnet8/dhcpd/dhcpd.conf +ConditionPathExists=|!/etc/vmware/vmnet8/dhcpd/dhcpd.leases +ConditionPathExists=|!/etc/vmware/vmnet8/nat/nat.conf + +[Service] +UMask=0077 +ExecStart=/usr/bin/vmware-networks --postinstall vmware-player,0,1 +Type=oneshot +RemainAfterExit=yes diff --git a/vmware-networks.service b/vmware-networks.service new file mode 100644 index 000000000000..b501b8226ec8 --- /dev/null +++ b/vmware-networks.service @@ -0,0 +1,14 @@ +[Unit] +Description=VMware Networks +Wants=vmware-networks-configuration.service +After=vmware-networks-configuration.service + +[Service] +Type=forking +Restart=always +ExecStartPre=-/sbin/modprobe vmnet +ExecStart=/usr/bin/vmware-networks --start +ExecStop=/usr/bin/vmware-networks --stop + +[Install] +WantedBy=multi-user.target diff --git a/vmware-usbarbitrator.service b/vmware-usbarbitrator.service new file mode 100644 index 000000000000..fd1d9cac8034 --- /dev/null +++ b/vmware-usbarbitrator.service @@ -0,0 +1,8 @@ +[Unit] +Description=VMware USB Arbitrator + +[Service] +ExecStart=/usr/lib/vmware/bin/vmware-usbarbitrator -f + +[Install] +WantedBy=multi-user.target diff --git a/vmware-vix-bootstrap b/vmware-vix-bootstrap new file mode 100644 index 000000000000..425074de832d --- /dev/null +++ b/vmware-vix-bootstrap @@ -0,0 +1,2 @@ +BINDIR="/usr/bin" + diff --git a/vmware-workstation.install b/vmware-workstation.install new file mode 100644 index 000000000000..cff644a49f7e --- /dev/null +++ b/vmware-workstation.install @@ -0,0 +1,19 @@ +post_install() { + cat << EOF + +==> Before using VMware, you need to reboot or load vmw_vmci and vmmon kernel modules (in a terminal on root: modprobe -a vmw_vmci vmmon) +==> You may also need to enable some of these services: +- vmware-networks.service: to have network access in VMs +- vmware-usbarbitrator.service: to connect USB devices inside VMs +- vmware-hostd.service: to share VMs on the network + +EOF +} + +post_remove() { + cat << EOF + +==> To remove VMware settings, delete /etc/vmware and /etc/vmware-installer directories. + +EOF +} |