Virtual machines are demanding beasts, providing virtual hardware and running multiple operating systems on your computer at once. Upgrading your hardware (particularly your RAM and CPU) will always help speed up virtual machines, but there’s more you can do.
These tips will help you squeeze every last drop of performance out of your virtual machine, whether you’re using VirtualBox, VMware, Parallels, or any other virtual machine program.
Install VirtualBox Guest Additions or VMware Tools
After installing a guest operating system inside a virtual machine, he first thing you should do is install your virtual machine software’s drive package – Guest Additions for VirtualBox and VMware Tools for VMware. 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, click the Devices menu, and select Install Guest Additions. If you’re using VMware, select the Install VMware Tools option in the virtual machine’s menu instead. 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 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.
Create Fixed-Size Disks
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 — 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.
Exclude Virtual Machine Directories In Your Antivirus
Your antivirus 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.
Allocate More Memory
Virtual machines are memory hungry. Microsoft recommends 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 even want to allocate more than 2 GB of RAM.
You can allocate more RAM in your virtual machine’s settings dialog (the virtual machine must be powered off to do this). If your computer doesn’t have enough RAM to comfortably run both the virtual machine and everything else on your computer, you’ll see degraded performance as your computer constantly uses the swap file on its hard drive.
Allocate More CPUs
If you have a computer with multiple CPUs, you may want to allocate additional CPUs to your virtual machine from its settings window. A virtul machine with a dual (or quad) core processor will be more responsive, just as a computer with more cores is.
Tweak Your Video Settings
Tweaking video settings and allocating a larger amount of video memory 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.
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 VT-x or AMD-V – you may have to go into your computer’s BIOS and enable this setting yourself, even if your computer supports it.
To determine whether your Intel CPU supports Intel VT, you can use Intel’s Processor Identification Utility. If your CPU supports this feature but the option is unavailable in your virtual machine program, you’ll need to enter your computer’s BIOS and enable this feature. This setting is generally enabled by default with AMD processors.
Place The Virtual Machine’s Files On Another Drive
Disk performance can limit your virtual machine’s speed. Placing the virtual machine’s files on a separate drive – not your system drive – can help improve performance. Your virtual machine and host operating system won’t be competing to read and write from the same disk.
However, you shouldn’t run the virtual machine off an external drive – this will be much slower.
Resume 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
You can improve performance inside the virtual machine in the same ways you would on 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.
You may also want to consider not running an antivirus inside your virtual machine — for example, if your virtual machine is isolated from the Internet, an antivirus may just be slowing things down. Of course, there’s a security trade-off here – if you use a virtual machine that’s connected to the Internet, you may want to stick with an antivirus.
Running a disk defragmentation program inside your virtual machine may also help.
Defragment & Compact Virtual Machines
You can improve performance by defragmenting your virtual machine’s disk files, just like you can defragment other files on your computer – fragmentation could be particularly bad if you use a dynamically expanding disk.
VMware has an integrated tool for this, while you’ll have to use another defragmentation utility if you’re using VirtualBox.
After defragmenting a dynamic disk, you may also want to compact it – the compact operation shrinks a dynamic disk, making it take up less space on your hard disk. Because the file size is smaller, the virtual disk may load faster. VMware has a “Compact” option in its interface, while VirtualBox users will have to use the –compact operation on the command line.
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 Player is free for non-commercial use.
Note: if you are using Mac OS X, you’ll have much better luck with Parallels Desktop than VirtualBox.
Do you have any other tips for maximizing virtual machine performance? Leave a comment and share them!