Unable to start virtualbox vm


**:~ #** uname -a                        
Linux localhost.localdomain 5.3.18-lp152.60-default #1 SMP Tue Jan 12 23:10:31 UTC 2021 (9898712) x86_64 x86_64 x86_64 GNU/Linux
**:~ #**

Installed virtualbox from openSUSE repo, added extensions from Oracle and attempted to start VM, error message reminded me to run /sbin/vboxconfig



**:~ #** /sbin/vboxconfig                
Sources for building host modules are not present,
Use 'sudo zypper install virtualbox-host-source kernel-devel kernel-default-devel' to install them. Quitting ..


**:~ #** zypper install virtualbox-host-source kernel-devel kernel-default-devel
Loading repository data...
Reading installed packages...
'kernel-devel' is already installed.
No update candidate for 'kernel-devel-5.3.18-lp152.63.1.noarch'. The highest available version is already installed.
'kernel-default-devel' is already installed.
No update candidate for 'kernel-default-devel-5.3.18-lp152.63.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...

The following NEW package is going to be installed:
  virtualbox-host-source

1 new package to install.
Overall download size: 897.9 KiB. Already cached: 0 B. After the operation, additional 5.1 MiB will be used.
**Continue? [y/n/v/...? shows all options] (y): **
Retrieving package virtualbox-host-source-6.1.18-lp152.2.11.1.noarch                                                                                                                                                                                          (1/1), 897.9 KiB (  5.1 MiB unpacked)
Retrieving: virtualbox-host-source-6.1.18-lp152.2.11.1.noarch.rpm ..............................................................................................................................................................................................................[done (86.5 KiB/s)]

Checking for file conflicts: ................................................................................................................................................................................................................................................................[done]
(1/1) Installing: virtualbox-host-source-6.1.18-lp152.2.11.1.noarch .........................................................................................................................................................................................................................[done]


**:~ #** /sbin/vboxconfig
Building kernel modules...

Build of VirtualBox host kernel modules failed.
Look at /var/log/virtualbox.log to find reasons.
**:~ #**

=== Building ‘vboxdrv’ module ===make[1]: Entering directory ‘/usr/src/kernel-modules/virtualbox/src/vboxdrv’
/usr/src/kernel-modules/virtualbox/src/vboxdrv/Makefile-header.gmk:193: *** Error: unable to find the headers of the Linux kernel to build against (KERN_DIR=/lib/modules/5.3.18-lp152.60-default/build). Specify KERN_VER= (currently 5.3.18-lp152.60-default) and run Make again. Stop.
make[1]: Leaving directory ‘/usr/src/kernel-modules/virtualbox/src/vboxdrv’
make: *** [Makefile:59: vboxdrv] Error 2

**:~ #** zypper se -si virtualbox kernel
Loading repository data...
Reading installed packages...

S  | Name                   | Type    | Version                              | Arch   | Repository
---+------------------------+---------+--------------------------------------+--------+-----------------------
i+ | kernel-default         | package | 5.3.18-lp152.60.1                    | x86_64 | Main Update Repository
i+ | kernel-default         | package | 5.3.18-lp152.57.1                    | x86_64 | Main Update Repository
i+ | kernel-default-devel   | package | 5.3.18-lp152.63.1                    | x86_64 | Main Update Repository
i+ | kernel-devel           | package | 5.3.18-lp152.63.1                    | noarch | Main Update Repository
i  | kernel-firmware        | package | 20200107-lp152.2.3.1                 | noarch | Main Update Repository
i  | kernel-macros          | package | 5.3.18-lp152.63.1                    | noarch | Main Update Repository
i  | purge-kernels-service  | package | 0-lp152.4.1                          | noarch | openSUSE-Leap-15.2-1
i  | purge-kernels-service  | package | 0-lp152.4.1                          | noarch | Main Repository
i+ | virtualbox             | package | 6.1.18-lp152.2.11.1                  | x86_64 | Main Update Repository
i+ | virtualbox-guest-tools | package | 6.1.18-lp152.2.11.1                  | x86_64 | Main Update Repository
i+ | virtualbox-host-source | package | 6.1.18-lp152.2.11.1                  | noarch | Main Update Repository
i  | virtualbox-kmp-default | package | 6.1.18_k5.3.18_lp152.60-lp152.2.11.1 | x86_64 | Main Update Repository
i  | virtualbox-qt          | package | 6.1.18-lp152.2.11.1                  | x86_64 | Main Update Repository

Unable to find a fix in the forum I followed the suggestion to uninstall Virtualbox from openSUSE repo and install from Oracle

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing

'/sbin/vboxconfig'

as root.

If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT. 


**:~ #** /sbin/vboxconfig
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /usr/lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /usr/lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /usr/lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /usr/lib/systemd/system/vboxweb-service.service.
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-default-devel kernel-default-devel-5.3.18-lp152.60
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-default-devel kernel-default-devel-5.3.18-lp152.60

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.


