Table of Contents#
- Prerequisites
- Step 1: Update Your openSUSE System
- Step 2: Install Required Dependencies
- Step 3: Mount the VirtualBox Guest Additions ISO
- Step 4: Run the Guest Additions Installer
- Step 5: Verify Installation and Enable Features
- Troubleshooting Common Issues
- Conclusion
- References
Prerequisites#
Before starting, ensure you have:
- A running openSUSE VM in VirtualBox (tested on openSUSE Leap 15.5 and Tumbleweed).
- The VirtualBox host application installed (version 6.1 or newer recommended; match the Guest Additions version to your host VirtualBox version).
- Internet access on the openSUSE guest (to download dependencies).
- Administrative privileges (root access) on the openSUSE guest.
Step 1: Update Your openSUSE System#
First, update your openSUSE system to ensure you have the latest packages and kernel headers. Open a terminal in openSUSE and run:
sudo zypper refresh
sudo zypper update -yReboot the VM if prompted (e.g., if the kernel was updated):
sudo rebootStep 2: Install Required Dependencies#
Guest Additions require kernel headers, compilers, and tools to build and install drivers. Install these dependencies using zypper, openSUSE’s package manager.
2.1: Identify Your Kernel Version#
Guest Additions need headers matching your running kernel version. Check your kernel version with:
uname -rExample output:
6.4.0-1-default
2.2: Install Kernel Headers and Build Tools#
Install the kernel headers package corresponding to your kernel version. For most openSUSE systems (using the default kernel-default), the package name is kernel-default-devel. Replace 6.4.0-1-default with your kernel version from uname -r:
sudo zypper in -y kernel-default-devel gcc make perlIf you’re using a non-default kernel (e.g., kernel-desktop or kernel-azure), replace kernel-default-devel with the appropriate package (e.g., kernel-desktop-devel). Verify available kernel header packages with:
zypper search kernel-*-develStep 3: Mount the VirtualBox Guest Additions ISO#
The Guest Additions installer is distributed as an ISO file bundled with VirtualBox. We’ll mount this ISO in the openSUSE guest.
3.1: Insert the Guest Additions ISO#
In the VirtualBox menu bar (on your host machine), go to:
Devices > Insert Guest Additions CD Image...
If prompted to download the ISO (first-time use), click “Download” and wait for it to complete.
3.2: Mount the ISO in openSUSE#
openSUSE may auto-mount the ISO (check the desktop for a “VBox_GAs_*” icon). If not, manually mount it:
-
Create a mount point:
sudo mkdir -p /mnt/cdrom -
Mount the ISO (replace
/dev/sr0with your CD-ROM device if needed; check withlsblk):sudo mount /dev/sr0 /mnt/cdromYou should see output like:
mount: /mnt/cdrom: WARNING: source write-protected, mounted read-only.
Step 4: Run the Guest Additions Installer#
Now run the installer script from the mounted ISO.
4.1: Navigate to the Mounted ISO Directory#
cd /mnt/cdrom4.2: Execute the Installer#
Run the VBoxLinuxAdditions.run script as root:
sudo sh ./VBoxLinuxAdditions.run4.3: Monitor the Installation#
The installer will build and install kernel modules (e.g., vboxguest, vboxsf, vboxvideo). Watch for output like:
...
Installing VirtualBox Guest Additions ...done.
Note: Warnings about “X.Org server” or “3D acceleration” are usually safe to ignore unless you need advanced graphics features.
Step 5: Verify Installation and Enable Features#
Reboot the VM to load the new kernel modules:
sudo reboot5.1: Check if Modules Are Loaded#
After rebooting, verify the Guest Additions kernel modules are loaded:
lsmod | grep vboxYou should see modules like:
vboxguest: Core Guest Additions modulevboxsf: Shared folders supportvboxvideo: Video acceleration driver
Example output:
vboxvideo 53248 1
vboxsf 86016 0
vboxguest 4014080 2 vboxsf
5.2: Enable Key Features#
Most features work out-of-the-box, but confirm/enable them via VirtualBox settings:
Shared Clipboard & Drag-and-Drop#
Go to Devices > Shared Clipboard and select Bidirectional.
For drag-and-drop, go to Devices > Drag and Drop and select Bidirectional.
Shared Folders#
To access host files from the guest:
- On the host, create a folder to share (e.g.,
~/VirtualBox_Shared). - In VirtualBox, go to
Devices > Shared Folders > Shared Folders Settings.... - Click “Add” (+), select the host folder, and check “Auto-mount” and “Make Permanent.”
- In the guest, access the shared folder at
/media/sf_<FolderName>(e.g.,/media/sf_VirtualBox_Shared).
Automatic Screen Resolution#
Resize the VirtualBox window—the guest resolution should adjust automatically. If not, log out and log back in.
Troubleshooting Common Issues#
Issue 1: “Kernel headers not found” Error#
If the installer fails with Kernel headers not found for target kernel, ensure:
- You installed the correct kernel header package (e.g.,
kernel-default-develmatchesuname -r). - The kernel version didn’t change after updating (reboot if needed).
Issue 2: ISO Not Mounting#
If mount /dev/sr0 /mnt/cdrom fails, check:
- The ISO is inserted via
Devices > Insert Guest Additions CD Image.... - The CD-ROM device is recognized:
lsblk | grep sr0(look for asr0entry).
Issue 3: Poor Performance or Missing Features#
- Ensure Guest Additions version matches your VirtualBox host version (e.g., host v7.0.8 → Guest Additions v7.0.8).
- Reinstall Guest Additions after kernel updates: Repeat Steps 3–4.
Conclusion#
Installing VirtualBox Guest Additions transforms your openSUSE VM from a sluggish, limited environment into a seamless, high-performance system. With features like shared clipboard, automatic resolution, and shared folders, you’ll work as efficiently in the guest as you do on the host.
Follow the steps above, and if you run into issues, refer to the troubleshooting section or official documentation linked below.