How do virtual machines use RAM

The complete guide to speeding up your virtual machines

Virtual machines challenge beasts and provide virtual hardware and the simultaneous running of multiple operating systems on your computer. As a result, they can be a little slow at times. Below are some tips to help you optimize the performance of your virtual machine to the last drop, whether you're using VirtualBox, VMware, Parallels, or something else.

Create fixed size disks instead of dynamically allocated ones

When creating your virtual machine, you can create two different types of virtual disks. By default, virtual machine programs typically use dynamically allocated volumes that grow in size as they are used.

For example, if you create a new virtual machine, a dynamically allocated hard drive with a maximum size of 30 GB will immediately consume 30 GB of space on your hard drive. After installing the operating system and programs, only 10 GB may be required. As you add more files to the virtual hard disk, it expands to its maximum size of 30 GB.

This can be handy for any virtual machine and doesn't take up unnecessary space on your hard drive. However, this is slower than creating a fixed size hard drive (also known as a pre-allocated hard drive). When you create a fixed-size hard drive, every 30 GB of that space is immediately allocated.

There is a trade-off here: a fixed-size hard drive takes up more space on your hard drive. However, adding new files to the virtual machine's hard disk is faster. You won't see as much file fragmentation either. The space is allocated in a large block rather than being added in smaller pieces.

Install your virtual machine software tools

After installing a guest operating system inside, the first thing you need to do is install your virtual machine's drive package - Guest Additions for VirtualBox, VMware Tools for VMware, or Parallels Tools for Parallels. These packages contain special drivers that allow your guest operating system to run faster on your virtual machine hardware.

The package is easy to install. Start your guest operating system in VirtualBox and click Devices> Insert CD Image with Guest Additions. You can then start the installation program from the virtual drive in your virtual machine. Instead, on VMware, choose Install VMware Tools from the virtual machine menu. In Parallels, click Actions> Install Parallels Tools.

Follow the instructions on the screen to complete the installation. If you are using a Windows guest operating system, this is the same as installing any other Windows application.

Make sure you keep them up to date with your virtual machine program. If you receive a notification that an update is available for Guest Additions or VMware Tools, you should install it.

Exclude virtual machine directories in your antivirus

CONNECTED:Antivirus Slows Down Your Pc? Maybe you should use exclusions

Your computer's antivirus program may scan your virtual machine files each time they are accessed, which slows performance. The virus protection program cannot detect viruses in the virtual machine that are running on your guest operating systems. Therefore, this scanning is not helpful.

To speed up work, you can add your virtual machine directory to your anti-virus program's exclusion list. Once it is on the list, your antivirus will ignore any files in that directory.

Make sure Intel VT-x or AMD-V is enabled

CONNECTED:How to enable Intel VT-x in your computer's BIOS or UEFI firmware

Intel VT-x and AMD-V are specialty processor extensions that improve virtualization. Newer Intel and AMD processors generally offer these features. However, some computers do not activate them automatically. You may need to enter your computer's BIOS and enable this setting yourself, even if your computer supports it.

AMD-V is usually automatically enabled when it works on your hardware, but many Intel computers ship with the Intel VT-x disabled. To enable Intel VT-x or AMD-V, if it is disabled: Enable it in the BIOS, go to the settings of your virtual machine program and make sure it is enabled there too.

Allocate more memory

Virtual machines are memory hungry. Each virtual machine contains an entire operating system, so you split your computer's memory into two separate systems. Microsoft recommends at least 2 GB of RAM for 64-bit Windows 7 systems. This recommendation also applies to Windows 7 when running on a virtual machine. If you run memory-intensive applications on the virtual machine, you may want to allocate more than 2 GB of RAM so that Windows doesn't keep switching to the hard drive.

You can allocate more RAM in your virtual machine settings dialog (the virtual machine must be switched off for this). Try to use at least 1/3 of the available memory on your computer. However, you can do more if you want.

If that doesn't help, your computer may not have enough RAM to run virtual machines at a comfortable speed. Consider upgrading your memory - 8GB should be a decent amount for most basic VMs.

Allocate more CPU

Your computer's CPU does all the work, the more CPU the virtual machine and its software can use, the better it will run. If you have a computer with a multi-core CPU, you can assign additional cores to your virtual machine via the settings window. A virtual machine with two or four cores is much more responsive than a virtual machine with one, just like a computer with more cores.

If you are using an older CPU with only one or two cores, an upgrade may be required. Your virtual machine will run much faster if you can assign at least two cores (if not more) to it.

Optimize your video settings

CONNECTED:How to enable 3D acceleration and use Windows Aero in VirtualBox

You can also adjust some of your video settings to improve the apparent speed of your virtual machine. For example, turning on the 2D acceleration feature in VirtualBox will improve video playback in virtual machines, and turning on 3D acceleration will allow you to use some 3D applications at a more reasonable speed. Increasing the video memory allocated to a virtual machine can also speed up 3D graphics. Note, however, that upgrading your graphics card will likely only help your virtual machine if it does Really starved for video memory.

Put your virtual machines on a solid-state drive

CONNECTED:It's time: why you need to upgrade to an SSD now

A solid-state drive is one of the best upgrades you can access a computer for speed, and so is virtual machines. Many people store their virtual machines on a secondary mechanical drive because they are more spacious, but your virtual machines run much slower. So if you can, make room on this SSD and put your virtual machines there.

Also, avoid placing the virtual machine files on an external drive unless you know the external drive is fast enough. A fast USB 3.0 drive with good file access times might perform well, but an old USB 2.0 memory stick is extremely slow and performs terribly.

Stopping instead of shutting down

When you are done with your virtual machine, you may want to save the state instead of shutting it down completely. The next time you want to use your virtual machine, just double-click it to start it. The guest operating system will pick up where you left off instead of restarting.

This is similar to using the hibernation or hibernation feature instead of turning off the computer. Your virtual machine program stores the contents of your virtual machine's memory in a file on your hard drive and loads this file the next time you start the virtual machine.

Improve the performance in the virtual machine

CONNECTED:10 quick ways to speed up a slow PC on Windows 7, 8, or 10

Remember, you can also improve the performance inside the virtual machine in the same way that you would speed up a physical computer. For example, reducing the number of background applications and programs that run at startup will reduce the startup time of your guest operating system and reduce the amount of RAM used by your virtual machine. If you're using a mechanical drive, defragmenting the virtual machine can also improve performance (although it probably won't make a difference with SSDs). Don't neglect the standard tips just because it's a virtual machine - virtual machines are like regular computers!

Try a different virtual machine program

Some people report that VirtualBox is faster for some, some report that VMware is faster. Which virtual machine program works faster for you may depend on your host operating system, guest operating system, system configuration, or a number of other factors. However, if you are not getting satisfactory performance, you can try another program. VirtualBox is completely free, while VMware Workstation Player is free for non-commercial use.

If you're using macOS, you'll have a lot of experienceBetter performance with Parallels Desktop than with VirtualBox. Mac users can also try VMware Fusion, which should also perform better than VirtualBox.