How to Install Guest Additions in VirtualBox on Ubuntu?

You may have noticed certain limitations if you installed Ubuntu as a guest operating system in VirtualBox. The screen resolution may be...

how to install guest additions virtualbox ubuntu

Image Credits: pixabay

You may have noticed certain limitations if you installed Ubuntu as a guest operating system in VirtualBox. The screen resolution may be stuck, file sharing between the host and guest may fail, and overall performance may appear sluggish. This is where the VirtualBox Guest Additions come in. In this post, we will show you how to install VirtualBox Guest Additions in Ubuntu.

Guest Additions are a collection of drivers and utilities that enhance the integration of the host and guest operating systems. Installing Guest Additions unlocks various valuable functions, such as:

  • Mouse Integration is seamless, with no need to press a key to release the mouse.
  • Shared Clipboard allows for copying and pasting between the host and guest operating systems.
  • Drag and Drop Support easily transfers files between systems.
  • Improved video performance by dynamically resizing the guest OS screen.
  • Shared Folders allow you to access host files from the guest system.

Prerequisites

Before starting with the installation, ensure that you meet the following requirements:

1. System Requirements

  • A working VirtualBox installation.
  • VirtualBox-based Ubuntu guest OS with enough free storage (at least 500MB)

2. Ensure VirtualBox is Installed

If you haven’t already downloaded and installed VirtualBox, do so from the official website.

3. Install Necessary Packages

You must first install some essential packages before proceeding to install Guest Additions. Run the following command on the Ubuntu terminal:

sudo apt update && sudo apt upgrade -y

sudo apt install build-essential dkms linux-headers-$(uname -r)

These packages guarantee that the Guest Additions modules are compiled properly.

Step-by-Step Guide to Install Guest Additions in Ubuntu

Step 1: Update Ubuntu System

Keeping your system up to date is usually a smart idea when installing new applications. Open the terminal and run:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies

To ensure a smooth installation, install the following packages:

sudo apt install build-essential dkms linux-headers-$(uname -r)

Step 3: Insert the Guest Additions ISO Image

  1. Launch VirtualBox and activate your Ubuntu virtual computer.
  2. In VirtualBox, select Devices > Insert Guest Additions CD Image.
  3. To begin the installation, click Run when prompted.

Step 4: Mount the ISO Image Manually (If Not Auto-Mounted)

If the ISO does not mount itself, open a terminal and run:

sudo mount /dev/cdrom /mnt

Step 5: Run the Guest Additions Installer

Once the ISO has been mounted, proceed to the directory and run the installer:

cd /mnt

sudo ./VBoxLinuxAdditions.run

Wait for the installation to be completed.

Step 6: Restart Ubuntu to Apply Changes

After the installation, restart the Ubuntu guest system:

sudo reboot

Verifying the Installation

After the system restarts, see if the installation was successful.

  1. Seamless Mouse Integration – Move the mouse freely between the host and the visitor without pressing the release key.
  2. Screen Resizing – Try resizing the VirtualBox window and see whether Ubuntu adjusts accordingly.
  3. Shared Clipboard and Drag-and-Drop – Turn them on in VirtualBox’s Devices > Shared Clipboard and Drag-and-Drop settings.

If these features work, the installation is complete!

Troubleshooting Common Issues

1. Guest Additions ISO Not Found

If VirtualBox cannot find the ISO, manually download it from the VirtualBox website.

2. Unable to Mount Guest Additions to ISO

Try manually mounting it with the following:

sudo mount /dev/cdrom /mnt

3. Kernel Headers Not Found Error

Ensure that you have installed them correctly using:

sudo apt install linux-headers-$(uname -r)

4. Screen Resolution Not Changing

If the resolution does not change, try running:

xrandr –auto

5. Shared Clipboard or Drag-and-Drop Not Working

Check that they are enabled in VirtualBox settings under Devices > Shared Clipboard and Devices > Drag and Drop.

Conclusion

How to install VirtualBox Guest Additions on Ubuntu is a simple operation that can greatly improve your virtual machine experience. It improves performance, allows for flawless integration with the host system, and unlocks helpful capabilities like a shared clipboard, drag-and-drop, and seamless display scaling.

Following the instructions in this article should result in a fully running Ubuntu VM with all Guest Addition capabilities enabled. If you find any problems, check the troubleshooting section for solutions to common issues.

avatar
Vishvajit Kumar

i am a php developer. i have good knowledge in magento and wordpress.

       
Profile  

Leave a Reply

Your email address will not be published. Required fields are marked *