Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to Fix Virtual Box Errors After Kernal Updates

  1. #1
    Join Date
    Jul 2006
    Location
    South Africa
    Beans
    155
    Distro
    Ubuntu 13.10 Saucy Salamander

    Exclamation How to Fix Virtual Box Errors After Kernal Updates

    Since I upgraded to 13.04 we have had 3 kernal updates (I think).
    After each update, vbox refused to run the client OS because the headers no longer matched. I read somewhere that DKMS would automatically sort things out if it is installed. AFAIK I have installed it but each update I have to spend an hour or so combing through the forums till I find the following magic-three-command fix which has worked every time.
    Code:
    sudo apt-get install linux-headers-$(uname -r)
    sudo apt-get remove virtualbox-dkms
    sudo apt-get install virtualbox-dkms
    I found these in this thread: http://ubuntuforums.org/showthread.p...kernel+modules

    I don't know what these commands are doing or why they work but work they do.
    Please can someone explain them for us?

    I think the update runs as a superuser and should be able to take care of such things. So, it would also be good to know why they can't be automated.

    As explained later in this thread, the above code should be modified to the following, after which things should happen automagically:
    Code:
    sudo apt-get install linux-headers-generic
    sudo apt-get install --reinstall virtualbox-dkms
    Spceial thanks go to TheFu, Jim Kyle and SeijiSensei for their help!
    Last edited by gwm; September 2nd, 2013 at 05:57 PM.
    gwm

  2. #2
    Join Date
    Oct 2011
    Beans
    5

    Re: How to Fix Virtual Box Errors After Kernal Updates

    Same with me.
    Very annoying, feels like Windows-box.
    Why does the update undo our installs, over and over?

  3. #3
    Join Date
    Jul 2006
    Location
    South Africa
    Beans
    155
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How to Fix Virtual Box Errors After Kernal Updates

    When I take time out to think about it, it is actually quite impressive that so little is required.
    If things still work the way they did 1000 years ago in the days of steam engines, when I was coding this sort of thing, a change in headers might well move entry points in the kernel's jump tables (if it uses such things) and calls to subroutines might require changed parameters. These things can result in code jumping into the middle of code blocks with serious stack issues and system crashes.

    So why does vbox need to be so close to the kernel? I can't vouch for it but I am assuming it is. Performance issues would dictate close coupling of this sort.

    My gripe is that to find out what to do, one has to go googling and stuff. I'm not so sure it would be too difficult for the error detection routine that detected the header mismatch in the first place to be programmed to execute the fix automatically.

    Wow! I can't believe it was me that said that! It looks like I too am becoming a dumbed down "app" consumer.
    Last edited by gwm; August 21st, 2013 at 08:50 PM.
    gwm

  4. #4
    Join Date
    Sep 2007
    Location
    Oklahoma, USA
    Beans
    2,254
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to Fix Virtual Box Errors After Kernal Updates

    The problem doesn't exist under 12.04 LTS, so it has to be something introduced in the later version. To answer your original question about what the three magic commands do:

    1. First command installs the header package for the currently running kernel. Once it's in place, it should update automagically when the kernel itself does. Check with "synaptic" (or apt-get if you prefer that) to verify that the "generic" header package is installed on your system. That's the package that automates header updating as you request.

    2 and 3. These commands first remove, then reinstall, the DKMS package. They ought not be necessary since it doesn't change greatly from one kernel version to the next, but they do assure that any potential corruption in DKMS itself is gone before you re-try creating the drivers.

    General point: All virtualization programs have to snuggle down very intimately with the kernel itself, in order to steer input and output away from the host system and feed it over to the guest via the virtualizer itself. That's what these modules do, for vbox. Because of this, things such as unexpected loss of power can create real havoc if a VM is running at the time. I just went through two weeks of serious troubleshooting because of exactly such an event. The VM was destroyed. The host system went crazy. Finally, after updates including a new kernel AND a new video driver came through, the host regained its sanity. If you run VMs, be sure to keep your host system totally backed up, so that such a disaster can have an easy recovery!
    --
    Jim Kyle in Oklahoma, USA
    Linux Counter #259718
    Howto mark thread: https://wiki.ubuntu.com/UnansweredPo.../SolvedThreads

  5. #5
    Join Date
    Jul 2006
    Location
    South Africa
    Beans
    155
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How to Fix Virtual Box Errors After Kernal Updates

    Thanks Jim,
    I seem to be missing something here. Perhaps you and I are on different pages or something.

    1. First command installs the header package for the currently running kernel. Once it's in place, it should update automagically when the kernel itself does.
    Since I execute the first command each time, doesn't that mean that the header is then installed? Yet the automagic isn't happening??

    Check with "synaptic" (or apt-get if you prefer that) to verify that the "generic" header package is installed on your system. That's the package that automates header updating as you request.
    Long ago, I used command lines and line editors all day, every day. Then the GUI came along and I hardly ever use the command line anylonger. I therefore don't know how to do this.

    I take it that the key concept there was that the package must be the generic one (whatever that means). Is that the point I have missed?
    Last edited by gwm; August 31st, 2013 at 06:25 PM.
    gwm

  6. #6
    Join Date
    Sep 2007
    Location
    Oklahoma, USA
    Beans
    2,254
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to Fix Virtual Box Errors After Kernal Updates

    I think your conclusion is correct. I too use the GUI most of the time; your best friend in the GUI is the Synaptic package. It can show you what is installed, and what isn't, much more easily than anything else I've tried.

    The "deb" package concept attempts (and usually succeeds) in avoiding the "DDL Hell" situation experienced so often elsewhere, by including a list of dependencies in each package. Most of the package manager programs read this list, and automagically download any listed dependencies that aren't already present, right along with the desired package, so that you have all you need before anything begins to actually install.

    The "generic" packages that are listed for kernel images and kermel headers do not actually have ANY executable code in them. Instead, they list the most recent specific package as a dependency, so that the automagic downloading will grab the right package from the repository. Once you have the generic package installed, it will be updated each time the real package to which it refers gets an update, so that "installing" it will grab the correct version for you.

    There's no need to install the current version via that first command more than once, either. If your kernel model then fails to build, it's probably something entirely different causing it. The dkms package (dynamic kernel module system) requires that the build-essential package be installed, to give it the tools with which it works, and it's possible you might not have this. Again, Synaptic can show you whether you do or not.

    Hope this helps! Back in the 90s I was one of the most vocal opponents of the GUI, and even chaired a panel discussion at Software Development '90 titled "GUI? Phooey!" which was loaded against the GUI approach -- but over the years I've learned its value, and use it much more than the command line (which, however, continues to be my go-to tool when things get really serious).
    --
    Jim Kyle in Oklahoma, USA
    Linux Counter #259718
    Howto mark thread: https://wiki.ubuntu.com/UnansweredPo.../SolvedThreads

  7. #7
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,033
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: How to Fix Virtual Box Errors After Kernal Updates

    All these problems would be resolved by using the official VirtualBox release, adding the repository to /etc/apt/sources.list, and installing the Oracle key. If you have not read https://www.virtualbox.org/wiki/Linux_Downloads, I suggest you take a look at the section on "Debian-based" downloads.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  8. #8
    Join Date
    Sep 2007
    Location
    Oklahoma, USA
    Beans
    2,254
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to Fix Virtual Box Errors After Kernal Updates

    Quote Originally Posted by SeijiSensei View Post
    All these problems would be resolved by using the official VirtualBox release, adding the repository to /etc/apt/sources.list, and installing the Oracle key. If you have not read https://www.virtualbox.org/wiki/Linux_Downloads, I suggest you take a look at the section on "Debian-based" downloads.
    I strongly disagree with the statement that I've emphasized; adding the vbox PPA to sources.lst will assure that the OP gets timely updates to vbox, and it's something that every vbox user needs to do, but it won't assure that he also gets needed updates to the kernel headers, or to anything else that needs DKMS to stay current (such as Nvidia vidro drivers).

    The Oracle packages have never included kernel modules that match the *buntu kernels, in the six years that I've been using them. DKMS always includes a line in the log to that effect.
    --
    Jim Kyle in Oklahoma, USA
    Linux Counter #259718
    Howto mark thread: https://wiki.ubuntu.com/UnansweredPo.../SolvedThreads

  9. #9
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,033
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: How to Fix Virtual Box Errors After Kernal Updates

    I guess I never noticed that since I almost always have the kernel headers, build-essential, and the dkms package installed. Intriguingly they are listed as "recommended" by the Oracle VB package rather than being a strict dependency.

    Code:
    $ dpkg -s virtualbox-4.2
    Package: virtualbox-4.2
    Status: install ok installed
    Priority: optional
    Section: contrib/misc
    Installed-Size: 135720
    Maintainer: Oracle Corporation <info@virtualbox.org>
    Architecture: amd64
    Version: 4.2.16-86992~Ubuntu~raring
    Replaces: virtualbox
    Provides: virtualbox
    Depends: libc6 (>= 2.15), libcurl3 (>= 7.16.2), libdevmapper1.02.1 (>= 2:1.02.20), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libpng12-0 (>= 1.2.13-4), libpython2.7 (>= 2.7), libqt4-network (>= 4:4.5.3), libqt4-opengl (>= 4:4.7.2), libqtcore4 (>= 4:4.8.0), libqtgui4 (>= 4:4.8.0), libsdl1.2debian (>= 1.2.11), libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.6), libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxinerama1, libxml2 (>= 2.7.4), libxmu6, libxt6, zlib1g (>= 1:1.1.4), psmisc, adduser
    Pre-Depends: debconf (>= 1.1) | debconf-2.0
    Recommends: libasound2, libpulse0, libsdl-ttf2.0-0, dkms, linux-headers, gcc, make, binutils, pdf-viewer, libgl1, python-central
    Conflicts: virtualbox, virtualbox-guest-additions-iso, virtualbox-ose
    Conffiles:
     /etc/init.d/vboxdrv 2b0d27a8b51dae83b8ac7dc30de531d7
     /etc/init.d/vboxautostart-service 13913287468da586ef47e7c9cae4161d
     /etc/init.d/vboxweb-service 7d3ec328e82e986c612678736730e899
     /etc/init.d/vboxballoonctrl-service fbb712caf488eb8860c4fc20301e7075
    Description: Oracle VM VirtualBox
     VirtualBox is a powerful PC virtualization solution allowing you to run a
     wide range of PC operating systems on your Linux system. This includes
     Windows, Linux, FreeBSD, DOS, OpenBSD and others. VirtualBox comes with a broad
     feature set and excellent performance, making it the premier virtualization
     software solution on the market.
    Python-Version: >= 2.4
    Last edited by SeijiSensei; August 31st, 2013 at 07:51 PM.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Sep 2007
    Location
    Oklahoma, USA
    Beans
    2,254
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to Fix Virtual Box Errors After Kernal Updates

    Mine reads about the same:
    Code:
    jk@mehitabel:~$ dpkg -s virtualbox-4.2
    Package: virtualbox-4.2
    Status: install ok installed
    Priority: optional
    Section: contrib/misc
    Installed-Size: 136546
    Maintainer: Oracle Corporation <info@virtualbox.org>
    Architecture: i386
    Version: 4.2.16-86992~Ubuntu~precise
    Replaces: virtualbox
    Provides: virtualbox
    Depends: libc6 (>= 2.15), libcurl3 (>= 7.16.2-1), libdevmapper1.02.1 (>= 2:1.02.20), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libpng12-0 (>= 1.2.13-4), libpython2.7 (>= 2.7), libqt4-network (>= 4:4.5.3), libqt4-opengl (>= 4:4.7.2), libqtcore4 (>= 4:4.8.0), libqtgui4 (>= 4:4.8.0), libsdl1.2debian (>= 1.2.10-1), libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.6), libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxinerama1, libxml2 (>= 2.7.4), libxmu6, libxt6, zlib1g (>= 1:1.1.4), psmisc, adduser
    Pre-Depends: debconf (>= 1.1) | debconf-2.0
    Recommends: libasound2, libpulse0, libsdl-ttf2.0-0, dkms, linux-headers, gcc, make, binutils, pdf-viewer, libgl1, python-central
    Conflicts: virtualbox, virtualbox-guest-additions-iso, virtualbox-ose
    Conffiles:
     /etc/init.d/vboxdrv 2b0d27a8b51dae83b8ac7dc30de531d7
     /etc/init.d/vboxautostart-service 13913287468da586ef47e7c9cae4161d
     /etc/init.d/vboxweb-service 7d3ec328e82e986c612678736730e899
     /etc/init.d/vboxballoonctrl-service fbb712caf488eb8860c4fc20301e7075
    Description: Oracle VM VirtualBox
     VirtualBox is a powerful PC virtualization solution allowing you to run a
     wide range of PC operating systems on your Linux system. This includes
     Windows, Linux, FreeBSD, DOS, OpenBSD and others. VirtualBox comes with a broad
     feature set and excellent performance, making it the premier virtualization
     software solution on the market.
    Python-Version: >= 2.4
    jk@mehitabel:~$
    I never noticed the "recommends" entries; I installed build-essential a long time ago and of course that put all the compiler tools in place so they would not show up in the update notices.

    I suspect our listings of the package may help the OP grok the way deb files handle dependency issues. Hope so, anyway.

    gwm: You can configure the Update Manager not to show "recommends" packages, which are not absolutely required in every case, but it's best to let them show up because sometimes they are essential. Note, too, that the package name isn't always exactly what you might expect it to be. The command "dpkg -l" (lower-case L) at the command line will give you a list of all packages installed on your system.
    --
    Jim Kyle in Oklahoma, USA
    Linux Counter #259718
    Howto mark thread: https://wiki.ubuntu.com/UnansweredPo.../SolvedThreads

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •