TechEarl

Installing VirtualBox Guest Additions on Ubuntu (22.04, 24.04, and 26.04 LTS)

Install VirtualBox Guest Additions on Ubuntu 22.04, 24.04, and 26.04 LTS guests for shared clipboard, drag and drop, shared folders, and dynamic display resolution. Covers VirtualBox 7.2, both install methods, and the Apple Silicon UTM alternative.

Ishan KarunaratnePublished ⏱️ 19 min readUpdated
Share thisCopied
Install VirtualBox Guest Additions on Ubuntu 22.04, 24.04, and 26.04 LTS guests for shared clipboard, drag and drop, shared folders, and dynamic display resolution. Covers VirtualBox 7.2, both install methods, and the Apple Silicon UTM alternative.

To install VirtualBox Guest Additions on Ubuntu, run sudo apt update, then sudo apt install virtualbox-guest-utils virtualbox-guest-x11, and reboot the VM. The vboxguest and vboxsf kernel modules already ship with Ubuntu's kernel, so nothing is compiled. Add yourself to the vboxsf group with sudo usermod -aG vboxsf $USER before using shared folders. To match your VirtualBox host version exactly, run VBoxLinuxAdditions.run from the Guest Additions CD image instead; that path needs build-essential and kernel headers.

Guest Additions is the kernel-level integration that turns a VirtualBox Ubuntu VM from a window with a mouse trap into something you can actually use as a daily driver: dynamic display resolution, bidirectional clipboard, drag-and-drop, shared folders, host-guest time sync. Without it, the desktop is stuck at 1024x768 and copy-paste does not cross the VM boundary. The install has shifted around a bit between VirtualBox 6.x and 7.x, and Ubuntu 22.04, 24.04, and 26.04 LTS all ship a working repository version that is good enough for most uses. This is the refreshed walkthrough for VirtualBox 7.2 (7.2.22 is the current release as of November 2026) on modern Ubuntu guests, including the two install paths, the prerequisites that catch people, shared folder setup, the HiDPI scaling fix, and where UTM beats VirtualBox on Apple Silicon.

How do I install VirtualBox Guest Additions on Ubuntu?

The fast path to install VirtualBox Guest Additions on Ubuntu 22.04, 24.04, or 26.04 LTS is the distro package: sudo apt update, then sudo apt install virtualbox-guest-utils virtualbox-guest-x11, then reboot the VM. That installs the Guest Additions userspace tools; the vboxguest and vboxsf kernel modules they talk to are already part of Ubuntu's kernel packages, so there is no DKMS build and nothing to recompile when the kernel updates. The alternative is the bundled CD image from the VirtualBox menu: Devices > Insert Guest Additions CD image, mount the ISO inside the guest, and run sudo ./VBoxLinuxAdditions.run. That path gives you the version Oracle ships with your specific VirtualBox release, compiles its own kernel modules (so it needs build-essential and matching kernel headers first), and is the only option on an arm64 guest, because the Ubuntu packages are built for amd64 only. Either way, reboot after, and add yourself to the vboxsf group with sudo usermod -aG vboxsf $USER before using shared folders.

Jump to:

What Guest Additions actually does

Guest Additions is a kernel module package (vboxguest, vboxsf, vboxvideo) plus a set of userspace daemons (VBoxClient) that run inside the guest OS. Together they enable:

  • Pointer integration, your mouse moves between host and guest without explicit capture/release.
  • Dynamic display resolution, the guest window resizes when you resize the VirtualBox window, and HiDPI scaling actually works.
  • Bidirectional clipboard, copy text on the host, paste in the guest, and vice versa.
  • Drag and drop, drag files between host and guest windows.
  • Shared folders, mount a host directory inside the guest as a regular filesystem (via the vboxsf kernel module).
  • Time synchronization, keeps the guest clock close to the host when the VM is suspended and resumed.
  • 3D acceleration, pass OpenGL calls through to the host GPU (limited; for serious 3D, native VMs or bare-metal).
  • Seamless mode, guest application windows render as if they were host windows. Mostly a Windows-guest feature; Ubuntu support is partial.

The VirtualBox manual on Guest Additions has the full feature matrix per OS.

Prerequisites: build tools and kernel headers

Only Method B (the CD image) compiles kernel modules, so only Method B needs build tools. Method A uses the vboxguest and vboxsf modules that already ship in Ubuntu's kernel packages and needs none of this. For Method B, install:

bash
sudo apt update
sudo apt install -y \
    build-essential \
    linux-headers-$(uname -r) \
    perl
  • build-essential gives you gcc, make, and friends. The VirtualBox manual lists the GNU compiler, GNU Make, and the kernel header files as what the installer needs.
  • linux-headers-$(uname -r) matches the headers to the currently running kernel. After a kernel upgrade, you may need linux-headers-generic so future kernels also get headers automatically.
  • perl is required by the VirtualBox CD installer's setup script (VBoxLinuxAdditions.run).

DKMS, despite this section's name, is not part of either path on current Ubuntu. Ubuntu 22.04, 24.04, and 26.04 have no virtualbox-guest-dkms package at all, and Oracle's manual does not involve DKMS either: the installer sets up its own vboxadd service, and sudo rcvboxadd setup is the documented command to recompile the modules, for example after a kernel upgrade.

Reboot if apt upgrade pulled a new kernel, running uname -r after apt install linux-headers-$(uname -r) should report the same kernel version that has matching headers in /usr/src/. The manual is explicit that the running kernel and the header files must be matching versions; otherwise the build fails or the module will not load.

Method A: install from the Ubuntu repository

This is the path I recommend for most setups. Ubuntu's multiverse repository component carries the Guest Additions userspace tools, and they update with the rest of the system:

bash
sudo apt update
sudo apt install -y \
    virtualbox-guest-utils \
    virtualbox-guest-x11

If apt cannot find them, the multiverse component is not enabled in your apt sources. There is no -dkms package to add: Ubuntu 22.04, 24.04, and 26.04 do not have virtualbox-guest-dkms, because the vboxguest, vboxsf, and vboxvideo kernel modules are part of Ubuntu's own kernel packages (linux-modules-*-generic on a standard install). They arrive and update with the kernel, and nothing is compiled on your machine. Older guides that tell you to apt install virtualbox-guest-dkms predate that and fail on these releases.

After install, reboot the VM:

bash
sudo reboot

The apt packages stay on the VirtualBox version each Ubuntu release shipped with, not the newest upstream: 22.04 has Guest Additions 6.1.50, 24.04 has 7.0.16, and 26.04 has 7.2.6, while the current VirtualBox release is 7.2.22 (October 2026). For most use cases the version mismatch is fine. If you need Guest Additions that match your host exactly (for a feature or fix that only exists in the newer release), use Method B.

These packages are built for amd64 only. On an arm64 Ubuntu guest, such as one running under VirtualBox on an Apple Silicon Mac, apt has no install candidate for them, so use Method B there.

For Ubuntu Server (no GUI), skip virtualbox-guest-x11 and install just virtualbox-guest-utils. The X11 piece is only useful when you have a desktop.

Method B: install from the VirtualBox CD image

This is the path Oracle documents and the one to use when you want the exact version that matches your host VirtualBox build.

In the VirtualBox menu of the running VM:

Devices > Insert Guest Additions CD image...

This mounts the ISO that ships with your VirtualBox installation (located on the host at e.g. /usr/share/virtualbox/VBoxGuestAdditions.iso on Linux, or C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso on Windows).

Inside the Ubuntu guest, open a terminal and run:

bash
# Find the mount point
ls /media/$USER/
# Usually: VBox_GAs_7.2.22   or similar versioned name

cd /media/$USER/VBox_GAs_*
sudo ./VBoxLinuxAdditions.run

On a desktop install you may also get an Autorun dialog offering to "Run software" from the CD; that runs the same script.

If the script reports This system is currently not set up to build kernel modules, the kernel headers or build-essential are missing. Install them (see prerequisites) and re-run.

When the script finishes, eject the CD and reboot:

bash
sudo eject /media/$USER/VBox_GAs_*
sudo reboot

Verify the install

Three quick checks after reboot:

bash
# 1. Kernel modules loaded
lsmod | grep -i vbox
# Expected: vboxguest and vboxsf (plus vboxvideo if the VM uses the VBoxVGA or VBoxSVGA graphics controller)

# 2. Userspace client running
ps aux | grep VBoxClient | grep -v grep
# Expected: several VBoxClient processes (clipboard, draganddrop, display, etc.)

