Errors installing VirtualBox 5.1? This might help.

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
nanners

Errors installing VirtualBox 5.1? This might help.

Post by nanners »

This post is for xenial-based users, specifically Mint 18 and 18.1 Serena. It will work for any xenial users (most of us) and can work for non-xenial if you make the appropriate changes!

Lately I've been seeing a lot of posts regarding VirtualBox errors, errors upgrading to 5.1, and the DKMS modules errors that can happen. VirtualBox 5.1 no longer uses dkms modules, which is why I think going outside the official repo is a good idea in this instance. I'm not any kind of expert or pro. I have only been using Linux for a year or so. But I use VirtualBox on an almost-daily basis and have installed it a dozen times in both Mint and other Ubuntu flavors. I also stayed in a Holiday Inn Express last night. That and I just wanted to make a handy post that explains the situation for new VirtualBox users here in this forum who want the latest version of this awesome program. The official Oracle VirtualBox site (https://www.virtualbox.org/wiki/VirtualBox) can be confusing and the Download page really fails to mention or emphasize the importance of dkms and Mint.

First off, I'm going to suggest NOT downloading anything related to VirtualBox with the Mint Software Center. It's a helpful and friendly place for users, but it (intentionally) lacks advanced information on packages or the ability to see and select dependencies or individual parts of a package. I recommend using Synaptic, which is already installed with Mint and is the official Debian GUI tool for APT management and installation. It's listed in your main Mint Menu by default.

Next, start up Synaptic and search for "Virtualbox" with the ALL filter (normal search). It's going to show you the current VirtualBox packages in the repo. You will either have them or not, and that makes the next part very important: if you have it installed already and actually use it, do not touch anything yet. Go back and back up anything you want to keep in VirtualBox, like your virtual HDDs containing all your machine data. Otherwise they will be wiped out when we uninstall this older repo version. The backup procedure for that is beyond what I'm doing here, but if you already use VirtualBox then you know where your VM data is, where the VDI or other virtual drive stuff is kept, and should be able to make backups of it and store them somewhere safe for now (hint: you may also want to backup your preferences if you made major changes there, but it's not hard to redo that). Now, back to Synaptic's window. Even if you have never installed VirtualBox before you will have two packages listed there as installed. Those are "virtualbox-guest-utils" and "virtualbox-guest-x11". Don't touch them. I don't know why Mint installs these particular packages by default, but they are both run during start up and are important. Why? Because anything done by Mint is important, but it's beyond the scope of this little "guide" post. Then, if you have made your backups (or didn't need to do that), you are now going to remove VirtualBox. Marking the metapackage "virtualbox" for removal should then select all the other packages for removal (hint: the virtualbox package should be listed on top in Synaptic. It will also say it's a metapackage in the description box, but if you didn't know that already, this guide might not be right for you). You especially want to make sure virtualbox-dkms gets removed here!

Ok, VirtualBox is now gone. I would advise rebooting here because making DKMS changes would necessitate that unless you know the manual method of restarting DKMS/DKMS modules. That's beyond my scope, but it's not hard if you want to Google it and learn how. We won't need dkms in 5.1, but just be cautious. So, back to Mint after reboot. We no longer have VirtualBox installed (other than the two Mint packages I mentioned earlier). Next, open up a browser and go to:

https://www.virtualbox.org/wiki/Linux_Downloads.

This is the basic guide and main source for what I'm explaining here. Next we're going to add the Oracle PPA. Note: this guide explains exactly what I'm putting in this post, but it really fails to mention the importance of dkms and the difference between VirtualBox 5.0 (our repo version) and 5.1 (the version we're about to get).

Now we need to add that Oracle PPA, so here are the instructions, edited for Mint 18/18.1 and xenial-based users (note that everything I'm saying here is for xenial and Mint 18/18.1 - if you aren't using Mint based on xenial Ubuntu, it needs changed):

Step 1: Add the following line to /etc/apt/sources.list two spaces below the pre-existing line which should be a commented-out item. If there is no line, just put it at the top. (hint: gksudo xed /etc/apt/sources.list)

deb http://download.virtualbox.org/virtualbox/debian xenial contrib

It's very important to add that source line exactly as shown without changes. The Oracle public key for apt-secure can be downloaded here separately if you want to do it manually: https://www.virtualbox.org/download/ora ... x_2016.asc

Step 2: These two commands will download and auto-add the Oracle key:

Code: Select all

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
The key fingerprint for oracle_vbox_2016.asc is

B9F8 D658 297A F3EF C18D 5CDF A2F6 83C5 2980 AECF

Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>

