VirtualBox no longer updating on Ubuntu 20.04 LTS

Discussions related to using VirtualBox on Linux hosts.
Post Reply
robhep
Posts: 6
Joined: 26. Dec 2021, 01:49

VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by robhep »

Hi all,
First, I've been using basic Virtualbox for several years and usually don't have any issues. Thanks for all the great work over the years!
I run VBox on 2 systems. One continues to get regular updates via apt, while the other does not. I think what happened was for the 6.1.28 update, I had shutdown all guest VMs, but forgot to close the Virutalbox application and it was still running when the upgrade ran. It was probably minimized. After that upgrade attempt guest VMs would not start. I don't recall what i did to get it working, but I'll post some bash history that should help.

Can you help me to get this server to update normally via apt again?
--------------------------------------------------------------
robert@virtual-host:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
Kernel Version: 5.11.0-43-generic

The system's sources.list file does contain this entry:
robert@virtual-host:~$ grep virtual /etc/apt/sources.list
-------------------------------------------------------------------------
deb [arch=amd64] <vb_url_removed_for_post>/virtualbox/debian focal contrib
# deb-src [arch=amd64] <ub_url_removed_for_post>/virtualbox/debian focal contrib

I guess I removed and reinstall the ext pack and dkms to get it working again. Currently it is runs 6.1.26 but as mentioned does not seem to get updated version via apt.
History of how I got it to work after the failed upgrade
-------------------------------------------------------------------------
1756 sudo apt install virtualbox-ext-pack
1757 sudo apt remove virtualbox-ext-pack
1758 sudo apt install virtualbox-ext-pack
1777 sudo apt-get install --only-upgrade virtualbox-dkms
1779 sudo apt-cache search virtualbox-dkms
1781 sudo apt-get install --only-upgrade virtualbox-dkms
1782 sudo apt remove virtualbox-dkms
1783 sudo apt remove virtualbox-ext-pack
1784 sudo apt remove virtualbox-dkms
1785 sudo apt install virtualbox-dkms
1786 sudo apt install virtualbox-ext-pack
1894 sudo apt-get upgrade virtualbox
1895 sudo apt-get upgrade virtualbox-6.1
1896 sudo apt-mark auto virtualbox
1897 sudo apt-get upgrade virtualbox
1900 sudo apt-get install virtualbox
1901 sudo apt-get install virtualbox-dkms
1902 sudo apt-mark auto virtualbox
1903 sudo apt-get install virtualbox
1904 sudo apt search "virtualbox-"
1906 sudo apt-get install virtualbox
1907 sudo apt-get install virtualbox-dkms
1908 sudo apt-get upgrade virtualbox

Trying to update via apt:
----------------------------------
robert@virtual-host:~$ sudo apt-get update
[sudo] password for robert:
Hit:2 <vb_url_removed_for_post>/virtualbox/debian focal InRelease
...
robert@virtual-host:~$ sudo apt-get --only-upgrade install virtualbox
Reading package lists... Done
Building dependency tree
Reading state information... Done
virtualbox is already the newest version (6.1.26-dfsg-3~ubuntu1.20.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Thanks for any help or suggestions!
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by scottgus1 »

robhep wrote:One continues to get regular updates via apt, while the other does not.
First, Virtualbox does not need to be updated every new version unless a bug fix or feature requires it. "If it ain't broke don't fix it." :D

Also, if 'apt' is pulling from the Linux OS repository, then you're updating via the Linux OS fork. (You can check this by opening a VM's log and look at the first line: if the version number is suffixed with "_linuxflavor", such as "_Ubuntu", then you're using the fork.) We don't handle the forks here. You'll have to ask the Linux fork maintainers. We support official Virtualbox from https://www.virtualbox.org/wiki/Linux_Downloads

All in all, there's not much about actually running Virtualbox in this problem. The best thing to do would be to web-search how to clear a bunged program install on you host OS, since this could have happened to any program when Apt tries to update it while it's running.
robhep
Posts: 6
Joined: 26. Dec 2021, 01:49

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by robhep »

Thanks for the reply. I agree with all your points. It is still working great and an update is not really necessary other than to keep apps up to date.
I will confirm the version and think it's forked as you indicated. I did run across one post that mentioned the possibility that the package got set to manual instead of auto in Apt. I did try it's solution, but it didn't work in my case. I will continue with the Apt focus going forward.
I could try a manual update from the Virtualbox download site, but I'd still have the same problem afterwards most likely.
I'm also realizing 22.04 LTS is not that far off now and maybe an OS reinstall would be a not so painful why to fix it. I'd have to import all my existing VMs I believe. Would be a small price to pay for my own mistake of not closing the application before upgrading it.

Thanks again for the reply.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by scottgus1 »

robhep wrote:maybe an OS reinstall would be a not so painful why to fix it. I'd have to import all my existing VMs
If you plan to stick with Virtualbox as the hypervisor for the VMs, then you can skip export/import and simply copy the VM folders (and any disk files residing outside the folders) to other backup media, then copy them back after the OS install. In fact, if the OS install does not include partition changes or disk formatting, the VMs should be just fine where they are. Though a good restorable backup is always wise. Then use the new Virtualbox's Machine menu Add command to register each VM's .vbox file.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by fth0 »

FWIW, your command history indicates that you have a mixture of the Oracle and Ubuntu versions of VirtualBox installed. The Oracle provided package is named virtualbox-6.1, all other packages belong to the Ubuntu provided VirtualBox. I'd suggest to remove all VirtualBox related packages and install only one of those versions.
robhep
Posts: 6
Joined: 26. Dec 2021, 01:49

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by robhep »

Thanks for the additional replies. I do have all the VMs folders/files on a second disk, so I'm thinking of trying the suggestion to uninstall VB and reinstall it hopefully to the latest version. Then use the add command to add them to the new/updated application.

Thinking sudo apt-get purge virtualbox-* might be able to remove everything. Seems like the packages are:

virtualbox-6.1
virtualbox-ext-pack
virtualbox-dkms

Well, maybe that wouldn't necessarily be a good idea. These are the installed packages according to apt. Any further suggestions on how/what to remove? It looks kind of messy.

robert@virtual-host:~$ sudo apt list | grep virtualbox
[sudo] password for robert:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

boinc-virtualbox/focal 7.16.6+dfsg-1 amd64
unity-scope-virtualbox/focal,focal 0.1+13.10.20130723-0ubuntu2 all
virtualbox-6.0/unknown 6.0.24-139119~Ubuntu~eoan amd64
virtualbox-6.1/unknown 6.1.30-148432~Ubuntu~eoan amd64 [residual-config] <--- This is interesting
virtualbox-dkms/focal-updates,now 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 [installed]
virtualbox-ext-pack/focal-updates,focal-updates,now 6.1.26-2~ubuntu1.20.04.1 all [installed]
virtualbox-guest-additions-iso/focal-updates,focal-updates 6.1.26-1~ubuntu1.20.04.1 all
virtualbox-guest-dkms-hwe/focal-updates,focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 all
virtualbox-guest-dkms/focal-updates,focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 all
virtualbox-guest-source-hwe/focal-updates,focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 all
virtualbox-guest-source/focal-updates,focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 all
virtualbox-guest-utils-hwe/focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64
virtualbox-guest-utils/focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64
virtualbox-guest-x11-hwe/focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64
virtualbox-guest-x11/focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64
virtualbox-qt/focal-updates,now 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 [installed,automatic]
virtualbox-source/focal-updates 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64
virtualbox/focal-updates,now 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 [installed]

Actually, maybe this is a better view of what's installed. Interesting it says 6.1.28 for virtualbox-6.1, looks like that the Oracle package. But the UI says 6.1.26 (matching the ext-pack) maybe that's the Ubuntu package the other person mentioned.

robert@virtual-host:~$ sudo dpkg --list | grep virtualbox
ii virtualbox 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 x86 virtualization solution - base binaries
rc virtualbox-6.1 6.1.28-147628~Ubuntu~eoan amd64 Oracle VM VirtualBox
ii virtualbox-dkms 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 x86 virtualization solution - kernel module sources for dkms
ii virtualbox-ext-pack 6.1.26-2~ubuntu1.20.04.1 all extra capabilities for VirtualBox, downloader.
ii virtualbox-qt 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 x86 virtualization solution - Qt based user interface

Anyone have a better suggestion than doing a sudo apt remove/purge virtualbox-* ??
Maybe it would be wiser to just remove virtualbox virtualbox-6.1 virtualbox-dkms virtualbox-ex-pack ?
robhep
Posts: 6
Joined: 26. Dec 2021, 01:49

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by robhep »

**Update**
I decided to run a test on my secondary system, the one that had successfully updated to 6.1.30.

I removed purged these packages
sudo apt remove virtualbox virtualbox-6.1 virtualbox-ext-pack virtualbox-qt
sudo apt purge virtualbox virtualbox-qt virtualbox-6.1 virtualbox-ext-pack

Then installed, apparently multiple blogs identify if virtualbox only is listed that will use the Ubuntu repo, if virtualbox-6.1 then the Oracle repo will be used. So I ran this
sudo apt-get install virtualbox-6.1 virtualbox-ext-pack virtualbox-dkms and ended up with this. It installed the Oracle application but the ubuntu version (which are different) ext-pack and dkms

robert@Ubuntu:~$ sudo dpkg --list | grep virtualbox
[sudo] password for robert:
ii virtualbox-6.1 6.1.30-148432~Ubuntu~eoan amd64 Oracle VM VirtualBox
ii virtualbox-dkms 6.1.26-dfsg-3~ubuntu1.20.04.2 amd64 x86 virtualization solution - kernel module sources for dkms
iF virtualbox-ext-pack 6.1.26-2~ubuntu1.20.04.1 all extra capabilities for VirtualBox, downloader.

So I purged the dkms and ext-pack packages again. And then double checked the blogs which said for the Oracle extension pack to download it from the web site. I did this and easily installed it via the UI.

I guess the real resolution here is to understand how to stick with one repo or the other. It appears as though the Ubuntu repo is behind as it is offering 6.1.26.

Final question. From some years ago, I thought I had seen that virtualbox-dkms needed to be installed also. I guess it's not needed for a Windows guest VM as the ext-pack should take care of the drivers needed. Maybe it was when I was trying to install the guest additions on RedHat distros and for the guest additions to run properly/completely it needed the virtualbox-dkms package. Can anyone remind me or clarify if/why I would need or not need to use the virtualbox-dkms package. And if I do, would it be correct that that package will most likely come from the Ubuntu repo and it would be advisable to use the Ubuntu repo instead of the Oracle repo?

Greatly appreciate any feedback.
robhep
Posts: 6
Joined: 26. Dec 2021, 01:49

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by robhep »

I did a little more research. I think this blog nails the ubuntu vs. oracle repo issue and is probably something I should have found earlier. I probably started using VBox on Ubuntu 12.04 or 14.04 and I did run across the lag when a new Ubuntu version was released. I wanted an updated version of VBox on the new Ubuntu release, but it wasn't ready yet, so I would install the Oracle version. Then Ubuntu would start to catch up on versions, but I never realized what was actually happening.

https://www.linuxuprising.com/2019/12/h ... ories.html

So I guess right now, 6.1.26 is the latest version in the Ubuntu repos and is easily updated along with the ext-pack and dkms package with a regular apt upgrade, it would be good to stick with that realizing that it will always be behind the Virtualbox website version. Since Ubuntu's updates now include updating the kernels and in the 2 years I've been running 20.04, the kernel has gone from 5.4, to 5.8, now on 5.11, soon to be on 5.15 (I think). Where as the RPM based distro's usually stick to a single main version, like 3.10.x for RHEL 7 and 4.18.x for RHEL 8.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by fth0 »

robhep wrote: guess the real resolution here is to understand how to stick with one repo or the other.
Yes, and this holds true on the host and in the guests: During their respective installations, VirtualBox builds kernel modules on the host, and the VirtualBox Guest Additions (GA) build kernel modules in the guest. If you install the GA from the Linux distribution's repository, you'll need the virtualbox-dkms package (if it exists). If you install the GA from Oracle, which are provided by the Oracle VirtualBox host-side installation, you only need the prerequisites from the build-essential package (gcc, make, ...) and the Linux kernel headers.

Edit (replacement for the strikethrough part above):
On Ubuntu hosts, the Ubuntu-provided virtualbox package needs the virtualbox-dkms package to build the VirtualBox host-side kernel modules. In Ubuntu guests, the Ubuntu-provided virtualbox-guest-additions-iso package needs the virtualbox-guest-dkms package to build the VirtualBox guest-side kernel modules.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by scottgus1 »

I'll just toss in one little tidbit, after fth0's comments above.

This forum only technically supports official Virtualbox from https://www.virtualbox.org/wiki/Linux_Downloads, not the forks of Virtualbox from Linux distros. You might have to switch to official Virtualbox, if the problem being posted about calls into question whether the fork is acting differently than Official.
robhep
Posts: 6
Joined: 26. Dec 2021, 01:49

Re: VirtualBox no longer updating on Ubuntu 20.04 LTS

Post by robhep »

Roger that.

Thanks to both of you. Much appreciated.
Post Reply