Whether you are setting up a Ubuntu virtual machine in VirtualBox for the first time or you experiment with VMs frequently, setting up the virtual machine for general use is often frustrating.

When you install the Ubuntu machine in VirtualBox, it takes a long time to make it user-ready. There are various things missing when you get started: display settings might be off, packages out of date, and crucial utilities missing from the system.

So, what should you do to correctly configure your Ubuntu virtual machine?

9 Steps to Configure an Ubuntu VM in VirtualBox

Fortunately, various tools are at your disposal to help configure an Ubuntu VM.

We have streamlined the number of steps that can make any Ubuntu VM in VirtualBox ready for general use in just a few minutes:

  1. Update and upgrade the Guest OS
  2. Optimize the VM display
  3. Enable the shared clipboard
  4. Install GNOME Tweaks
  5. Download Opera Browser for the free VPN
  6. Install a screenshot tool
  7. Enable minimize on click for app windows
  8. Show remaining battery level
  9. Take a system snapshot

Keep reading to explore each of these steps in more detail.

1. Update and Upgrade Your Guest OS

Update and upgrade are necessary for any operating system to work properly, as the packages that came installed with the system, might be outdated or missing critical features. You can do the update and upgrade in separate steps or just open the terminal by pressing Ctrl+Alt+T and type the following combined command.

Kindly note that these commands will automatically answer all prompts with yes so the update process will not be interrupted and you can do other tasks while this process is underway.

        sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade && sudo apt -y autoremove && sudo apt autoclean
    

2. Optimize the Virtual Machine Display

If you have installed a Ubuntu machine in VirtualBox, You know how frustrating it is to use it like it is. The display screen size is not optimal, the resolution is very bad and the display gets pixilated in the full-screen mode.

Fortunately, VirtualBox provides an excellent piece of software called VirtualBox Guest Additions. VirtualBox Guest Additions have many features that make the Ubuntu machine user friendly such as screen resolution, bidirectional copy-paste, Drag and Drop and folder sharing, etc.

Before setting up VirtualBox Guest Additions, make sure the IDE Secondary Device in the Storage settings in the virtual box is empty. If it is not empty, remove it from Storage settings.

Check Optical Drive

Also, run the following command to enable building kernel modules.

        sudo apt-get -y install build-essential gcc make perl dkms
    

Next restart the system and set up VirtualBox Guest Additions by going in the Devices option on the VirtualBox machine toolbar and select Insert Guest Additions CD image from the dropdown options.

Insert Guest Additions

You will be prompted to run the Guest Additions Software that is included in the installation package.  Click Run to start the installation and restart when prompted.

Note: You should wait for the above two steps to be completed before starting with the following steps as these steps are either dependent upon the upgraded packages or VirtualBox Guest Additions.

3. Enable Shared Clipboard/Drag and Drop

Shared clipboard and drag and drop enable you to copy and paste and drag and drop between systems. To enable them, open Machine > Settings from the dropdown options.

VirtualMachine Setting

Here go to General > Advanced and in both the Shared Clipboard and Drag'n'Drop drop-downs, select the Bidirectional option. Click OK to confirm.

Bidirectional Clipboard Dragndrop Setting

4. Install GNOME Tweaks

GNOME Tweaks or generally referred to as Tweaks is a very comprehensive tool that can control the looks and behaviour of a system. The software can be installed from the software centre and can aid in many configurations that may be needed at a later date.

Gnome Tweaks Installation

5. Download Opera Browser With Built-in VPN

For privacy while browsing in your VPN, it is a good idea to install a VPN. If you don't already have a VPN subscription, installing Opera Browser for its free VPN is a good idea.

Open the pre-installed browser in your Ubuntu virtual machine and use this to download Opera.

Download: Opera for Linux (Free)

Once installed, Opera VPN isn't enabled by default. Go to Menu > Settings > Privacy and Security > Free VPN to start using it.

6. Install a Screenshot Tool

You will notice that no screenshot software comes pre-installed with Ubuntu. As screenshot software is often used, you'll find plenty of options in the Software Center.

If you want a specific recommendation, consider Flameshot.

7. Dock Settings: Minimize on Click

To minimize any application by default you have to use the minimize button on the application window. We recommend setting dash to dock on click action so you can just click on the application in the dock to minimize the application window.

You can do that by going to the terminal or pressing Ctrl+Alt+T and entering the following command.

        gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
    

8. Show Remaining Battery

To extend battery life in laptops, it is recommended to keep your charging between 40-80 percent.

In Ubuntu virtual machine you cannot see the battery percentage in the system tray. So we recommend tweaking the settings so that the percentage is shown by entering the following command.

        gsettings set org.gnome.desktop.interface show-battery-percentage true
    

Now, You can also maintain and optimize your battery levels.

9. Create a System Snapshot

After completing basic setup and configuration, take a snapshot of your machine. This lets you return to this state if the system crashes or becomes misconfigured/corrupted.

To take a snapshot of the system open Machine > Take Snapshot.

Virtual Machine snapshot

You will be prompted to add a name and description to the snapshot. Be sure to make provide details---for example, you might use the VM for a particular reason and have specific software installed.

VirtualMachine Snapshot

When you are done, click OK.

Customize Your Ubuntu Machine in VirtualBox

With the Ubuntu virtual machine correctly configured, you'll find it works as seamlessly as a standard installation. While these tips and tricks are specifically about running Ubuntu in VirtualBox, they can be adapted to use with any operating system that you install as a guest OS.