An Ubuntu virtual machine can boot and run applications without close integration with its host. VirtualBox Guest Additions supplies the guest drivers and services that support automatic desktop resizing, shared folders, and other host-to-guest features.

Oracle supplies Guest Additions on a virtual CD bundled with VirtualBox, which keeps the installer aligned with the host's version. Ubuntu needs a compiler and headers for its running kernel to build the guest modules, so installation requires internet access and a user with sudo privileges inside the VM.

Guest Additions does not itself select host folders or enable clipboard sharing. Those remain separate VM settings, so the installation can be working even when neither feature is configured.

Steps to install VirtualBox Guest Additions on Ubuntu VM:

  1. Refresh the package index inside the running Ubuntu VM.
    $ sudo apt update
  2. Install the build tools and headers for the running kernel.
    $ sudo apt install -y build-essential dkms bzip2 linux-headers-$(uname -r)

    linux-headers-$(uname -r) selects headers for the kernel currently in use. If APT cannot find that package after a kernel update, a reboot into the updated kernel may be needed before retrying.

  3. Choose Devices → Insert Guest Additions CD image… in the running VM's VirtualBox window.

    Inserting the disc alone does not install Guest Additions.

  4. Create a mount directory for the Guest Additions disc.
    $ sudo mkdir -p /media/guestadditions
  5. Mount the virtual CD at /media/guestadditions.
    $ sudo mount /dev/cdrom /media/guestadditions
    mount: /media/guestadditions: WARNING: source write-protected, mounted read-only.

    The read-only message is normal for a CD image. If Ubuntu already mounted the disc automatically, the installer is also available in its existing mount directory.

  6. Run the Guest Additions installer for the VM's processor architecture.

    The installer writes system drivers inside Ubuntu with root privileges. A VM snapshot provides a rollback if a driver change prevents normal startup.

    $ sudo sh /media/guestadditions/VBoxLinuxAdditions.run

    That filename is for Intel/AMD guests. On an ARM64 Ubuntu VM, such as one running on an Apple silicon Mac, use the ARM installer instead.

    $ sudo sh /media/guestadditions/VBoxLinuxAdditions-arm64.run

    The installer builds the guest modules and updates the initramfs. Build errors are recorded in /var/log/vboxadd-setup.log. The 7.2.22 ARM installer can end with Decompression failed after loading its modules; both post-reboot checks must still succeed before the installation is usable.

  7. Reboot Ubuntu to load the installed Guest Additions at startup.

    The VM restarts and closes its applications, so unsaved work can be lost.

    $ sudo reboot
  8. Check that the Guest Additions kernel modules are loaded at the installed version.
    $ sudo rcvboxadd status-kernel
    VirtualBox Guest Additions: kernel modules 7.2.22 r175245 are loaded

    The version and revision vary with the host's VirtualBox release. A missing-module or version-mismatch message means the driver installation needs attention.

  9. Confirm that the Guest Additions user services are running after reboot.
    $ sudo rcvboxadd status-user
    VirtualBox Guest Additions: user-land services 7.2.22 r175245 are running

    are running confirms the background services are available. An installed directory or a loaded vboxguest module alone does not establish that state.

Share this guide