Using Packer vmware-iso builder on Ubuntu 16.04 server with Workstation Player 14
Getting VMWare Workstation Player 14 (the free one) to work with Packer on Ubuntu 16.04 is possible and not very difficult, however it is very undocumented. In order to get it working you will need a few different packages, listed below
- Packer (Download the Linux 64-bit version, at the time of this guide the latest version is 1.1.1)
- VMWare Workstation Player 14 (I downloaded the version for Linux 64-bit from the previous link)
- VMWare Vix 1.17 (I downloaded the version for Linux 64-bit from the previous link)
- In order to build kernel modules you will need to
sudo apt install libxt6 libxtst6 libxcursor-dev libxinerama-dev build-essential
- Install additional dependencies by running
sudo apt install qemu-utils libxi6
Install packer by downloading the zip and moving the packer executable into /usr/local/bin. Next, download the VMWare Workstation Player 14 bundle and install it by running sudo sh VMWare-Player-14.bundle
. Finally, download the VMWare Vix bundle and install it by running sudo sh VMWare-Vix.bundle
.
Next you will need to run sudo vmware-modconfig --console --install-all
to install all of the required kernel modules.
You should now be able to do packer builds using the vmware-iso builder on your headless machine running Ubuntu 16.04.
If the execution fails here with an error such as “Error: The operation was canceled”, then run packer with the command PACKER_LOG=1 packer build -debug <yourpackerfile>.json
which will allow you to step through each step of the packer build and pause before cleanup to inspect the logs written to your output directory, which is normally output-<vmname>
. Inside that folder will be a vmware log file which should give you some hints towards what is going wrong.
Credits:
- https://kradalby.no/setup-vmware-player-headless-on-debian.html got me the final undocumented step required to setup vmware-modconfig kernel modules.