# 3. Version installed in the guest
VBoxClient --version
# Expected: the Guest Additions version that is installed, not the host's.
# Method A (apt) prints Ubuntu's build, e.g. 7.0.16_Ubuntur162802 on 24.04 (6.1.50 on 22.04, 7.2.6 on 26.04).
# Method B (CD image) prints the host's release, e.g. 7.2.22 followed by an r-number.

If lsmod | grep vboxguest returns nothing, the kernel module did not load. Check sudo dmesg | grep -i vbox for errors. After a Method B install, the usual cause is a kernel upgrade: run sudo rcvboxadd setup to recompile the modules for the running kernel, then reboot, and sudo rcvboxadd status-kernel tells you whether the loaded modules match the installed Guest Additions version. After a Method A install the modules come from Ubuntu's kernel packages, so check that modinfo vboxguest finds one for your kernel flavour.

Enable bidirectional clipboard and drag-and-drop

These are off by default. Either set them in the VirtualBox VM settings before boot, or live from the Devices menu while running:

  • Devices > Shared Clipboard > Bidirectional (or unidirectional if you prefer)
  • Devices > Drag and Drop > Bidirectional

Or persistently, in the VirtualBox Manager: select the VM, Settings > General > Advanced, set both dropdowns to Bidirectional.

Drag-and-drop in 7.x is reasonably reliable for small files. For larger transfers (gigabytes), use a shared folder or scp instead, drag-and-drop streams the file through the VirtualBox process and can stall.

Set up shared folders

Shared folders give the guest direct access to a host directory via the vboxsf filesystem.

On the host, in VirtualBox Manager: Settings > Shared Folders > Add. Set:

  • Folder Path: the host directory (e.g. /Users/me/code or C:\Users\me\code).
  • Folder Name: what the guest sees (e.g. code).
  • Auto-mount: on. The guest will mount it under /media/sf_code on boot.
  • Make permanent: on, so the setting survives VM restarts.

Inside the guest, add your user to the vboxsf group so you can read/write the mount:

bash
sudo usermod -aG vboxsf $USER

Log out and back in (or reboot the VM) for the group membership to take effect. Verify with groups, vboxsf should appear in the list.

The auto-mounted share now appears at /media/sf_<name>:

bash
ls -la /media/sf_code

For a non-auto-mount or a custom mount point:

bash
sudo mkdir -p /mnt/code
sudo mount -t vboxsf code /mnt/code -o uid=$(id -u),gid=$(id -g)

Add an entry to /etc/fstab for persistence:

bash
code  /mnt/code  vboxsf  defaults,uid=1000,gid=1000,_netdev  0  0

The _netdev flag tells mount to wait until the network/vboxsf module is up before trying to mount.

HiDPI and display resolution fixes

On a 4K host display with a Ubuntu VM, the default scaling is usually wrong. Two things to fix:

1. VirtualBox display scaling. In the VM window, View > Virtual Screen 1 > Scale to 200% (or whatever ratio matches your host density). VirtualBox 7 does this per-window so you can have different scales on different monitors.

2. Ubuntu's own scaling. Inside the guest, Settings > Display > Scale > 200% (or fractional scaling for in-between values). Fractional scaling requires turning on experimental support in newer Ubuntu, set it once and it sticks across reboots.

If the guest is stuck at 1024x768 after install, Guest Additions did not load correctly. First look at which graphics controller the VM uses (Settings > Display). With VMSVGA, resizing is handled by the guest's vmwgfx driver plus the Guest Additions VBoxDRMClient service, and vboxvideo is not involved. With VBoxVGA or VBoxSVGA it is the vboxvideo module: check lsmod | grep vboxvideo, and after a CD-image install recompile with sudo rcvboxadd setup and reboot if it is missing. Since 7.2.8 Oracle's own vboxvideo is deprecated for kernel 7.0 and newer, in favour of VMSVGA or the vboxvideo that comes with the kernel. If the driver loaded but the resolution still does not change with window resize, restart the VBoxClient services: killall VBoxClient; VBoxClient-all.

For Wayland sessions specifically (Ubuntu 22.04+ defaults to Wayland for the GNOME session), dynamic resolution works but only after the VBoxClient daemons start under the user session. Logging out and back in usually clears any stuck state. If Wayland keeps misbehaving, switch to Xorg from the login screen's gear icon, Guest Additions has had more testing on X11.

VirtualBox 7 vs UTM on Apple Silicon

