Home Distributions How to Install VirtualBox Guest Additions on Ubuntu & Rocky (2026)
DistributionsLinuxRedHatUbuntuVirtualBox

How to Install VirtualBox Guest Additions on Ubuntu & Rocky (2026)

Share
How to Install VirtualBox Guest Additions on Ubuntu & Rocky (2026)
How to Install VirtualBox Guest Additions on Ubuntu & Rocky (2026)
Share

How to Install VirtualBox Guest Additions on Ubuntu & Rocky (2026)

Posted on April 18 2026 • By [KRISHNAN], Linux Solutions Writer

 

TL;DR

OS Command Summary
Ubuntu 24.04 LTS sudo apt update && sudo apt install build-essential dkms linux-headers-$(uname -r) && sudo mount /dev/cdrom /mnt && sudo /mnt/VBoxLinuxAdditions.run && sudo reboot
Rocky Linux 9.4 sudo dnf groupinstall “Development Tools” && sudo dnf install epel-release dkms kernel-devel-$(uname -r) && sudo mount /dev/cdrom /mnt && sudo /mnt/VBoxLinuxAdditions.run && sudo systemctl restart systemd-modules-load.service && sudo reboot

If you just want the quick‑copy/paste version, scroll to the bottom for the One‑Liner Cheat Sheet.

 

Why Guest Additions Matter

VirtualBox Guest Additions are a collection of device drivers and utilities that dramatically improve the interaction between a guest OS and its host:

  • Seamless mouse integration (no more “grab” mode)
  • Dynamic screen resizing and full‑screen support
  • Shared folders for easy file exchange
  • Hardware‑accelerated graphics (up to 3D support)
  • Time synchronization between host and guest

Getting them installed correctly on Ubuntu and Rocky Linux (the 2026‑era, community‑driven RHEL successor) is essential for a smooth development or testing workflow.

 

Prerequisites

Item Ubuntu Rocky Linux
VirtualBox version 7.0+ (latest stable) 7.0+ (latest stable)
Guest OS version Ubuntu 22.04 LTS, 24.04 LTS (recommended) Rocky Linux 9.3–9.4
Internet connection
Sufficient disk space ≥ 2 GB free (for kernel headers) ≥ 2 GB free
Root / sudo access
VirtualBox “Insert Guest Additions CD image” option enabled (under Devices → Insert Guest Additions CD image…)

Tip: Always run the latest VirtualBox on the host. The Guest Additions ISO is bundled with the host installation, so no extra download is required.

 

Step‑by‑Step Installation

1️⃣ Mount the Guest Additions ISO (Both OSes)

  1. Power on your VM.
  2. From the VirtualBox menu, choose Devices → Insert Guest Additions CD image…
  3. Ubuntu will usually auto‑mount it under /media/<user>/VBox_GAs_<version>.
  4. Rocky Linux may need a manual mount:

sudo mkdir -p /mnt/cdrom

sudo mount /dev/cdrom /mnt/cdrom

If you see “no medium found” – re‑insert the ISO from the VirtualBox menu or verify that Optical Drive → Host Drive points to the ISO file.

 

2️⃣ Install Required Build Tools

Ubuntu 24.04 LTS

sudo apt update

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

  • build-essential → gcc, make, etc.
  • dkms → automatically rebuilds the modules after kernel updates.
  • linux-headers-$(uname -r) → exact headers for the running kernel.

Rocky Linux 9.4

sudo dnf groupinstall -y “Development Tools”

sudo dnf install -y epel-release

sudo dnf install -y dkms kernel-devel-$(uname -r) kernel-headers-$(uname -r)

  • The EPEL repository supplies dkms for Rocky.
  • kernel-devel provides the build environment matching the running kernel.

 

3️⃣ Run the Installer

Ubuntu

cd /media/$USER/VBox_GAs_*/  # or wherever the ISO auto‑mounted

sudo ./VBoxLinuxAdditions.run

Rocky Linux

cd /mnt/cdrom

sudo sh ./VBoxLinuxAdditions.run

What to expect:
The script compiles three kernel modules (vboxsf, vboxvideo, vboxguest). Successful compilation ends with messages like:

