Skip to content

Instantly share code, notes, and snippets.

@ctipper
Last active August 29, 2015 14:23
Show Gist options
  • Save ctipper/5e9d84910ad869d8e57e to your computer and use it in GitHub Desktop.
Save ctipper/5e9d84910ad869d8e57e to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
set -x
if ! mount -t cd9660 /dev/cd0 /mnt; then
echo 'Must run Virtual Machines > Install VMware Tools first' >&2
exit 1
fi
VMWARE_TOOLS=/tmp/vmware-tools-distrib
MOUNTED_CD=/mnt
trap 'RESULT=$?; rm -rf "$VMWARE_TOOLS"; umount "$MOUNTED_CD" >/dev/null 2>&1 || true; exit $RESULT' INT TERM HUP PIPE QUIT EXIT
env ASSUME_ALWAYS_YES=YES pkg install pkg
env ASSUME_ALWAYS_YES=YES pkg install compat6x-`uname -p` perl5
tar xf /mnt/vmware-freebsd-tools.tar.gz -C /tmp/
cd /tmp/vmware-tools-distrib
./vmware-install.pl "${@---default}"
cat >&2 << NOTES
Next steps:
0. Run: sed -i '' 's/em0/vmx3f0/g' /etc/rc.conf
1. Power off this vm (do not use suspend)
2. Edit the .vmx on the actual machine, change the following line from:
ethernet0.virtualDev = "e1000"
to:
#ethernet0.virtualDev = "e1000"
ethernet0.virtualDev = "vmxnet3"
3. Power on the VM
NOTES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment