Bug 925663

Summary: please add virtualbox guest/host kernel module source package
Product: [openSUSE] openSUSE Tumbleweed Reporter: Marvin FourtyTwo <marvin24>
Component: Virtualization:OtherAssignee: Tomáš Chvátal <tchvatal>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: astieger, bwiedemann, chcao, mmarek, mseben, tchvatal, zypp-maintainers
Version: 201503*   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 935900    
Bug Blocks:    

Description Marvin FourtyTwo 2015-04-02 11:01:54 UTC
openSUSE does not provide a virtualbox guest/host kernel module source package. If the user compiled his own kernel, running /etc/init.d/vboxdrv setup will return an error saying that you should use the distro supplied packages, which are not available for self compiled kernels. An easy method to recompiling the kernel modules would be appreciated.
Comment 1 Bernhard Wiedemann 2015-04-02 12:40:19 UTC
I guess, having the kmp packages compiled for your custom kernel would be one way
but it is slow as those sources are mixed with the VirtualBox package.

DKMS would be the possibly nicer alternative.
Currently it is only packaged in X11:Bumblebee and not Factory
Comment 2 Marvin FourtyTwo 2015-04-02 12:44:13 UTC
... and Packman. Yes, using dkms would be nice and also mentioned on the vb homepage.
Comment 3 Tomáš Chvátal 2015-04-02 14:39:18 UTC
Honestly DKMS is nice but not something we wan't to have in the Factory. It is prone for funny issues down the road so we should never officialy promote/support it.
Comment 4 Takashi Iwai 2015-04-10 10:36:42 UTC
Not a problem of kernel itself.  Maybe Tomas can manage this bug better...
Comment 5 Tomáš Chvátal 2015-04-13 09:45:19 UTC
I would say that we can't do this better, the DKMS would not get to Factory.

Best solution for your problem is to download the SRC pkg, and rpmbuild it yourself on the system you deploy.

The extra modules are not supported in other packages either so it would need the rework of how we do the kernel pkging otherwise.

I am closing the bug as WONTFIX but it is more of CANTFIX as I can't figure out some cleaner way than to use the src-package as per above.
Comment 6 Marvin FourtyTwo 2015-04-13 10:53:20 UTC
that's sad. I would expect such things to go to some dir under /usr/src, e.g. provide a virtualbox-host-kmp source package which just untars the module sources to /usr/src/modules/vbox.
Comment 7 Bernhard Wiedemann 2015-05-10 13:51:19 UTC
I found a simple solution:
https://build.opensuse.org/request/show/306204

These sources can be built for custom kernels using
cd /usr/src/kernel-modules/virtualbox ; make ; make install
Comment 8 Marvin FourtyTwo 2015-05-11 11:19:21 UTC
works fine for me - thanks! However, adding auto-compile support for it to "vboxdrv setup" would be even better ;-)
Comment 9 Andreas Stieger 2015-05-20 09:23:18 UTC
The proposed update for Virtualbox in openSUSE:Maintenance:3787 seems broken due to file conflicts.

$ rpm -q --provides virtualbox-host-kmp-desktop
multiversion(kernel)
[..]

/etc/zypp/zypp.conf:
multiversion = provides:multiversion(kernel)
multiversion.kernels = latest,latest-1,oldest,running

$ rpm -q kernel-desktop
kernel-desktop-3.16.7-21.1.x86_64

$ uname -r
3.16.7-21-desktop

$ rpm -qa "virtualbox*"
virtualbox-4.3.20-13.1.x86_64
virtualbox-qt-4.3.20-13.1.x86_64
virtualbox-host-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64
virtualbox-guest-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64

$ zypper lp
Loading repository data...
Reading installed packages...

Repository       | Name | Category    | Severity | Status | Summary                          
-----------------+------+-------------+----------+--------+----------------------------------
repo-update-test | 3787 | recommended | moderate | needed | Recommended update for VirtualBox

$ zypper list-updates
Loading repository data...
Reading installed packages...
S | Repository       | Name                         | Current Version        | Available Version      | Arch  
--+------------------+------------------------------+------------------------+------------------------+-------
v | repo-update-test | virtualbox-qt                | 4.3.20-13.1            | 4.3.28-16.1            | x86_64
v | repo-update-test | virtualbox-host-kmp-desktop  | 4.3.20_k3.16.7_21-13.1 | 4.3.28_k3.16.7_21-16.1 | x86_64
v | repo-update-test | virtualbox-guest-kmp-desktop | 4.3.20_k3.16.7_21-13.1 | 4.3.28_k3.16.7_21-16.1 | x86_64
v | repo-update-test | virtualbox                   | 4.3.20-13.1            | 4.3.28-16.1            | x86_64

$ zypper patch
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 2 NEW packages are going to be installed:
  virtualbox-guest-kmp-desktop-4.3.28_k3.16.7_21-16.1 virtualbox-host-kmp-desktop-4.3.28_k3.16.7_21-16.1 

The following NEW patch is going to be installed:
  3787 

The following 2 packages are going to be upgraded:
  virtualbox virtualbox-qt 

2 packages to upgrade, 2 new.
Overall download size: 0 B. Already cached: 16.8 MiB  After the operation, additional 1.2 MiB will be used.

In cache virtualbox-guest-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64.rpm                                                                               (1/4), 278.3 KiB (492.9 KiB unpacked)
In cache virtualbox-host-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64.rpm                                                                                (2/4), 311.0 KiB (632.5 KiB unpacked)
In cache virtualbox-4.3.28-16.1.x86_64.rpm                                                                                                            (3/4),  12.3 MiB ( 28.5 MiB unpacked)
In cache virtualbox-qt-4.3.28-16.1.x86_64.rpm                                                                                                         (4/4),   3.9 MiB ( 19.7 MiB unpacked)
Checking for file conflicts: .......................................................................................................................................................[error]
Detected 7 file conflicts:

File /lib/modules/3.16.7-21-desktop/updates/vboxdrv.ko
  from install of
     virtualbox-host-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-host-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File /lib/modules/3.16.7-21-desktop/updates/vboxguest.ko
  from install of
     virtualbox-guest-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-guest-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File /lib/modules/3.16.7-21-desktop/updates/vboxnetadp.ko
  from install of
     virtualbox-host-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-host-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File /lib/modules/3.16.7-21-desktop/updates/vboxnetflt.ko
  from install of
     virtualbox-host-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-host-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File /lib/modules/3.16.7-21-desktop/updates/vboxpci.ko
  from install of
     virtualbox-host-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-host-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File /lib/modules/3.16.7-21-desktop/updates/vboxsf.ko
  from install of
     virtualbox-guest-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-guest-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File /lib/modules/3.16.7-21-desktop/updates/vboxvideo.ko
  from install of
     virtualbox-guest-kmp-desktop-4.3.28_k3.16.7_21-16.1.x86_64(repo-update-test)
  conflicts with file from package
     virtualbox-guest-kmp-desktop-4.3.20_k3.16.7_21-13.1.x86_64(@System)

File conflicts happen when two packages attempt to install files with the same name but different contents. If you continue, conflicting files will be replaced losing the previous content.
Comment 10 Bernhard Wiedemann 2015-05-20 09:37:24 UTC
Would be nice, if zypper could uninstall the old version
in such a case.
Comment 11 Michael Andres 2015-05-20 10:48:08 UTC
You need to restart anyway, because file conflict check is done after transaction is solved and packages are already downloaded.

It's IMO more a packaging bug. If virtualbox- packages claim to be multiversion installable, they must be able to solve their file conflicts. If they can't they are not multiversion installable,
Comment 12 Bernhard Wiedemann 2015-05-20 15:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (925663) was mentioned in
https://build.opensuse.org/request/show/308131 13.1 / virtualbox
Comment 13 Swamp Workflow Management 2015-05-28 08:05:03 UTC
openSUSE-RU-2015:0956-1: An update that has two recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 925663,931461
CVE References: 
Sources used:
openSUSE 13.1 (src):    virtualbox-4.2.28-2.31.1
Comment 14 Andreas Stieger 2015-05-29 20:58:13 UTC
What do you think could be done about the file conflicts? It's odd because this is not the first update for this package on 13.2
Comment 15 Tomáš Chvátal 2015-06-02 10:45:09 UTC
(In reply to Andreas Stieger from comment #14)
> What do you think could be done about the file conflicts? It's odd because
> this is not the first update for this package on 13.2

I have no clue really, maybe we just didn't notice before?

As we use the generic suse kmp macro maybe we need to tweak it as it is not really multiversion installable?

@mmarek: could you please give some hints or suggest some pretty solution?
Comment 16 Bernhard Wiedemann 2015-06-02 13:02:03 UTC
I think, the conflict only occurs when you build different versions of a kmp
for the same kernel-version (3.16.7-21-desktop in this case).

So this will be working again, after the next kernel-update goes out
and we rebuild the kmp for it.

Not sure how to best solve it.
Comment 17 Tomáš Chvátal 2015-06-09 12:01:16 UTC
Michal showed me how is it done in nvidia packages.

I sent the package to devel project and will be picked by next TW update hopefully. I dunno if there is something possible to do for the Update channel now, but simple picking from Factory is okay.
Comment 18 Andreas Stieger 2015-06-09 12:12:37 UTC
(In reply to Tomáš Chvátal from comment #17)
> Michal showed me how is it done in nvidia packages.
> 
> I sent the package to devel project and will be picked by next TW update
> hopefully. I dunno if there is something possible to do for the Update
> channel now, but simple picking from Factory is okay.

For reference, this is in https://build.opensuse.org/request/show/311303
Comment 19 Andreas Stieger 2015-06-24 11:43:54 UTC
The resolution of the file conflict for the 13.2 update blocks release of security fixes for bug 935900 prior to a kernel update.
Comment 20 Andreas Stieger 2015-06-24 11:44:28 UTC
Required for 13.2 for bug 935900.
Comment 21 Tomáš Chvátal 2015-06-24 11:51:17 UTC
Ok, nothing to do here, i will just resubmit from develprj to 13.2 taking the fix with it.
Comment 22 Bernhard Wiedemann 2015-06-24 13:00:13 UTC
This is an autogenerated message for OBS integration:
This bug (925663) was mentioned in
https://build.opensuse.org/request/show/313551 13.1 / virtualbox
Comment 23 Bernhard Wiedemann 2015-06-24 14:00:11 UTC
This is an autogenerated message for OBS integration:
This bug (925663) was mentioned in
https://build.opensuse.org/request/show/313554 13.1 / virtualbox
Comment 24 Marvin FourtyTwo 2015-07-31 09:43:54 UTC
Would it possible to add a virtualbox-host-kmp provide to virtualbox-host-source? Othewise uninstalling an old kernel is impossible because virtualbox-host-kmp-<kernel-ver> depends on it. Here, purge-kernel often fails due to this problem.
Comment 25 Swamp Workflow Management 2015-08-18 08:09:25 UTC
openSUSE-SU-2015:1400-1: An update that solves two vulnerabilities and has one errata is now available.

Category: security (moderate)
Bug References: 925663,935900,938408
CVE References: CVE-2015-2594,CVE-2015-3456
Sources used:
openSUSE 13.2 (src):    virtualbox-4.3.30-17.1
openSUSE 13.1 (src):    virtualbox-4.2.32-2.35.1