vboxguest: OK

vboxsf: OK

vboxvideo: OK

If you see “module not signed” warnings, they are harmless on a typical desktop VM. On Secure Boot‑enabled systems, you’ll need to either enroll a signing key or disable Secure Boot (outside the scope of this post).

 

4️⃣ Verify & Enable Features

Feature Verification Command (Ubuntu) Verification Command (Rocky)
Mouse integration Move the mouse—no capture needed Same
Shared folders `mount grep vboxsf`
3D acceleration Check Display → Graphics Controller set to VMSVGA + Enable 3D Same
Time sync date inside guest vs host Same

If shared folders are not auto‑mounted, add an entry to /etc/fstab:

# Example: mount host folder /home/user/Shared to /mnt/shared inside guest

SharedFolder  /mnt/shared  vboxsf  defaults  0  0

Create the mount point first: sudo mkdir -p /mnt/shared.

 

5️⃣ Reboot & Final Test

sudo reboot

After reboot:

  • Resize the VM window; the guest resolution should adapt automatically.
  • Drag‑and‑drop a file from the host to the guest (if the feature is enabled).
  • Open a terminal and type lsmod | grep vbox – you should see the three modules loaded.

 

Troubleshooting Common Issues (2026 Edition)

Symptom Likely Cause Fix
vboxadd: cannot locate module Kernel headers missing or mismatched version Reinstall linux-headers-$(uname -r) (Ubuntu) or kernel-devel-$(uname -r) (Rocky) and rerun the installer.
dkms: command not found DKMS not installed sudo apt install dkms (Ubuntu) or sudo dnf install dkms (Rocky).
Graphics flicker or low resolution 3D acceleration disabled in VM settings Shut down VM → Settings → Display → Check Enable 3D Acceleration → Restart.
Shared folders show “Permission denied” Incorrect user group membership Add your user to the vboxsf group: sudo usermod -aG vboxsf $USER && newgrp vboxsf.
Secure Boot blocks vboxguest Signed kernel modules required Either disable Secure Boot in the VM’s BIOS or enrol a signing key (advanced).
Installer aborts with “no space left on device” /tmp is full (common on minimal Rocky images) Clear space: sudo rm -rf /tmp/* or mount a larger tmpfs.

 

One‑Liner Cheat Sheet

# Ubuntu

sudo apt update && sudo apt install -y build-essential dkms linux-headers-$(uname -r) && sudo mount /dev/cdrom /mnt && sudo /mnt/VBoxLinuxAdditions.run && sudo reboot

 

# Rocky Linux

sudo dnf groupinstall -y “Development Tools” && sudo dnf install -y epel-release dkms kernel-devel-$(uname -r) && sudo mount /dev/cdrom /mnt && sudo /mnt/VBoxLinuxAdditions.run && sudo systemctl restart systemd-modules-load.service && sudo reboot

Copy, paste, and your guest will be fully integrated in seconds.

 

Wrap‑Up

Installing VirtualBox Guest Additions on modern Ubuntu and Rocky Linux in 2026 is straightforward—provided you have the right build tools and kernel headers. Once installed, you’ll enjoy buttery‑smooth mouse handling, dynamic screen resizing, shared folders, and even 3D graphics acceleration. Keep the Guest Additions package up‑to‑date (VirtualBox will prompt you on kernel updates) and your VMs will stay performant for the long haul.

 

Keywords

  • VirtualBox Guest Additions
  • Ubuntu 24.04 LTS
  • Rocky Linux 9.4

Hashtags

#VirtualBox #GuestAdditions #Ubuntu #RockyLinux #LinuxTips #DevOps #2026Tech

 

Disclaimer

The instructions above are accurate at the time of writing (April 2026) and have been tested on default installations of Ubuntu 24.04 LTS and Rocky Linux 9.4. Individual system configurations, custom kernels, or corporate security policies (e.g., mandatory Secure Boot) may require additional steps not covered in this post. The author and publisher accept no liability for any data loss, system instability, or other issues that may arise from following these guidelines. Always back up critical data before making kernel‑level changes.

 

 

Share

Leave a comment

Leave a Reply

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

Related Articles
Secret Link