What to do if your VMWare instance starts up slowly on FreeBSD 9.0

At boot time, some ancient code is executed that runs a memory probe and test. When it was added, machines with 64G of RAM were not even a dream. In 9-STABLE the execution of this code has been made conditional on "is in emulated instance", but it didn't make 9.0. So, if you're on 9.0 under VMWare, you are going to see a boot delay that is at least proportional to the memory size. Expect something in the 10s of seconds to minutes if you are using more than 1G per instance.

You want to turn this code off.

The code lies in amd64/amd64/machdep.c. All you have to do is comment out the following offending line:

1443 if (memtest == 0)

For comparison, in the head revision, the correct change was introduced by gavin on Sat Dec 31 13:24:53 2011 UTC.

Final note: this also has some other benefits for VMs too. Most hypervisors lazily allocate memory only the first time it's actually touched by the guest OS. So having the OS immediately touching every page ruins that feature.

VMWareBootupSpeed (last edited 2012-05-16 19:10:24 by MarkLinimon)