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.0 and 7.1 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 on Ubuntu 22.04, 24.04, or 26.04 LTS is the distro package: sudo apt update, then sudo apt install build-essential dkms linux-headers-$(uname -r) virtualbox-guest-utils virtualbox-guest-x11, then reboot the VM. That installs the open-source Guest Additions modules and userspace tools, builds them against your running kernel via DKMS, and re-builds them automatically every time the kernel is updated. 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 and is the one to use when you need a feature only present in the latest VirtualBox. Either way, install kernel headers and DKMS first, reboot after, and add yourself to the vboxsf group with sudo usermod -aG vboxsf $USER before mounting shared folders.
Jump to:
- What Guest Additions actually does
- Prerequisites: kernel headers and DKMS
- Method A: install from the Ubuntu repository
- Method B: install from the VirtualBox CD image
- Verify the install
- Enable bidirectional clipboard and drag-and-drop
- Set up shared folders
- HiDPI and display resolution fixes
- VirtualBox 7 vs UTM on Apple Silicon
- Troubleshooting
- What to do next
- FAQ
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
vboxsfkernel 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: kernel headers and DKMS
Both install methods build a kernel module against your running kernel. That requires:
sudo apt update
sudo apt install -y \
build-essential \
dkms \
linux-headers-$(uname -r) \
perlbuild-essentialgives yougcc,make, and friends.dkms(Dynamic Kernel Module Support) is the system that re-builds out-of-tree modules every time the kernel is updated. Without DKMS, yourvboxguestmodule would silently disappear after the nextapt upgradeof the kernel.linux-headers-$(uname -r)matches the headers to the currently running kernel. After a kernel upgrade, you may needlinux-headers-genericso future kernels also get headers automatically.perlis required by the VirtualBox CD installer's setup script (VBoxLinuxAdditions.run).
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/. Otherwise DKMS will build against the wrong headers and the module will fail to load.
Method A: install from the Ubuntu repository
This is the path I recommend for most setups. The Ubuntu universe repository ships a working Guest Additions package that auto-rebuilds with DKMS and updates with the rest of the system:
sudo apt update
sudo apt install -y \
virtualbox-guest-utils \
virtualbox-guest-x11On Ubuntu 24.04 LTS and 26.04 LTS the virtualbox-guest-dkms package was dropped and replaced by direct kernel-module shipment in the linux-modules-extra package, so you do not need a separate -dkms install on 24.04 or 26.04. On 22.04 LTS, also install virtualbox-guest-dkms:
# 22.04 LTS only
sudo apt install -y virtualbox-guest-dkmsAfter install, reboot the VM:
sudo rebootThe package versions in apt usually lag the latest VirtualBox release by one minor (e.g. apt ships 7.0.x while VirtualBox is on 7.1.x). For most use cases the version mismatch is fine, Guest Additions is backward and forward compatible across minor versions. If you need the newest Guest Additions to match a 7.1 host (for a 7.1-only feature), use Method B.
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:
# Find the mount point
ls /media/$USER/
# Usually: VBox_GAs_7.1.4 or similar versioned name
cd /media/$USER/VBox_GAs_*
sudo ./VBoxLinuxAdditions.runOn 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:
sudo eject /media/$USER/VBox_GAs_*
sudo rebootVerify the install
Three quick checks after reboot:
# 1. Kernel modules loaded
lsmod | grep -i vbox
# Expected: vboxguest, vboxsf, vboxvideo
# 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: a version string like 7.1.4If lsmod | grep vboxguest returns nothing, the kernel module did not load. Check sudo dmesg | grep -i vbox for build errors. The most common cause is a kernel upgrade that bypassed DKMS, run sudo dkms autoinstall to force a rebuild, then reboot.
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/codeorC:\Users\me\code). - Folder Name: what the guest sees (e.g.
code). - Auto-mount: on. The guest will mount it under
/media/sf_codeon 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:
sudo usermod -aG vboxsf $USERLog 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>:
ls -la /media/sf_codeFor a non-auto-mount or a custom mount point:
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:
code /mnt/code vboxsf defaults,uid=1000,gid=1000,_netdev 0 0The _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. Check lsmod | grep vboxvideo. If vboxvideo is missing, rebuild with sudo dkms autoinstall and reboot. If it 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 added experimental Apple Silicon support, but in 2026 it is still rough. You can run x86_64 Ubuntu under emulation (slow) or arm64 Ubuntu (faster). Guest Additions for arm64 guests is 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, and only reach for VirtualBox 7 if you need an x86_64 guest that has to run on Apple hardware. UTM also runs x86 guests via QEMU TCG emulation, which is slow but works.
A quick comparison of the three current desktop hypervisor options:
| VirtualBox 7 | VMware Workstation/Fusion | UTM (Apple Silicon) | |
|---|---|---|---|
| License | GPLv3 (PUEL for Extension Pack) | Free for personal use since 2024 | GPL/Apache (free from GitHub, paid in App Store) |
| Host platforms | Linux, macOS (Intel + Apple Silicon experimental), Windows | Linux, macOS, Windows | macOS only |
| Guest performance | Good on Intel hosts, average on Apple Silicon | Best of the three on Intel | Best on Apple Silicon |
| Guest Additions equivalent | Guest Additions | VMware Tools / open-vm-tools | SPICE tools |
| Shared folders | vboxsf | HGFS (Workstation) or SMB | virtio-fs |
| 3D acceleration | Limited | Strong | Limited |
| Best for | Cross-platform Intel virtualization | Performance on Intel | Apple 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 dkms linux-headers-$(uname -r) and re-run the script.
vboxguest module fails to load after a kernel upgrade. DKMS did not rebuild. Run sudo dkms autoinstall followed by a reboot. Check sudo dkms status to confirm the module is registered against the current kernel.
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. vboxvideo module not loaded. Check lsmod | grep vboxvideo. If missing, rebuild with sudo dkms autoinstall. 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
- SSH Cheat Sheet, once your Ubuntu VM is set up, the next thing is almost always SSH'ing into it from the host. Bookmark the flag reference.
- Bash For Loops: Syntax, Examples, and One-Liners, handy for batch-setup scripts you write inside the VM.
- Domain Directing and Virtual Host Setup for WAMP Server, the Windows-host counterpart for running local web stacks. Useful context if you are choosing between a VM and native WAMP.
- How to Update Node.js Version, first thing I install inside a fresh Ubuntu VM is a current Node. This is the path.
- Increase Google Cloud VM Disk Size Without Rebooting, different platform, same skill: resize a VM's disk live. The same
lsblkandresize2fsrecipe applies to a VirtualBox VDI once you grow it on the host side. - CVE-2026-31431 'Copy Fail': Detect and Patch the Linux Kernel LPE, kernel-side context for the same Ubuntu install you just configured; patch this before treating the VM as production.
- External: the VirtualBox User Manual is the authoritative reference for advanced features (snapshots, headless mode, VBoxManage CLI).





![Bash conditionals reference: if/elif/else syntax, [ ] vs [[ ]] vs (( )) test contexts, numeric, string, and file operators, the case statement, and the unquoted-variable pitfall.](https://techearl.com/cdn-cgi/image/width=1536,format=auto,quality=90/https://images.techearl.com/bash-if-else/bash-if-else.jpg?v=2026-01-08T11%3A24%3A00Z)