69

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.

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...
0

4 Answers 4

102

In terminal...

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

then reinstall the VB Guest Additions.

Update:

  • 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
18
  • 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, 2018 at 19:43
  • @TOH19 show me dpkg -l *irtualbox* and dkms status.
    – heynnema
    May 11, 2018 at 19:49
  • 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, 2020 at 13:05
  • 1
    @HenriquedeSousa See my comment there.
    – heynnema
    Nov 16, 2020 at 15:32
  • 2
    The apt-get commands, followed by reboot and reinstallation of Guest Additions (via the GUI) worked for me, with VB 6.1, Ubuntu 20.04 . None of the "Update" stuff was needed. Jan 22 at 20:07
19

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.

3

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.

Try:

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

Reboot.

1
  • what does the command sbin/vboxconfig do
    – john
    Feb 12, 2021 at 8:51
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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