9.9. Launching more than 128 VMs on Linux hosts

Linux hosts have a fixed number of IPC semaphores IDs per process preventing users from starting substantially many VMs. The exact number may vary with each Linux distribution. While trying to launch more VMs you would be shown a "Cannot create IPC semaphore" error. In order to run more VMs, you will need to increase the semaphore ID limit of the VBoxSVC process. Find the current semaphore limits imposed by the kernel by executing as root:

#/sbin/sysctl kernel.sem
kernel.sem = 250  32000  32  128

The "kernel.sem" parameter bundles together 4 values, the one we are interested in is called "SEMMNI", the maximum number of semaphore IDs which is 128 in the above example. Increase this semaphore ID limit by executing as root:

echo "kernel.sem = 250 32000 32 2048" >> /etc/sysctl.conf
/sbin/sysctl -p

The above commands will add the new limits to the config file, thus making the effect persistent across reboots, and will activate the new limits into the currently running kernel.