How to make Ubuntu play nice with VMware


Here at VG a large amount of our services are deployed on virtualized servers in our VMware cluster. A majority of these servers are running CentOS, but from time to time there is a need for other distributions, like Ubuntu.

In this short write up we will go through a couple of things we find necessary to do to bring Ubuntu up to speed in a VMware environment.

First of all, you want some version of VMware Tools installed. Either the proprietary package from VMware, or open-vm-tools from Ubuntu’s repositories.

One of the things that doesn’t work out of the box when running Ubuntu in VMware is hot adding of CPUs and memory. The new hardware will be visible to the system, but not activated automatically. Even with VMware-tools installed on the virtual machine. In CentOS 6 this works out of the box, without any modifications to the system.

This can be solved by making sure the acpi_memhotplug module is loaded, and by adding two rules to udev:

And of course, if you are preparing a template you would want to clean up the SSH keys. This is necessary to avoid reusing the same host keys in every machine you deploy. Reusing host keys is a fairly common mistake, and has also been seen done from commercial VPS providers.

We issue the following commands as one of the last things before shutting down the VM before generating the template:

This will make sure that new keys are generated on the first boot after deploying your new template.

More to read about Software engineering