And the key fingerprint for oracle_vbox.asc is

7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139
Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>


Step 3: run sudo apt update and the VirtualBox PPA should now be ready for us to download the latest version.

The final step is to actually install VirtualBox 5.1! That is done with this command: sudo apt install VirtualBox-5.1

It will install and there should not be any errors as long as you removed the dkms package earlier and followed this quick guide. VirtualBox 5.1+ eliminates the use of DKMS altogether! See the full list of changes from 5.0 to 5.1 here: https://www.virtualbox.org/wiki/Changelog

This worked for me in Mint 18 and 18.1 Serena, which is the current version as of Jan. 2017 and based on Ubuntu "xenial" (16.04). I cannot say with certainty if these steps will work on other versions of Mint, but as long as it's "xenial" it should be fine. If not, you would obviously need to change the line in your apt sources.list (hint: if that is the case, your current release is shown in that list, in the commented-out CDROM line). If I missed anything here, please let me know! If this still fails and still produces errors, make sure you've not changed your kernel in between adding/removing/updating VirtualBox 5.0 and lower. Kernel changes require you to recompile your DKMS modules each time! That's beyond the scope of this, but as long as you are using VirtualBox 5.1+ you should not need to worry about dkms.

Anything else? Just ask. I'm sure I missed something. If I screwed up any commands above, let me know ASAP and it'll get fixed!

PS: After a clean 5.1 install it'd be a good idea to read the Wiki page on using the Guest Additions ISO in each guest system: https://www.virtualbox.org/manual/ch04.html#idm1784
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Prsman
Level 4
Level 4
Posts: 398
Joined: Tue Nov 17, 2015 3:15 pm

Re: Errors installing VirtualBox 5.1? This might help.

Post by Prsman »

Ok I'm confused. I dont have virtualbox installed now. But, Synaptic shows I have virtualbox-guest-dkms, guest-utils and guest-x11. Do I need these?
Do I remove them? Selecting virtualbox only allows me to mark for install which I dont want, right? Virtualbox dkms is not installed. Am I good to go?
Thanks
nanners

Re: Errors installing VirtualBox 5.1? This might help.

Post by nanners »

Prsman wrote:Ok I'm confused. I dont have virtualbox installed now. But, Synaptic shows I have virtualbox-guest-dkms, guest-utils and guest-x11. Do I need these?
Do I remove them? Selecting virtualbox only allows me to mark for install which I dont want, right? Virtualbox dkms is not installed. Am I good to go?
Thanks
That's strange that you have "virtualbox-guest-dkms" installed in addition to the other two. Those other two (virtualbox-guest-utils and guest-x11) are both installed by Mint automatically and, whatever their reason for doing it, should and can be left alone without errors. However, virtualbox-guest-dkms is a different animal and AFAIK only would come with a previous install of VirtualBox from the repo. You do not need it if you are going to install VirtualBox 5.1 as I described. It is not even a depedency in 5.1 and has no further use to you unless you go back down to an older version. I would remove "virtualbox-guest-dkms", it'll be removed from each kernel installed, and should not pop up going forward.
Habitual

Re: Errors installing VirtualBox 5.1? This might help.

Post by Habitual »

17.1 Rebecca for comparison...

Code: Select all

dpkg -l | grep -e dkms -e virtualbox
...
ii  dkms                                        2.2.0.3-1.1ubuntu5.14.04.9                          all          Dynamic Kernel Module Support Framework
rc  virtualbox                                  4.3.18-dfsg-1~ubuntu1~trusty1                       amd64        x86 virtualization solution - base binaries
ii  virtualbox-5.1                              5.1.14-112924~Ubuntu~trusty                         amd64        Oracle VM VirtualBox
ii  virtualbox-guest-utils                      4.3.18-dfsg-1~ubuntu1~trusty1                       amd64        x86 virtualization solution - non-X11 guest utilities
ii  virtualbox-guest-x11                        4.3.18-dfsg-1~ubuntu1~trusty1                       amd64        x86 virtualization solution - X11 guest utilities
rc  virtualbox-qt                               4.3.18-dfsg-1~ubuntu1~trusty1                       amd64        x86 virtualization solution - Qt based user interface
...
sudo apt-get remove -y virtualbox-guest-utils virtualbox-guest-x11 virtualbox --purge
cleanman2
Level 1
Level 1
Posts: 22
Joined: Thu Jan 26, 2017 4:39 pm

Re: Errors installing VirtualBox 5.1? This might help.

Post by cleanman2 »

nanners, thanks for the info. I saw an update to vbox happen and wondered what was going on. I knew I had not installed it, so your post was very timely.

I see the same thing as Presman, ie I have virtualbox-guest-dkms installed, which apparently you did not. I wonder if it was the result of the update that Update Manager ran?

Thanks again, Jim
nanners

Re: Errors installing VirtualBox 5.1? This might help.

Post by nanners »

Very well could just be me. I had a fresh Mint install and ran through the steps and that one dkms module wasn't there for me, but I've done the whole fresh install/vbox install so many times now I could just be imagining things and losing my mind. If more people mention having it already I'll change it in the post or make an edit about it.
User avatar
Prsman
Level 4
Level 4
Posts: 398
Joined: Tue Nov 17, 2015 3:15 pm

Re: Errors installing VirtualBox 5.1? This might help.

Post by Prsman »

I just installed VB, (late I know) with the instructions posted above and from Easylinuxtips. No problems. Thanks Nanners and Pjotr.
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Post by 111MilesToGo »

+1 Thank you to nanners for starting this thread and Pjotr for relevant portions of the Easy Linux Tips Project.

I hope this thread will develop into the "ultimate" recipe for installing and maintaining the most recent VirtualBox 5.1.x on a Linux Mint (18.1) operating system. First off, I do agree with what cosmo posted in another thread: Using the most recent VirtualBox version is highly recommended, not the 5.0.x stuff that comes with Linux Mint. Second, the hint that VB 5.1 did away with the dkms stuff is maybe the most important thing to mention; this is seriously underrepresented in Oracle's website and guide.

Myself, I freshly installed VB 5.1.14 on a fresh Linux Mint 18.1 Cinnamon system sitting on a "playground" test SSD. Synaptic did in fact show the three items virtualbox-guest-dkms, virtualbox-guest-utils and virtualbox-guest-x11 to be installed by Mint right away. Comparing nanners' notes with Pjotr's at this point leaves me with one question:

nanners recommends to NOT touch the virtualbox-guest-utils and virtualbox-guest-x11, while Pjotr recommends removing ALL of the preinstalled packages. What's the best recipe, and why?

For my playground, I did follow nanners' post and left guest-utils and guest-x11 as they came with Mint, just removed the virtualbox-dkms with the help of Synaptic.

For installing VirtualBox 5.1.14, I did follow nanners' post - works like charm. Two actions should be appended to his post after installing the basic package: Download the VB Extension Pack from the web and load it into VirtualBox (via Preferences... in VB), and add yourself to the vboxusers group in LM.

It remains to be seen yet whether VirtualBox will update automatically now when Oracle releases a new minor (also major?) version, say from 5.1.14 to 5.1.15, usually once a month. The Mint Software Updater does have the Oracle web repository and Oracle keys in its database, fine. In my VirtualBox Preferences, I left the Update setting as it came, i.e. VB checking for stable updates once every day. I will see whether all components (main package, extension pack and also the guest additions which are run in my virtual machines [Windows 10 and XP]) will be updated. The questions I am left with is:

Will the Mint Software Updater do a proper job for the main VB package and the extension pack? What will the VB-internal check for updates actually do? Will these two mechanisms run into a conflict? Will the guest additions get updated automatically when running a virtual machine for the first time after a VB update?

I will keep you posted.


PS: One remark on Oracle's VirtualBox might be appropriate here - not hijacking this thread at all. It is well known that there are incredible problems with the audio from VB, at least when running a Windows (I have both 10 and XP) virtual machine. Any sound does crackle horribly... Oracle stated "an audio overhaul" is being worked on, but it's not released yet.
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Post by 111MilesToGo »

Just to complete this little guide regarding VirtualBox version updates, in this case a minor update from 5.14 to 5.16:

The Linux Mint Software Update Manager correctly finds an update for the main VirtualBox package, when the relevant repository is on its list (cf. above). The VirtualBox application itself when lauched informs the user about the availability of an update, if the update Preferences settings are set to check for updates. In order to fetch and install the update for the main VB package, it seems best to me to let the Mint Software Update Manager do its job.

When launched for the first time after this update, VirtualBox detects that it is still running an old extension pack and it offers to download and install the new version. Let it do its job.

When launching a virtual machine which utilizes the guest additions (in my case a Windows 10 VM), it detects that it has an old guest additions version. Simply ask VirtualBox via its "Devices" -> "Insert guest additions" menu item to run the appropriate installer for the new guest additions.

All set.

The next open question is what happens when one updates the Linux kernel, cf. the above explanation stating that the dkms stuff is obsolete since VB 5.1.
Habitual

Re: Errors installing VirtualBox 5.1? This might help.

Post by Habitual »

My USB sharing now works also, with these particulars:
Installed 4.4.0-66-generic yesterday and Vbox 5.1.16

Just sayin'
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Post by 111MilesToGo »

Just another update on the VirtualBox stuff.

Linux Mint 18.1 Cinnamon, VirtualBox 5.1.16 incl. extension pack: I updated the Linux kernel from 4.4.0-53-generic to 4.4.0-66-generic. No failures observed up to now.

Linux Mint 18.1 KDE: On this freshly installed system with kernel 4.4.0.53-generic, I installed VirtualBox 5.1.16 and its extension pack from scratch. The same procedure as outlined above did work fine. VirtualBox is running my Windows 10 virtual machine in the same fine way as the Cinnamon system. As expected - just sayin'...
111MilesToGo
Level 2
Level 2
Posts: 90
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Post by 111MilesToGo »

Just a note on comparing VirtualBox under LM 18.1 Cinnamon versus KDE: When displaying the virtual machine in full-screen mode, moving the mouse pointer to the bottom of the screen lets VB's menu bar show up in this place. With Cinnamon all is fine from there. With KDE, however, mouse clicks on the menu items don't give any reaction. Under KDE, I have to switch VB to normal window mode via Host-F to access the VB menu items.
User avatar
BG405
Level 8
Level 8
Posts: 2499
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Errors installing VirtualBox 5.1? This might help.

Post by BG405 »

I would like to add that LM17.x users wishing to update to a 4.4x kernel will need to move to VirtualBox 5.1 as the 5.0 version in the Trusty repos will not work with this series!
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
mike acker
Level 7
Level 7
Posts: 1517
Joined: Wed Jul 31, 2013 6:29 pm
Location: Kalamazoo, MI

Re: Errors installing VirtualBox 5.1? mass confusion

Post by mike acker »

so,..... evidently we need to dump V-Box 5.0 completely,--

the first step then would be to fire up our 5.0 systems and do an EXPORT for each of our guest machines
also archive any data directories as needed

next: remove V-Box 5.0

??


Next: install V-Box 5.1

do we use the V-Box 5.1 update that downloaded that won't update ?

I'm totally confused here

Fallback:

re-install last V-Box 5.0 update and restore exported guest

Sounds to me like "5.1" isn't an update at all -- actually should be "6.0" -- New version -- remove and replace for v5
¡Viva la Resistencia!
User avatar
BG405
Level 8
Level 8
Posts: 2499
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Errors installing VirtualBox 5.1? This might help.

Post by BG405 »

I added deb http://download.virtualbox.org/virtualbox/debian trusty contrib to the Additional Repositories list and am being offered updates to VB5.1 - obviously this is for Mint 17.x so will be different for LM18.x. Installed the latest update a few days ago. I didn't bother backing up the virtual machines and they work fine with the new version. :)
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
jgold
Level 1
Level 1
Posts: 41
Joined: Mon Jan 23, 2017 1:05 pm

Re: Errors installing VirtualBox 5.1? This might help.

Post by jgold »

Excellent guide. Well done! Thank you very much for taking the time to do it. It really helped.
dynamikspeed

Re: Errors installing VirtualBox 5.1? This might help.

Post by dynamikspeed »

Thanks nanners,
I just installed 18.1 x64 clean and your instructions worked perfectly.
mr_raider
Level 7
Level 7
Posts: 1897
Joined: Sun Jun 20, 2010 9:50 am
Location: Montreal, QC

Re: Errors installing VirtualBox 5.1? This might help.

Post by mr_raider »

My understanding is that virtualbox-guest-dkms and virtualbox-guest-x11 are the packages to be installed in a guest system to give video driver functionality. They are useless to the host. As a matter of fact, when you boot mint in verbose mode, you see a message saying that your not in a virtual machine so the module gets unloaded.

For some reason default mint installs come with these packages pre installed. Ubuntu does not. I always remove them.
Image
MintBean

Re: Errors installing VirtualBox 5.1? This might help.

Post by MintBean »

Thanks for this, nanners. I can confirm this how-to works just fine on Mint 18.2 also.
timleehenderson

Re: Errors installing VirtualBox 5.1? This might help.

Post by timleehenderson »

I cannot thank you enough for posting this!

As a new user, the instructions on the VirtualBox download site were very confusing... not to mention HOW to add a line to the "Source-List" what ever that is (don't judge you were new once too).
I have a Bible study program that I have a lot of money invested in and will only run in windows, but have to have VirtualBox 5.1 to get my windows 10 to work.

AGAIN, thank you for explaining this in a 'for dummies' version!!!
Locked

Return to “Virtual Machines”