Optimal VirtualBox Settings (2021)
In this post, we’ll explore Oracle’s VirtualBox and some optimal settings for running Linux distributions on it.
VirtualBox is a cross-platform virtualization application. It allows you to run an operating system inside an operating system. While it comes with sane configurations out of the box, I’ll show you some tips and tricks to make it work even better with Linux.
Fire up VirtualBox and let’s get started!
Creating a virtual machine
Before we dive into settings, we need to create a virtual machine. That’s what we’ll do first. If you do have a virtual machine already, feel free to scroll to the next section.
Let’s kick-off the process by clicking the “New” button in the top left corner. Name your virtual machine and select the right type and version.
The next step is to select how much RAM the virtual machine is allowed to use. VirtualBox will automatically select the recommended amount of RAM for your system. However, if you have a lot of RAM, feel free to add some GB for better performance. I recommend to use 2GB minimum for any Linux distro in a virtual machine.
Now you’ll need to select a hard disk, hard disk file type and the size of a hard disk. You can leave default settings for hard disk and hard disk file type. Regarding the size of a hard disk, I recommend dynamic allocation. The dynamic allocation fills up the space on your disk as the data volume grows. It usually results in less occupied space. As the maximum size of the virtual hard disk, I set 30GB and would recommend at least 15GB.
The last step before booting your virtual machine is to select your distro’s ISO file, of course!
Right-click on your virtual machine entry in the list → Storage → + button → Add optical drive → Select your ISO
Now that we’ve created a virtual machine, it’s time to explore optimal settings to make sure it runs like a top!
Access the settings of your virtual machine by right-clicking on it in the list.
After you’ve launched the settings window, go to System → Processor tab. Increase the number of CPU cores available to a virtual machine. The number of CPU cores you should allocate depends on your CPU. (pay attention to a red-green bar). I usually allocate half of all cores available.
In System → Motherboard, enable EFI. Enabling EFI creates the
which makes the virtual machine use UEFI over BIOS. Both UEFI and BIOS are
low-level software that starts when you boot the machine. UEFI is a modern
alternative to BIOS designed to overcome the limitations of BIOS.
To make your desktop experience in the virtual machine as smooth as possible, we need to increase video memory and enable 3D acceleration. You can do this on the System → Display tab.
Depending on your VirtualBox version, you may also have an option to select Graphic Controller. In my experience, VBoxSVGA works the best. For example, you get full screen resolution for Live CD with VBoxSVGA. I demonstrate it in the video below.
After you’ve configured these settings, it’s finally time to boot your virtual machine! If your live session doesn’t scale to full screen, try to change the Graphic Controller.
VirtualBox Guest Additions
VirtualBox Guest Additions is special software that offers the following features for the ultimate virtual machine experience:
- Better virtual machine performance
- Drag and drop files between the host system and virtual machine interchangeably
- Share clipboard of a virtual machine with the host system
- Share directories between the host system and virtual machine
- any many more!
You can install it with these steps:
Virtual machine window → Devices → Insert Guest Additions CD image → Click “Run” in the pop-up window inside of Linux virtual machine.
You can find more detailed instructions in my post on how to enable a shared VirtualBox folder in any Linux distro.
In this post, we have explored various settings to get the most optimal Linux virtual machine experience. In addition to configuring our virtual machine, you’ve also learned how to install VirtualBox Guest Additions which offer all sorts of features for VirtualBox power-users.
As always, if you have any questions, feel free to shoot us a message in the comments section below! 👇