How to Install Virtualbox Guest Additions on Debian 7 Wheezy

By | May 1, 2023

Virtualbox guest additions in Debian

Debian 7 wheezy has virtualbox guest additions inbuilt. So after installing debian on virtualbox the guest addition features are immediately available.

However the guest additions bundled with debian is general of older version compared to the latest virtualbox version. So its a good idea to install the latest virtualbox guest additions.

Here is a quick command that will tell the version of virtualbox guest additions currently installed.

#  lsmod | grep -io vboxguest | xargs modinfo | grep -iw version
version:        4.1.18_Debian

So in the default installation of debian 7, the guest additions version 4.1.18 are inbuilt. So it needs to be updated.

The same command can be run in 2 steps instead.

# lsmod | grep -i vboxvboxsf                 29071  1 
vboxvideo              12437  1 
drm                   183952  2 vboxvideo
vboxguest             148611  6 vboxsf

# modinfo vboxguestfilename:       /lib/modules/3.2.0-4-amd64/updates/dkms/vboxguest.ko
version:        4.1.18_Debian
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     2B8D846D07E45862D5C0169
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
vermagic:       3.2.0-4-amd64 SMP mod_unload modversions 

Install latest guest additions

First the system needs to be prepared to compile the latest virtualbox guest additions.

# apt-get install build-essential module-assistant

Next, install the necessary kernel headers using module assistant.

# m-a prepare

Now click Devices > Install Guest Additions in virtualbox window to mount the guest addition image. And then proceed with installation.

root@localhost:/media/cdrom0# ./ 
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.12 Guest Additions for Linux............
VirtualBox Guest Additions installer
You appear to have a version of the VBoxGuestAdditions software
on your system which was installed from a different source or using a
different type of installer.  If you installed it from a package from your
Linux distribution or if it is a default part of the system then we strongly
recommend that you cancel this installation and remove it properly before
installing this version.  If this is simply an older or a damaged
installation you may safely proceed.

Do you wish to continue anyway? [yes or no]
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers
Installing X.Org Server 1.12 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services components ...done.

All lines should show as done. Especially the line "Building the VirtualBox Guest Additions kernel modules". Once done, restart the guest. Also check the guest additions version again.

# lsmod | grep -io vboxguest | xargs modinfo | grep -iw version
version:        4.2.12

If the cdrom has got mounted as readonly and not allowing to execute file then remount it using the mount command.

# mount -o remount,exec /dev/sr0
mount: warning: /media/cdrom0 seems to be mounted read-only.

Replace /dev/sr0 with the device name. The device name can be found by running just mount command.

So now you should have the latest virtualbox guest additions installed in the Debian guest. Enjoy!

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].


How to Install Virtualbox Guest Additions on Debian 7 Wheezy

Leave a Reply

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