Help installing VirtualBox

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Chaosleet
Posts: 3
Joined: 7. Mar 2009, 04:02

Help installing VirtualBox

Post by Chaosleet »

Hey. I am new to Ubuntu and I need a bit of help.

I installed VirtualBox through the Synaptic Package Manager using the instructions on the Downloads page of this site, and it installed fine, but I got this error when it tried to compile the kernal:

Code: Select all

VirtualBox will not start until this problem is fixed. Please consult /var/log/vbox-install.log to find out why the kernel module does not compile. Most probably the kernel sources were not found. Install them (the package name is probably linux-headers-<version> whereby <version> can be determined by 'uname -r') and execute

  /etc/init.d/vboxdrv setup

as root.
I ran uname -r and I got this:

Code: Select all

2.6.28.1-xxxx-std-ipv4-32
After doing some Googling, it seems that this isn't such a wide spread kernal and I am struggling to find it.

So here I am asking for help. I desperately need to get VirtualBox up and running ASAP, thank you.
jakebpg
Posts: 5
Joined: 6. Mar 2009, 04:30

Re: Help installing VirtualBox

Post by jakebpg »

You need to get the kernel source from the vender of the OS. Typically this is installed when and if you chose to install the development packages that are provided by the OS supplier.

So it is possible that you only need to install the development packages from the OS vender and then run the setup as described in the error message.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: Help installing VirtualBox

Post by TerryE »

The magic command you are looking for is sudo apt-get build-essential linux-headers-$(uname -r). The first of these is a collection of tools needed to rebuild device drivers and the kernel; you've probably got most of these already loaded but the system is clever enough only to load the extra bits.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Chaosleet
Posts: 3
Joined: 7. Mar 2009, 04:02

Re: Help installing VirtualBox

Post by Chaosleet »

Hi,

When I run this command: sudo apt-get build-essential linux-headers-$(uname -r) I get this:

Code: Select all

admin@ks359837:~$ sudo apt-get build-essential linux-headers-$(uname -r)
[sudo] password for admin: 
E: Invalid operation build-essential
And when I run this command: sudo apt-get install linux-headers-$(uname -r) I get this:

Code: Select all

admin@ks359837:~$ sudo apt-get linux-headers-$(uname -r)
E: Invalid operation linux-headers-2.6.28.1-xxxx-std-ipv4-32
admin@ks359837:~$ sudo apt-get install linux-headers-$(uname -r) 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Couldn't find package linux-headers-2.6.28.1-xxxx-std-ipv4-3
As I said I am a linux noob, but I think it means I'm usinga kernal that isn't very common.

Any help would be appreciated, cheers :)
Chaosleet
Posts: 3
Joined: 7. Mar 2009, 04:02

Re: Help installing VirtualBox

Post by Chaosleet »

Alright, I think I know what's happening.

The place I bought my dedicated server from (ovh.co.uk) use their own version of the kernel: 2.6.27.10-grs (OVH) and seen as it's a custom kernel I can't run the commands you gave me. I have looked over their site and I can't seem to find a download for their kernel (I think that's what I'm looking for) so I'm well and truly stuck now.
orlandopasionjr
Posts: 1
Joined: 1. Jun 2008, 15:33

Re: Help installing VirtualBox

Post by orlandopasionjr »

I already encountered this error. I just copy the code and run in terminal.
- - -
orlandopasionjr@orlandopasionjr:~$ sudo su
[sudo] password for orlandopasionjr:
root@orlandopasionjr:/home/orlandopasionjr# /etc/init.d/vboxdrv setup
* Stopping VirtualBox kernel module
* done.
* Removing old VirtualBox netflt kernel module
* done.
* Removing old VirtualBox kernel module
* done.
* Recompiling VirtualBox kernel module
* done.
* Starting VirtualBox kernel module
* done.
root@orlandopasionjr:/home/orlandopasionjr#

- - -
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: Help installing VirtualBox

Post by TerryE »

Sorry my bad Chaosleet, I forgot the install as the first argument in the apt-get command. With this, the build essential will work.

Did you check your /var/log/vbox-install.log and if so that did it say?

As to the kernel, 2.6.28.1-xxxx-std-ipv4-32 sounds like a vendor specific custom kernel to me. From your later post it sounds like an ovh.co.uk kernel. However surely OVM have a support site where they have a repository for OVM specific distros. Kernels to need to get updated due to security vulnerabilities and users do have a valid reason (e.g. loading VBox) where they want to add their own device drivers. The headers package might have a slightly different name. Type doing an apt-cache search 2.6.28.1 | grep head so see if there are any plausible hits. Also post a Q on the OVM support site.

@orlandopasionjr, your commands are just the same as doing a sudo /etc/init.d/vboxdrv setup which is what the package install tries anyway. This will only fail if some dependencies are missing.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jkonrad
Posts: 12
Joined: 6. Nov 2007, 07:45

Re: Help installing VirtualBox

Post by jkonrad »

I am having all of the same errors as previous users. I first tried to install virtualbox and got this log error:

Error! Your kernel source for kernel 2.6.27-11-generic cannot be found at
/lib/modules/2.6.27-11-generic/build or /lib/modules/2.6.27-11-generic/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Failed to install using DKMS, attempting to install without
Makefile:140: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.


I then tried;
sudo apt-get install build-essential dkms
sudo /etc/init.d/vboxdrv setup

Still received the same error. So I tried this;
sudo apt-get install build-essential linux-headers-$(uname -r)

After a confirmation that build-essential is already the newest version, I received this error:

Package linux-headers-2.6.27-11-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package linux-headers-2.6.27-11-generic has no installation candidate


I'm not sure what else to try. I had a perfectly good working virtualbox on ubuntu 8.10. I then did an update to 9.04. Now I can not get virtualbox working. I'm trying and trying to install from the channel or the downloaded .deb package. I just can't get this to work. Any help?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Help installing VirtualBox

Post by Sasquatch »

Install linux-headers-generic. That is the Ubuntu meta package which will always depend on the latest kernel headers available. Something else I've seen here a lot is people with faulty or missing entries in their sources.list. Since the package linux-headers-2.6.27-11-generic should be installable on a default system, it seems you're missing an entry in your sources.list file. You can find it in /etc/apt.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
jkonrad
Posts: 12
Joined: 6. Nov 2007, 07:45

Re: Help installing VirtualBox

Post by jkonrad »

Thanks for the help. I found the solution to my problem. Likely specific to me.

When I upgraded from 8.10 to 9.04 my GRUB menu was not updated properly. So it was booting to the 2.6.27.11 kernel, but had the 2.6.28.11-generic kernel and was actually setup for that. So I deleted the grub menu with rm menu.lst. Then recreated it with sudo update-grub. Then rebooted, and chose the option to use the 2.6.28-11-generic kernel, and I was able to install Virtualbox.

So, specific to me. Sorry, but thanks so much for the help!

Jon
Amaiatxu
Posts: 3
Joined: 27. May 2009, 10:26
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: linux 2.6

Re: Help installing VirtualBox

Post by Amaiatxu »

Hi Jon!

I don't know if you will read this message or not, but anyway.
I think I've got exactly the same problem as you, and I'm about to do what you say you did, but I'm very new in Linux and I'm afraid of doing something wrong.. Is there any recommendation you can give me? Or just by following the steps you say I'll have everything solved?

Thanks

Amaia
Post Reply