**:~ #** zypper se -si virtualbox kernel
Loading repository data...
Reading installed packages...

S  | Name                  | Type    | Version                     | Arch   | Repository
---+-----------------------+---------+-----------------------------+--------+-----------------------
i+ | VirtualBox-6.1        | package | 6.1.18_142142_openSUSE150-1 | x86_64 | Downloads
i+ | kernel-default        | package | 5.3.18-lp152.60.1           | x86_64 | Main Update Repository
i+ | kernel-default        | package | 5.3.18-lp152.57.1           | x86_64 | Main Update Repository
i+ | kernel-default-devel  | package | 5.3.18-lp152.63.1           | x86_64 | Main Update Repository
i+ | kernel-devel          | package | 5.3.18-lp152.63.1           | noarch | Main Update Repository
i  | kernel-firmware       | package | 20200107-lp152.2.3.1        | noarch | Main Update Repository
i  | kernel-macros         | package | 5.3.18-lp152.63.1           | noarch | Main Update Repository
i  | purge-kernels-service | package | 0-lp152.4.1                 | noarch | openSUSE-Leap-15.2-1
i  | purge-kernels-service | package | 0-lp152.4.1                 | noarch | Main Repository

I should have mentioned that this PC previously had functioning virtualbox. This was a fresh install of 15.2 with the existing /home retained.

I have not installed any virtualbox-src or so.
Only virtualbox, virtualbox-qt and virtualbox-kmp-default.

Maybe you should

zypper up

to get the last kernel-default matching to your kernel-devel, kernel-defaut-devel and so on.

i+ | kernel-default | package | 5.3.18-lp152.60.1 | x86_64 | Main Update Repository
i+ | kernel-default | package | 5.3.18-lp152.57.1 | x86_64 | Main Update Repository
i+ | kernel-default-devel | package | 5.3.18-lp152.63.1 | x86_64 | Main Update Repository
i+ | kernel-devel | package | 5.3.18-lp152.63.1 | noarch | Main Update Repository

You have to restart you Computer.

Here on Leap 15.2 – VirtualBox is running «Windows 10 in a VM» …


 # zypper search --installed-only virtualbox kernel
Loading repository data...
Reading installed packages...

S  | Name                   | Summary                                                           | Type
---+------------------------+-------------------------------------------------------------------+--------
i+ | kernel-default         | The Standard Kernel                                               | package
i  | kernel-default-devel   | Development files necessary for building kernel modules           | package
i  | kernel-devel           | Development files needed for building kernel modules              | package
i+ | kernel-docs            | Kernel Documentation                                              | package
i+ | kernel-firmware        | Linux kernel firmware files                                       | package
i  | kernel-macros          | RPM macros for building Kernel Module Packages                    | package
i+ | kernel-source          | The Linux Kernel Sources                                          | package
i  | nfs-kernel-server      | Support Utilities for Kernel nfsd                                 | package
i  | purge-kernels-service  | The service for removing old kernels when multiversion is enabled | package
i+ | virtualbox             | VirtualBox is an Emulator                                         | package
i+ | virtualbox-kmp-default | Kernel modules for VirtualBox                                     | package
i+ | virtualbox-qt          | Qt GUI part for virtualbox                                        | package
i  | virtualbox-websrv      | WebService GUI part for virtualbox                                | package
 # zypper info virtualbox
Loading repository data...
Reading installed packages...


Information for package virtualbox:
-----------------------------------
Repository     : Hauptaktualisierungs-Repository
Name           : virtualbox
Version        : 6.1.18-lp152.2.11.1
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 84.6 MiB
Installed      : Yes
Status         : up-to-date
Source package : virtualbox-6.1.18-lp152.2.11.1.src
Summary        : VirtualBox is an Emulator
Description    : 
    VirtualBox is a hosted hypervisor for x86 computers. It supports the
    creation and management of guest virtual machines running versions
    and derivations of Windows, Linux, BSD, OS/2, Solaris, Haiku, OSx86
    and others, and limited virtualization of macOS guests on Apple
    hardware. VirtualBox is freely available as Open Source Software under
    the terms of the GNU Public License (GPL).

 # 

When you import an existing VirtualBox VM into VirtualBox, the Oracle VirtualBox manual doesn’t explain an explicit procedure but, the secret is in the “Storage Settings” –<https://www.virtualbox.org/manual/ch03.html#settings-storage>
<https://www.virtualbox.org/manual/>


:~ # zypper search --installed-only virtualbox kernel
Loading repository data...
Reading installed packages...


S  | Name                   | Summary                                                           | Type
---+------------------------+-------------------------------------------------------------------+--------
i+ | kernel-default         | The Standard Kernel                                               | package
i+ | kernel-default-devel   | Development files necessary for building kernel modules           | package
i+ | kernel-devel           | Development files needed for building kernel modules              | package
i  | kernel-firmware        | Linux kernel firmware files                                       | package
i  | kernel-macros          | RPM macros for building Kernel Module Packages                    | package
i  | purge-kernels-service  | The service for removing old kernels when multiversion is enabled | package
i+ | virtualbox             | VirtualBox is an Emulator                                         | package
i+ | virtualbox-guest-tools | VirtualBox guest tools                                            | package
i+ | virtualbox-host-source | Source files for virtualbox host kernel modules                   | package
i  | virtualbox-kmp-default | Kernel modules for VirtualBox                                     | package
i  | virtualbox-qt          | Qt GUI part for virtualbox                                        | package


:~ # zypper info virtualbox
Loading repository data...
Reading installed packages...




Information for package virtualbox:
-----------------------------------
Repository     : Main Update Repository
Name           : virtualbox
Version        : 6.1.18-lp152.2.11.1
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 84.6 MiB
Installed      : Yes
Status         : up-to-date
Source package : virtualbox-6.1.18-lp152.2.11.1.src
Summary        : VirtualBox is an Emulator
Description    :  
    VirtualBox is a hosted hypervisor for x86 computers. It supports the
    creation and management of guest virtual machines running versions
    and derivations of Windows, Linux, BSD, OS/2, Solaris, Haiku, OSx86
    and others, and limited virtualization of macOS guests on Apple
    hardware. VirtualBox is freely available as Open Source Software under
    the terms of the GNU Public License (GPL).
#

When you import an existing VirtualBox VM into VirtualBox, the Oracle VirtualBox manual doesn’t explain an explicit procedure but, the secret is in the “Storage Settings” –
<Chapter 3. Configuring Virtual Machines;
<https://www.virtualbox.org/manual/&gt;

Thanks for the link. Looks like my “storage Settings” are OK

@caprus:

There should be any need for the VirtualBox host source package – you shouldn’t need to be rebuilding VirtualBox for any reason …

  • Also, building VirtualBox from the source code is an art in it’s self …

[QUOTE=Sauerland;3004042
Maybe you should

zypper up

to get the last kernel-default matching to your kernel-devel, kernel-defaut-devel and so on…[/QUOTE]

I didn’t notice that. IIRC I actually created that mess deliberately, albeit accidentally, in the course of solving another issue with bluetooth. I’m going to proceed slowly and hold off on your suggestion until I can remember the details of that earlier issue. I want to make sure I don’t recreate that issue. The data files I will use in the VM are backed up elsewhere, so I might decide to switch to another PC for that project and defer fixing this Virtualbox 'til later

I have no intention of rebuilding. That’s way above my pay grade. I’m not even sure at what point that package “came along for the ride”

I use the Oracle Virtual Box on openSUSE LEAP-15.2 on an EFI system. I happen to have secure boot disabled. Also, I note I have more ‘kernel’ apps than you. My installed apps with “kernel” in the name:


oldcpu@oldcorei7:~> rpm -qa | grep kernel
kernel-macros-5.3.18-lp152.63.1.noarch
kernel-default-devel-5.3.18-lp152.63.1.x86_64
kernel-default-5.3.18-lp152.60.1.x86_64
kernel-preempt-devel-5.3.18-lp152.60.1.x86_64
purge-kernels-service-0-lp152.4.1.noarch
kernel-source-5.3.18-lp152.63.1.noarch
kernel-syms-5.3.18-lp152.63.1.x86_64
kernel-devel-5.3.18-lp152.60.1.noarch
kernel-syms-5.3.18-lp152.60.1.x86_64
kernel-default-5.3.18-lp152.63.1.x86_64
kernel-default-devel-5.3.18-lp152.60.1.x86_64
kernel-firmware-20200107-lp152.2.3.1.noarch
kernel-preempt-devel-5.3.18-lp152.63.1.x86_64
kernel-source-5.3.18-lp152.60.1.noarch
kernel-devel-5.3.18-lp152.63.1.noarch

Clearly ALL of those should not be required to build Oracle’s VirtualBox, but I suspect “kernel-syms” and “kernel-source” are requirements, which your system does not have. Try installing those two.

Just install the virtualbox package, all the others you included should be unnecessary and any dependencies would be brought in authomatically.
In particular, the development headers (any packages with devel in the name) are unnecessary, those are required only if you install virtualbox from the Oracle website.

Try this…
First update your system (always a desirable and even sometimes necessary thing to do when making major changes to your system, and any kind of virtualization is a major change)

zypper up

Then force re-install virtualbox. Force re-installing should over-write all existing files including configuration files (a regular re-install or remove and re-install retains configuration files)

zypper in -f virtualbox

If that doesn’t work,
Then in this Forum, at least twice in the past I described how to follow up an uninstall with searching for remaining virtualbox files to purge manually, then re-install.
Hopefully manual purging won’t be necessary, try the above steps first.
Only then, if you can’t locate those threads how to manually purge, post again and either I or someone else can search for you.

TSU