35

I have installed Ubuntu 12.10 Guest on Ubuntu 12.04 Host using VirtualBox. Everything is from repository and no direct install. When I install the guest additions, the below error is shown in the console. Before running the command I mapped the VBoxGuestAdditions.iso in the Guest.

The closest I could get is this article which says to install the latest version of VirtualBox (not the one from the repository). Is there any alternate solution?

sudo ./VBoxLinuxAdditions.run

Verifying archive integrity... All good.  
Uncompressing VirtualBox 4.1.12 Guest Additions for Linux.........  
VirtualBox Guest Additions installer  
Removing installed version 4.1.12 of VirtualBox Guest Additions...  
Removing existing VirtualBox DKMS kernel modules ...done.  
Removing existing VirtualBox non-DKMS kernel modules ...done.  
Building the VirtualBox Guest Additions kernel modules  
The headers for the current running kernel were not found. If the following  
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!  
(Look at /var/log/vboxadd-install.log to find out what went wrong)  
Doing non-kernel setup of the Guest Additions ...done.  
Installing the Window System drivers  
Warning: unknown version of the X Window System installed.  Not installing  
X Window System drivers.  
Installing modules ...done.  
Installing graphics libraries and desktop services components ...done.
  • 1
    Please clarify the virtualbox version - v4.2.2 has been released - you should be using that. – fossfreedom Oct 21 '12 at 13:19
  • What comes with the 12.04 repo is VirtualBox 4.1.12. So, I should install it separately not from the repo. – Praveen Sripati Oct 21 '12 at 16:20
29

For VirtualBox version 4.2.0 . Oracle's Version.

Install the package virtualbox-guest-x11 and you will be fine.

enter image description here

From terminal (Virtual System)

sudo apt-get install virtualbox-guest-x11

Reboot you Virtual System.

  • Installing virtualbox-guest-x11 allowed full screen. But, sudo ./VBoxLinuxAdditions.run on the guest gives the same error as mentioned in the OP. Does it mean that the guest add-ons have been installed successfully? – Praveen Sripati Oct 21 '12 at 16:19
  • What guest-additions offers ? see here. So I assume the answer to your question is Yes, installed successfully. – NickTux Oct 21 '12 at 17:52
  • Thanks - got it - accepted the answer. So, your solutions installs the X Windows System Drivers in the guest. – Praveen Sripati Oct 22 '12 at 1:12
  • Can you explain what this actually does? Does this replace the command sudo ./VBoxLinuxAdditions.run in the OP's question, or does it enable it to work? And will this work for me on Ubuntu 15.10 on VirtualBox 5.0.0 r101573 on Windows 8.1? – Buttle Butkus Feb 12 '16 at 5:12
  • @ButtleButkus, yes. Though, the recommended way is to install VB additions with the .run file. But if for any odd reason this fails, try the package specified in the Answer. – NickTux Feb 13 '16 at 20:12
14

I received the dreaded "The headers for the current running kernel were not found" even though "Complete Generic Linux Kernel and Headers" were installed (Ubuntu 12.10 running under VirtualBox on a Windows Server 2003/Q6600). So I checked out this page...

For clarity's sake, the precise command for you copy-pasters out there (which would include me, hence I found out that a little clarification was in order) is:

sudo apt-get install build-essential linux-headers-`uname -r` dkms

Which further implies under "Devices" first turn "Shared Clipboard" on to "Bi-Directional" (for ease of use)

Then open a terminal window (click on the top "Dash" button, type "terminal" in the search box, click on the terminal icon to open same)

Then copy/paste the above sudo apt-get command in the terminal window by right-clicking in the terminal window

Then enter your root/admin password when prompted

Then Devices/Install Guest Addition via VirtualBox

And, extraneous to the above sequence but still on the subject of Guest Additions, the latest/greatest can always be downloaded/mounted as a CD from

http://download.virtualbox.org/virtualbox/

Additional info for Ubuntu 12.10 as I subsequently found out I had to

  1. apt-get purge xserver-xorg-video-vmware

  2. reinstall guest additions from the 4.6.2 .iso (available from above URL)

  3. add "vboxvideo" in /etc/modules (I

    sudo gedit /etc/modules
    

    but could

    sudo bash -c 'echo vboxvideo >> /etc/modules' 
    

    )

  4. stop the virtual machine

  5. Settings/Display/Enable 3D acceleration

to get better performance. Now I get:

Not software rendered:    yes
Not blacklisted:          yes
GLX fbconfig:             yes
GLX texture from pixmap:  yes
GL npot or rect textures: yes
GL vertex program:        yes
GL fragment program:      yes
GL vertex buffer object:  yes
GL framebuffer object:    yes
GL version is 1.4+:       yes

as well as some not-so-pleasing OpenGL warnings related to the mesa table from the command

/usr/lib/nux/unity_support_test -p
6
  1. Start a terminal and type:

    sudo apt-get install build-essential linux-headers-`uname -r` dkms
    
  2. Then reinstall VirtualBox Guest Addition from Devices → Install Guest Addition.

Tested in Windows 7 as host with VirtualBox 2.2.4

4

Upgrading to Virtualbox version 4.2.4 using Synaptic Package Manager (Dash Home did not show the new version in the Ubuntu repositories) I still needed to get kernel headers to avoid the 'missing kernel headers' error message and build the guest additions.

sudo apt-get install build-essential kernel-headers-`uname -r`

Note: That is a BACKTIC uname -r NOT a single apostrophe 'uname -r' (On my keyboard the backtic is just to the Left of the number 1).

  • 1
    This gives me an error E: Unable to locate package kernel-header-3.5.0.21-generic. – dibs Dec 20 '12 at 20:19
2

Upgraded VirtualBox to the latest version, problem resolved. Guest Additions installation is OK now.

0

This is how you do it:

Step 1: Install the newest version of Virtual Box. This is crucial guys. Whatever version you have, just uninstall it and then install the latest.

Step 2: Click Devices -> Insert Guest Additions CD image from the menu of the VM window

Step 3: Open a terminal and then

sudo apt-get install linux-headers-$(uname -r) dkms

Step 4: Go to the folder

/media/osboxes/VBOXADDITIONS_5.1.6_110634/ 

or wherever your VBoxLinuxAdditions.run script is.

Step 5: Run the VBoxLinuxAdditions.run script typing the following in the terminal ./VBoxLinuxAdditions.run

Step 6: Close the Virtual Box then re-open it. It will adjust the window size just the way you want it.

protected by David Foerster Mar 11 '18 at 21:51

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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