VirtualBox 7.2 lists Apple Silicon Macs (macOS 13 Ventura through 26 Tahoe) as supported hosts, so it is no longer experimental there; only Windows on Arm hosts still carry that label. The limit that matters is the guest architecture: an Arm host runs Arm guests only. The manual states that "Running an x86-based guest operating system on an Arm host platform is not supported", so on an M-series Mac you install arm64 Ubuntu, not the usual amd64 ISO, and VirtualBox will not emulate an x86_64 guest for you. Guest Additions for an arm64 Ubuntu guest come from the CD image (Method B), because Ubuntu's virtualbox-guest-* packages are amd64-only, and VMSVGA is the only graphics controller available on Arm hosts. Guest Additions for arm64 guests is more limited: clipboard works, shared folders work, dynamic display is OK, but the experience is noticeably less polished than on Intel.

For Apple Silicon Macs, UTM is the smoother option. UTM is a QEMU frontend that runs both x86 emulation and native arm64 virtualization (via Apple's Hypervisor framework). For arm64 Ubuntu it gives you:

  • Near-native performance via Hypervisor.framework.
  • SPICE-based clipboard and folder sharing (configure once, works similarly to Guest Additions).
  • Free and open-source (paid on the Mac App Store if you want to support development; otherwise free from GitHub releases).
  • A UI that is unambiguously designed for macOS.

If you are on Apple Silicon, my honest take is: use UTM with arm64 Ubuntu for daily use. If you need an x86_64 guest on Apple hardware, that is UTM as well: it runs x86 guests via QEMU TCG emulation, which is slow but works, and it is something VirtualBox does not do at all on an Arm host.

A quick comparison of the three current desktop hypervisor options:

AspectVirtualBox 7VMware Workstation/FusionUTM (Apple Silicon)
LicenseGPLv3 (PUEL for Extension Pack)Free for personal, commercial, and educational use since November 2024GPL/Apache (free from GitHub, paid in App Store)
Host platformsLinux, Windows, macOS (Intel and Apple Silicon; Arm hosts run Arm guests only)Linux, macOS, WindowsmacOS only
Guest performanceGood on Intel hosts, average on Apple SiliconBest of the three on IntelBest on Apple Silicon
Guest Additions equivalentGuest AdditionsVMware Tools / open-vm-toolsSPICE tools
Shared foldersvboxsfHGFS (Workstation) or SMBVirtFS, SPICE WebDAV, or VirtioFS
3D accelerationLimitedStrongLimited
Best forCross-platform Intel virtualizationPerformance on IntelApple Silicon daily-driver VMs

Troubleshooting

"This system is currently not set up to build kernel modules" during VBoxLinuxAdditions.run. Headers or compiler missing. Install build-essential linux-headers-$(uname -r) and re-run the script.

vboxguest module fails to load after a kernel upgrade. With a CD-image install, the modules were not rebuilt for the new kernel. Install the matching linux-headers-$(uname -r), run sudo rcvboxadd setup, and reboot. sudo rcvboxadd status-kernel confirms that the loaded modules match the installed Guest Additions version. With the apt packages this should not come up, because the modules ship inside Ubuntu's kernel packages.

Shared folder is read-only or "permission denied". You are not in the vboxsf group. Run sudo usermod -aG vboxsf $USER, then log out and back in. Confirm with groups.

Display resolution stuck at 1024x768. Check the VM's graphics controller. On VMSVGA the guest's vmwgfx driver and the VBoxDRMClient service do the resizing; on VBoxVGA or VBoxSVGA it is the vboxvideo module (lsmod | grep vboxvideo, and sudo rcvboxadd setup after a CD-image install if it is missing). On Wayland specifically, try restarting the session or switching to Xorg.

Bidirectional clipboard not working in one direction. Confirm in Devices > Shared Clipboard that it is set to Bidirectional, not just Host to Guest or Guest to Host. Restart the guest if you changed it after boot.

Drag-and-drop hangs or fails for large files. Known issue with large payloads. Use a shared folder or scp for anything over a few hundred megabytes.

Mount of vboxsf shared folder fails at boot. Add _netdev to the /etc/fstab mount options so it waits for the module to load.

What to do next

FAQ

You can run Ubuntu without Guest Additions, but the experience is rough: stuck resolution, no shared clipboard, no shared folders, manual pointer capture. For any VM you use more than once, install Guest Additions.

The exception is headless server VMs that you only access via SSH, they do not need the X11 piece. virtualbox-guest-utils alone is enough on a server.

virtualbox-guest-utils contains the userspace daemons and the vboxsf filesystem support, shared folders, time sync, the control channel. Works on any Ubuntu, server or desktop.

virtualbox-guest-x11 adds the X11/Wayland pieces, dynamic resolution, clipboard, drag-and-drop. Only useful if you have a graphical session in the guest. On Ubuntu Server, skip it.

For 95% of cases, the apt package. The kernel modules it relies on ship with Ubuntu's kernel, so there is nothing to rebuild when the kernel updates, and the userspace tools get fixes through the normal Ubuntu update cycle.

Use the CD image installer when you need an exact version match with a specific VirtualBox host (usually because a feature was added in a release newer than the one your Ubuntu version packages), or when the guest is arm64, since the apt packages are amd64-only.

If you installed via apt: sudo apt update && sudo apt upgrade inside the guest. Apt will pull whatever version Ubuntu currently ships.

If you installed from the CD image: re-mount the new CD image (Devices > Insert Guest Additions CD image), run sudo ./VBoxLinuxAdditions.run again, and reboot. The installer overwrites the previous version cleanly.

Yes. VirtualBox 7.2 lists Apple Silicon Macs as supported hosts, but only for Arm guests: the manual states that running an x86-based guest on an Arm host is not supported. Install arm64 Ubuntu, and take Guest Additions from the CD image, because Ubuntu's apt packages are amd64-only.

For Apple Silicon I recommend UTM for daily-driver VMs. It uses Apple's Hypervisor framework, has a better macOS-native UI, and has VirtFS and VirtioFS directory sharing that works cleanly. UTM is also the one to use for an x86 guest, which it emulates through QEMU. Reach for VirtualBox 7 on Apple Silicon only if you need a specific feature it has and UTM does not.

The guest display driver or its helper service is not running. With the VMSVGA graphics controller, an Ubuntu guest resizes through the vmwgfx driver and the Guest Additions VBoxDRMClient service. With VBoxVGA or VBoxSVGA it needs the vboxvideo module: check with lsmod | grep vboxvideo, and after a CD-image install that went stale on a kernel upgrade, run sudo rcvboxadd setup and reboot.

If the driver is loaded but resolution still does not adjust on window resize, the VBoxClient daemons are not running. Run VBoxClient-all from a terminal in the guest, or log out and back in to restart the user session.

Yes. Add the folder in the VirtualBox VM Settings > Shared Folders dialog on the Windows host. Pick auto-mount and "make permanent". Inside the Ubuntu guest, add yourself to the vboxsf group (sudo usermod -aG vboxsf $USER) and log out/in. The folder appears at /media/sf_<name>.

Permissions on the share use the host filesystem semantics, files created in the guest are owned by the host user, which can confuse build tools. For development workflows, sometimes a Samba share or virtio-fs is cleaner.

VirtualBox itself is GPLv3 and free. The VirtualBox Extension Pack (the VRDP remote desktop server, host webcam passthrough, the Intel PXE boot ROM, disk image encryption, and cloud integration) is licensed under the PUEL and is free for personal and educational use, but requires a commercial license for business use.

For development VMs the base GPL build covers everything most people need. The Extension Pack is only relevant if you specifically need one of those features, such as VRDP or disk encryption.

Sources

Authoritative references this article was fact-checked against.

TagsUbuntuVirtualBoxVirtualizationSystem AdministrationLinuxGuest Additions

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Systems and Network Architect · Chief Technology Officer

Systems and network architect and Chief Technology Officer with more than two decades designing, building, and running production software, cloud and network architecture, Linux systems, and the bare metal underneath them, and lately working AI into the stack. A US Army veteran who served in Operation Iraqi Freedom. What I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Install Docker on Ubuntu (official apt repo), macOS and Windows (Docker Desktop, WSL2), run docker without sudo, and fix 'Cannot connect to the Docker daemon'.

How to Install Docker on Ubuntu, macOS, and Windows (2026)

Install Docker the right way for your OS: the official apt repo on Ubuntu (not the distro's docker.io), Docker Desktop on macOS and Windows, run docker without sudo, fix 'Cannot connect to the Docker daemon', and use your new install to run tools without installing them.