Virtual machines are demanding beasts, providing virtual hardware and running multiple operating systems on your computer at once. As a result, they can sometimes be a little slow. Here are some tips to help you squeeze every last drop of performance out of your virtual machine, 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 will generally use dynamically allocated disks that grow as you use them.
For example, if you create a new virtual machine with a dynamically allocated disk with a maximum size of 30 GB, it won’t take up 30 GB of space on your hard disk immediately. After installing your operating system and programs, it may only take up 10 GB. As you add more files to the virtual disk, it will expand up to its maximum size of 30 GB.
This can be convenient, as each virtual machine won’t take up an unnecessarily large amount of space on your hard drive. However, it’s slower than creating a fixed-size disk (also known as a preallocated disk). When you create a fixed-size disk, all 30 GB of that space would be allocated immediately.
There’s a trade-off here: a fixed-size disk uses more space on your hard disk, but adding new files to the virtual machine’s hard disk is faster. You also won’t see as much file fragmentation. The space will be assigned in a large block instead of being added in smaller pieces.
Install Your Virtual Machine Software’s Tools
After installing a guest operating system inside a virtual machine, the first thing you should do is install your virtual machine software’s drive package—Guest Additions for VirtualBox, VMware Tools for VMware, or Parallels Tools for Parallels. These packages include special drivers that help your guest operating system run faster on your virtual machine’s hardware.
Installing the package is simple. In VirtualBox, boot your guest operating system and click Devices > Insert Guest Additions CD Image. You can then launch the installer from the virtual disc drive in your virtual machine. On VMware, select the Install VMware Tools option in the virtual machine’s menu instead. In Parallels, click Actions > Install Parallels Tools.
Follow the instructions on your screen to complete the installation. If you’re using a Windows guest operating system, it’ll be just like installing any other Windows application.
Ensure you keep these updated with your virtual machine program. If you see a notification that an update is available for Guest Additions or VMware Tools, you should install it.
Exclude Virtual Machine Directories In Your Antivirus
Your computer’s antivirus program may be scanning your virtual machine files whenever they’re accessed, reducing performance. The antivirus can’t see inside the virtual machine to detect viruses running on your guest operating systems, so this scanning isn’t helpful.
To speed things up, you can add your virtual machine directory to your antivirus’s exclusions list. Once it’s on the list, your antivirus will ignore all files in this directory.
Ensure Intel VT-x or AMD-V Is Enabled
Intel VT-x and AMD-V are special processor extensions that improve virtualization. Newer Intel and AMD processors generally include these features. However, some computers don’t automatically enable them. You may have to go into your computer’s BIOS and enable this setting yourself, even if your computer supports it.
AMD-V is generally enabled automatically if it works on your hardware, but many Intel computers ship with Intel VT-x disabled. Here’s how to enable Intel VT-x or AMD-V if it’s disabled—enable it in the BIOS, then head to your virtual machine program’s settings and make sure it’s enabled there too.
Allocate More Memory
Virtual machines are memory hungry. Each virtual machine contains an entire operating system, so you’re splitting your computer’s RAM between two separate systems. Microsoft recommends at least 2 GB of RAM for 64-bit Windows 7 systems, and this recommendation also applies to Windows 7 when it’s running in a virtual machine. If you’re running memory-hungry applications in the virtual machine, you may want to allocate more than 2 GB of RAM so Windows isn’t constantly swapping to disk.
You can allocate more RAM in your virtual machine’s settings dialog (the virtual machine must be powered off to do this). Try to give it at least 1/3rd of your computer’s available RAM, though you can do more if you want.
If that doesn’t help, you may not have enough RAM in your computer to run virtual machines at a comfortable speed. Consider upgrading your RAM—8GB should be a decent amount for most basic VMs.
Allocate More CPU
Your computer’s CPU does all the work of running the virtual machine and its software, so the more CPU it can use, the better it will run. If you have a computer with a multi-core CPU, you can assign more cores to your virtual machine from its settings window. A virtual machine with two or four cores will be much more responsive than a virtual machine with one, just as a computer with more cores is.
If you’re using an older CPU with only one or two cores, it may be time to upgrade—your virtual machine will run much faster if you can give it at least two cores (if not more).
Tweak Your Video Settings
Tweaking some of your video settings can also improve your virtual machine’s apparent speed. For example, enabling the 2D acceleration feature in VirtualBox improves video playback in virtual machines, while enabling 3D acceleration will allow you to use some 3D applications at a more reasonable speed. Increasing the video memory assigned to a virtual machine can speed up 3D graphics, too. Note, though, that upgrading your graphics card probably won’t do much to help your virtual machine, unless it’s really starved for video memory.
Put Your Virtual Machines on a Solid-State Drive
A solid-state drive is one of the best upgrades you can make to a computer for speed, and that goes for virtual machines too. A lot of people store their virtual machines on a secondary mechanical drive, since they’re more spacious, but your virtual machines will run much slower. So if you can, make some room on that SSD and put your virtual machines there.
In addition, avoid placing the virtual machine’s files on an external drive unless you know the external drive is speedy enough. A fast USB 3.0 drive with good file access times might give you good performance, but an old USB 2.0 memory stick will be extremely slow and deliver terrible performance.
Suspend Instead of Shutting Down
When you’re done using your virtual machine, you may want to save its state instead of shutting it down completely. The next time you want to use your virtual machine, you can just double-click it to start it. The guest operating system will resume where you left off instead of booting up from scratch.
This is similar to using the hibernate or suspend feature instead of shutting your computer off. Your virtual machine program saves the contents of your virtual machine’s memory to a file on your hard drive and loads that file when you next start the virtual machine.
Improve Performance Inside the Virtual Machine
Remember, you can also improve performance inside the virtual machine in the same ways you would speed up a physical computer. For example, reducing the amount of background applications and programs that run at start-up will improve your guest operating system’s boot time and reduce the amount of RAM used by your virtual machine. If you’re using a mechanical drive, defragmenting the virtual machine may improve performance as well (though this likely won’t make a difference on SSDs). Don’t neglect the standard tips just because it’s a virtual machine—virtual machines are just like regular computers!
Try Another Virtual Machine Program
Some people report VirtualBox being faster for them, while some report VMware being faster. Which virtual machine program is faster for you may depend on your host operating system, guest operating system, system configuration, or a number of other factors. But., if you’re not seeing satisfactory performance, you may want to try another program. VirtualBox is completely free, while VMware Workstation Player is free for non-commercial use.
If you’re using macOS, you’ll experience much better performance with Parallels Desktop than you will with VirtualBox. Mac users can also try VMware Fusion, which should also offer better performance than VirtualBox.