Errors installing VirtualBox 5.1? This might help.

Questions about virtualization software
Forum rules
Before you post please read how to get help
User avatar
nanners
Level 2
Level 2
Posts: 75
Joined: Wed Dec 28, 2016 3:22 am
Location: California

Errors installing VirtualBox 5.1? This might help.

Postby nanners » Thu Jan 19, 2017 6:24 pm

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/oracle_vbox_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 nanners on Thu Jan 26, 2017 3:56 pm, edited 3 times in total.
› Gaming on Linux? It's possible!
ImageImage

User avatar
Prsman
Level 3
Level 3
Posts: 196
Joined: Tue Nov 17, 2015 3:15 pm

Re: Errors installing VirtualBox 5.1? This might help.

Postby Prsman » Sun Jan 22, 2017 6:24 pm

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

User avatar
nanners
Level 2
Level 2
Posts: 75
Joined: Wed Dec 28, 2016 3:22 am
Location: California

Re: Errors installing VirtualBox 5.1? This might help.

Postby nanners » Mon Jan 23, 2017 7:04 pm

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.
› Gaming on Linux? It's possible!
ImageImage

Habitual
Level 13
Level 13
Posts: 4866
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Errors installing VirtualBox 5.1? This might help.

Postby Habitual » Thu Jan 26, 2017 2:14 pm

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: 3
Joined: Thu Jan 26, 2017 4:39 pm

Re: Errors installing VirtualBox 5.1? This might help.

Postby cleanman2 » Thu Jan 26, 2017 5:13 pm

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

User avatar
nanners
Level 2
Level 2
Posts: 75
Joined: Wed Dec 28, 2016 3:22 am
Location: California

Re: Errors installing VirtualBox 5.1? This might help.

Postby nanners » Fri Jan 27, 2017 1:23 am

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.
› Gaming on Linux? It's possible!
ImageImage

User avatar
Prsman
Level 3
Level 3
Posts: 196
Joined: Tue Nov 17, 2015 3:15 pm

Re: Errors installing VirtualBox 5.1? This might help.

Postby Prsman » Thu Feb 23, 2017 7:57 pm

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: 87
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Postby 111MilesToGo » Fri Feb 24, 2017 5:19 am

+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: 87
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Postby 111MilesToGo » Thu Mar 09, 2017 12:08 pm

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
Level 13
Level 13
Posts: 4866
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Errors installing VirtualBox 5.1? This might help.

Postby Habitual » Thu Mar 09, 2017 2:09 pm

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: 87
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Postby 111MilesToGo » Fri Mar 10, 2017 10:17 am

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: 87
Joined: Fri Oct 14, 2016 5:43 am

Re: Errors installing VirtualBox 5.1? This might help.

Postby 111MilesToGo » Mon Mar 13, 2017 8:08 am

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 5
Level 5
Posts: 860
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Errors installing VirtualBox 5.1? This might help.

Postby BG405 » Wed Mar 22, 2017 2:36 pm

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-------------------Acer D255E 2GB - LM17.3 KDE 32
Toshiba NB305 - LM17.3 Xfce 32--------------------K7S5A Athlon 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 -----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

User avatar
mike acker
Level 6
Level 6
Posts: 1289
Joined: Wed Jul 31, 2013 6:29 pm
Location: Kalamazoo, MI

Re: Errors installing VirtualBox 5.1? mass confusion

Postby mike acker » Sun Mar 26, 2017 5:35 pm

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
My Computer: IBM 360/50 c. 1975
¡Viva la Resistencia!

User avatar
BG405
Level 5
Level 5
Posts: 860
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Errors installing VirtualBox 5.1? This might help.

Postby BG405 » Tue Mar 28, 2017 2:02 pm

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-------------------Acer D255E 2GB - LM17.3 KDE 32
Toshiba NB305 - LM17.3 Xfce 32--------------------K7S5A Athlon 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 -----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

jgold
Level 1
Level 1
Posts: 34
Joined: Mon Jan 23, 2017 1:05 pm

Re: Errors installing VirtualBox 5.1? This might help.

Postby jgold » Sun May 07, 2017 6:52 pm

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

User avatar
dynamikspeed
Level 2
Level 2
Posts: 69
Joined: Sun May 07, 2017 7:59 pm
Location: UK

Re: Errors installing VirtualBox 5.1? This might help.

Postby dynamikspeed » Tue May 09, 2017 1:23 pm

Thanks nanners,
I just installed 18.1 x64 clean and your instructions worked perfectly.
Asus UX305FA Laptop, Mint 18.2 x64 Cinnamon. Solo Boot in 10s

mr_raider
Level 6
Level 6
Posts: 1282
Joined: Sun Jun 20, 2010 9:50 am
Location: Montreal, QC

Re: Errors installing VirtualBox 5.1? This might help.

Postby mr_raider » Mon Jun 05, 2017 10:11 pm

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

User avatar
MintBean
Level 9
Level 9
Posts: 2545
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: Errors installing VirtualBox 5.1? This might help.

Postby MintBean » Thu Jul 13, 2017 7:13 pm

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

timleehenderson
Level 1
Level 1
Posts: 2
Joined: Wed Jul 26, 2017 5:53 pm

Re: Errors installing VirtualBox 5.1? This might help.

Postby timleehenderson » Wed Jul 26, 2017 5:58 pm

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!!!


Return to “Virtualization”