» Kernel Upgrade

If as part of running your Vagrant environment with VMware, you performa kernel upgrade, it is likely that the VMware guest tools will stop working.This breaks features of Vagrant such as synced folders and sometimesnetworking as well.

This page documents how to upgrade your kernel and keep your guest toolsfunctioning. If you are not planning to upgrade your kernel, then you can safelyskip this page.

» Enable Auto-Upgrade of VMware Tools

If you are running a common OS, VMware tools can often auto-upgrade themselves.This setting is disabled by default. The Vagrantfile settings below willenable auto-upgrading:

  1. # Ensure that VMWare Tools recompiles kernel modules
  2. # when we update the linux images
  3. $fix_vmware_tools_script = <<SCRIPT
  4. sed -i.bak 's/answer AUTO_KMODS_ENABLED_ANSWER no/answer AUTO_KMODS_ENABLED_ANSWER yes/g' /etc/vmware-tools/locations
  5. sed -i 's/answer AUTO_KMODS_ENABLED no/answer AUTO_KMODS_ENABLED yes/g' /etc/vmware-tools/locations
  6. SCRIPT
  7. Vagrant.configure("2") do |config|
  8. # ...
  9. config.vm.provision "shell", inline: $fix_vmware_tools_script
  10. end

Note that this does not work for every OS, so vagrant up with the abovesettings, do a kernel upgrade, and do a vagrant reload. If HGFS (syncedfolders) and everything appears to be working, great! If not, then read on…

» Manually Reinstalling VMware Tools

At this point, you will have to manually reinstall VMware tools. The bestsource of information for how to do this is theVMware documentation.

There are some gotchas:

  • Make sure you have the kernel headers properly installed. This variesby distro but is generally a package available via the package manager.

  • Watch the installation output carefully. Even if HGFS (synced folders)support failed to build, the installer will output that installing VMwaretools was successful. Read the output to find any error messages.