I am having a problem trying to install the guest additions for my ubuntu 18.04 and virtualbox 5.2.12
I thought I did something wrong so I tried to install the additions from the CLI, unistalled and installed dkms... I even deleted the virtual machine and installed ubuntu again and it has the same error.
Can anyone help please as I did not find an updated solution to my problem. Here is the message i get when trying to install the addons:

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.12 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting.
Press Return to close this window...
  • If my answer was helpful, please remember to accept my answer by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
    – heynnema
    Oct 29 '20 at 15:04

In terminal...

sudo apt-get update
sudo apt-get install build-essential gcc make perl dkms

then reinstall the VB Guest Additions.


  • purge virtualbox-guest-dkms
  • purge virtualbox-5.2 and any other virtualbox softwares
  • ls -al /lib/modules/$(uname -r)/updates/dkms and look for any leftover virtualbox kernel drivers. These need to be manually deleted.
  • dpkg -l *virtualbox* and dkms status should show no virtualbox software
  • install virtualbox-5.2 and create your VM
  • in the VM, choose the Devices menu, then "Insert Guest Additions CD Image"
  • it'll ask if you wish to install the Guest Additions
  • Note: if it doesn't automatically ask to install Guest Additions, you have to do it manually.
    • find the CD icon, on your desktop, or in Files, and open it
    • open a terminal in this directory
    • sudo ./VBoxLinuxAdditions.run
  • 1
    I executed the commands as listed but i keep getting the error message even though i restarted the system more than once:
    – TOH19
    May 11 '18 at 19:43
  • @TOH19 show me dpkg -l *irtualbox* and dkms status.
    – heynnema
    May 11 '18 at 19:49
  • dpkg -l *irtualbox* Name : <none> Version: <none> Architecture: <none> Description: (no description available)
    – TOH19
    May 11 '18 at 19:58
  • 1
    @HenriquedeSousa Start a new question with whatever details you can supply, including any error messages, and what you've done to try and solve the problem, and I'll try to help you.
    – heynnema
    Nov 12 '20 at 13:05
  • 1
    @HenriquedeSousa See my comment there.
    – heynnema
    Nov 16 '20 at 15:32

I had the same problem on Lubuntu 18.04. I had to follow the steps in heynnema's answer, but also had to install dkms. Then I reinstalled Guest Additions (mine is 5.2.12) from the disk image and it worked after a reboot. All that was left was setting up permissions for shared folders, but that's another story.

So basically:

  1. Open your terminal
  2. sudo apt-get install build-essential gcc make perl dkms
  3. reboot
  4. Open your terminal
  5. Go to the installation disk
  6. sudo sh VBoxLinuxAdditions.run
  7. reboot

This was done on a fresh Lubuntu 18.04 install.


I had similar issues. (Host: windows / Guest: Lubuntu 18.04)

Solution was simple: I had to update my Virtual Box Installation to the newest one (V5.2.22)

After updating the Virtual Box (in my host), the installtion of the virtualbox addons (in guest) worked without any problems.


As heynnema said, you will need gcc make and perl to build the kernel modules which are not installed for some reason on my machine when installing.


sudo apt-get update
sudo apt-get install build-essential gcc make perl dkms
sudo /sbin/vboxconfig


  • what does the command sbin/vboxconfig do
    – john
    Feb 12 '21 at 8:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.