Sub topic 10
Sizing Host Resources for Virtual Machines
This chapter assumes you know basic PC hardware terms (CPU, RAM, storage, network adapter) and have read the earlier chapters on hypervisors and on CPU and BIOS/UEFI virtualization support. Here you will learn how to decide whether a host PC can run virtual machines (VMs) and how to divide its resources among them.
The core rule: the host pays for every guest
A VM is not free. Each running guest takes a share of the host's physical resources, and the host operating system still needs its own share. If you give away too much, both the host and the guests slow down.
Four resources matter most:
| Resource | How a VM uses it | What goes wrong if it is short |
|---|---|---|
| CPU | Each VM is assigned virtual CPUs (vCPUs) that run on the host's cores or threads. | Guests and host stutter and respond slowly. |
| RAM | Memory assigned to a VM is reserved while it runs. | The host starts paging to disk, and everything becomes very slow. |
| Storage | Each VM has a virtual disk file on the host's drive. | The host runs out of space, or guests are slow on a hard drive. |
| Network | Guests share the host's physical adapter. | Guests compete for bandwidth. |
CPU
The CPU must support hardware virtualization (Intel VT-x or AMD-V), and it must be turned on in BIOS/UEFI. A multicore CPU is strongly preferred. A common rule of thumb is to give a VM one or two vCPUs and to leave at least one core for the host. Assigning more vCPUs than the host has usually hurts performance instead of helping.
RAM
RAM is the resource that most often limits how many VMs you can run at once. Add up the minimum RAM of the host OS and every guest you plan to run at the same time.
host_os_gb = 4
guests_gb = [4, 4, 2] # Windows 11 guest, Windows 10 guest, small Linux guest
needed = host_os_gb + sum(guests_gb)
print(f"Minimum RAM needed: {needed} GB")This prints Minimum RAM needed: 14 GB. In practice you would install 16 GB, the next common size. Notice that only running VMs count. A powered-off VM uses disk space but no RAM.
Storage
Each VM stores its virtual disk as a large file on the host. A Windows guest often needs 50 GB or more, and the file can grow over time. Two settings affect this:
- A dynamically allocated (thin) disk starts small and grows as the guest writes data. It saves space now but can fill the host drive later.
- A fixed-size (thick) disk reserves the full size immediately. It uses more space up front and usually performs a little better.
Snapshots, which save a guest's state so you can roll back, also consume extra space. A solid-state drive (SSD) makes guests boot and run much faster than a hard disk drive (HDD).
Network
A guest uses a virtual network adapter that connects through the host's physical adapter. The mode you choose (NAT, bridged, host-only, or internal) is covered in the next chapter. For sizing, remember that all guests share the host's bandwidth.
Worked example
A technician has a PC with a 6-core CPU, 16 GB of RAM, and a 512 GB SSD. A user wants two Windows 10 guests running at the same time for software testing.
- Host OS: reserve 4 GB RAM and 2 cores.
- Each guest: 4 GB RAM and 2 vCPUs, which totals 8 GB and 4 cores.
- Total RAM used is 12 GB of 16 GB, so the plan fits.
- Disk: two 60 GB virtual disks use 120 GB of 512 GB, which leaves room for snapshots.
Common errors
- Counting the total RAM of all VMs, including ones that are powered off.
- Forgetting that the host OS needs its own RAM.
- Leaving virtualization disabled in BIOS/UEFI, so the hypervisor will not start or offers only 32-bit guests.
- Using thin disks on a nearly full drive.
Exercise
A PC has 8 GB of RAM. The host OS needs 4 GB. A technician wants to run two guests at once, each needing 4 GB. Will this work well, and what is the simplest fix?
Show answer
No. The total needed is 12 GB, which is more than 8 GB, so the host will page to disk and slow down. The simplest fix is to add RAM (for example, upgrade to 16 GB). Running only one guest at a time also works.
Exercise
Which disk type reserves its full size on the host immediately: dynamically allocated or fixed-size?
Show answer
Fixed-size (thick). A dynamically allocated (thin) disk starts small and grows as data is written.