Skip to content

Optimize the Virtual Machine

A Yocto build is CPU, RAM, and disk intensive. These settings significantly reduce build times.


CPU

Assign as many cores as possible — Yocto parallelises aggressively.

VirtualBox: Settings → System → Processor → set to the number of physical cores on the host (not logical/hyperthreaded).

VMware: Virtual Machine Settings → Processors → increase processor and core count.

Then match the Yocto configuration in local.conf:

BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j8"

RAM

The minimum for a Yocto build is 8 GB. 16 GB or more is recommended, especially when building large packages such as Qt or the Linux kernel with many parallel jobs.

VirtualBox: Settings → System → Motherboard → Base Memory.

VMware: Virtual Machine Settings → Memory.


Disk

Size

The Yocto build directory can exceed 100 GB. Allocate at least 150 GB for the VM disk to avoid running out of space mid-build.

Do not build on a shared folder

Shared folders (VirtualBox shared folders, VMware HGFS) have significantly higher I/O overhead than native virtual disks. Always place the Yocto workspace on the VM's native disk:

~/yocto/          ← correct: native VM disk
/mnt/shared/      ← avoid: shared folder

Use a fixed-size disk

A fixed-size virtual disk (as opposed to dynamically allocated) avoids fragmentation and gives more consistent I/O performance, especially on spinning disks.


Enable hardware virtualisation

Ensure hardware virtualisation is enabled in the host BIOS (Intel VT-x or AMD-V). Both VirtualBox and VMware require it for 64-bit guests and good performance.

VirtualBox: Settings → System → Acceleration → check "Enable VT-x/AMD-V" and "Enable Nested Paging".


Install guest additions / VMware tools

Install the guest additions to enable clipboard sharing, dynamic screen resize, and better driver performance.

VirtualBox:

sudo apt install virtualbox-guest-utils virtualbox-guest-x11

VMware:

sudo apt install open-vm-tools open-vm-tools-desktop