Many data centers rely on virtual machines (VMs). In some cases, those VMs are powered by the popular and free VirtualBox.
VirtualBox admins enjoy a lot of flexibility, but what about performance? Follow these tips to help your VMs boost the performance of your guests.
1: Use fixed size disks
Generally speaking, when we allot storage space for our VMs, we stick with the default dynamically allocated disk types. This makes sense, especially when you are limited in space and aren't certain how much space you'll need for your VM.
However, the dynamically allocated disk is not nearly as efficient as the fixed disk. Why? Because as you use space on a dynamically allocated virtual hard disk, VirtualBox must accommodate and adjust the VM's storage space, which causes the performance to take a hit. Instead of using dynamic disks, opt for fixed disks (Figure A) and give the disk plenty of space. Note about this: The performance increase will be significant when used with spinning hard drives and less so with solid state drives.
2: Allocate RAM and CPUs wisely
When creating a new VM, your inclination might be to bump up the RAM used to ensure a smooth running guest. Although that will work in some cases, there might be instances where more processors would be advantageous over a significant amount of RAM.
If you're setting up a VM for a server that demands heavy processor use, your best bet is to up the amount of CPUs VirtualBox will hand over to the VM. With the VM powered down, you can do this in Settings | System for the VM by sliding the Processor(s) slider to the right to increase the CPUs (Figure B).
When you commit resources for the guests, do not overextend your RAM and CPUs in such a way that you leave the host grinding to a halt. Your host machine should have at least 1 GB of RAM and plenty of CPUs remaining so the host OS and VirtualBox can function smoothly.
3: Install the Guest Additions
You should consider installing the VirtualBox Guest Additions a must for every VM you create. The Guest Additions are additional device drivers and system applications, installed on the guest machines, that optimize the guest operating system for better performance and usability.
How you install the Guest Additions will depend upon what operating system is running the Guest, and if you're using VirtualBox with a GUI desktop or a console-only server. If you're installing with a GUI, start the VM and, once it is up and running, click Devices | Insert Guest Additions CD Image (Figure C) and walk through the presented steps.
4: For Windows guests, use the Intel PRO/1000 network drivers
If you're running Windows guests, to get the most out of networking, be sure to select the Intel PRO/1000 network driver in Settings | Network | Advanced (Figure D). You have a choice between Intel PRO/1000 MT Desktop and Intel PRO/1000 Server—choose accordingly based on your needs.
5: Use video memory wisely
If you're working with a Desktop VM, you don't need to give that VM more than 128MB of vRAM. Conversely, do not waste your vRAM on a GUI-less server, as they will function fine with 9MB of vRAM. You can set this option in Settings | Display | Screen (Figure E).
Your VirtualBox VMs should now be running smoothly and reliably. It doesn't take much to achieve this bump in performance, as long as you work wisely and use care when creating or configuring your VMs.
- How to install phpVirtualBox for cloud-based VirtualBox management (TechRepublic)
- How to install Virtualmin for a web-based VirtualBox dashboard (TechRepublic)
- How to add new drives to a VirtualBox virtual machine (TechRepublic)
- How to run VirtualBox virtual machines from the command line (TechRepublic)
- How to install VirtualBox Guest Additions on a GUI-less Ubuntu server host (TechRepublic)
- Microsoft joining the Linux Foundation comes down to one word: Cloud (TechRepublic)
- Nothing good is free: How Linux and open source companies make money (ZDNet)
- SDN and the data center: Deployment plans, business drivers, and preferred vendors (Tech Pro Research)
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.