VirtualBox

Opened 4 years ago

Closed 4 years ago

#19724 closed defect (fixed)

Cannot install on OpenSUSE Leap 15.2 (fixed in SVN)

Reported by: bLuE Owned by: Frank Batschulat (Oracle)
Component: host support Version: VirtualBox 6.1.10
Keywords: opensuse 15.2 5.3 5.4 Cc:
Guest type: all Host type: Linux

Description

Hello,

When installing version 6.1.12, the install process fails. I get this error: # /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. vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.

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.

I also attach the log file to this bug report.

Here are some details from my system: OS: OpenSUSE Leap 15.2 Kernel: 5.3.18-lp152.20.7-default (x86_64) VirtualBox Version: 6.1.12

Please let me know if you need any more details. I can also do some testing if needed ;)

Cheers, bLuE

Attachments (2)

vbox-setup.log.gz (2.3 KB ) - added by bLuE 4 years ago.
vbox-setup log file
opensuse152fix.diff.txt (1.6 KB ) - added by Frank Batschulat (Oracle) 4 years ago.

Download all attachments as: .zip

Change History (21)

by bLuE, 4 years ago

Attachment: vbox-setup.log.gz added

vbox-setup log file

comment:1 by Frank Batschulat (Oracle), 4 years ago

the error during compiling the VBoxNetFlt is causing the failure, from the log file:

Building the main VirtualBox module.
Building the net filter module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.3.18-lp152.20.7-default/build M=/tmp/vbox.0 SRCROOT=/tmp/vb
ox.0 -j8 modules
....
/tmp/vbox.0/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltLinuxSkBufToSG’:
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:931:36: error: ‘skb_frag_t {aka struct bio_vec}’ has no member named ‘size’
         pSG->aSegs[iSeg].cb = pFrag->size;
                                    ^~
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:932:66: error: ‘skb_frag_t {aka struct bio_vec}’ has no member named ‘page_offset’; did you
 mean ‘bv_offset’?
         pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
                                                                  ^~~~~~~~~~~
                                                                  bv_offset
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:952:40: error: ‘skb_frag_t {aka struct bio_vec}’ has no member named ‘size’
             pSG->aSegs[iSeg].cb = pFrag->size;
                                        ^~
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:953:70: error: ‘skb_frag_t {aka struct bio_vec}’ has no member named ‘page_offset’; did you
 mean ‘bv_offset’?
             pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
                                                                      ^~~~~~~~~~~
                                                                      bv_offset
make[3]: *** [/usr/src/linux-5.3.18-lp152.20.7/scripts/Makefile.build:281: /tmp/vbox.0/linux/VBoxNetFlt-linux.o] Error 1
make[2]: *** [/usr/src/linux-5.3.18-lp152.20.7/Makefile:1644: _module_/tmp/vbox.0] Error 2
make[1]: *** [../../../linux-5.3.18-lp152.20.7/Makefile:179: sub-make] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:117: vboxnetflt] Error 2

presumably something was backported to linux-5.3.18-lp152.20.7 on OpenSuse 15.2 that wasn't in the 5.3 tree before.

comment:2 by Frank Batschulat (Oracle), 4 years ago

yes, pretty sure they backported something from Linux kernel version 5.4 to this 5.3 OpenSuse kernel, because if we look at the function complained about we find this guards making a difference between 5.4 and below:

trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
...
 850 static void vboxNetFltLinuxSkBufToSG(PVBOXNETFLTINS pThis, struct sk_buff *pBuf, PINTNETSG pSG,
...
 927 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
 928         pSG->aSegs[iSeg].cb = pFrag->bv_len;
 929         pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
 930 # else /* < KERNEL_VERSION(5, 4, 0) */
 931         pSG->aSegs[iSeg].cb = pFrag->size;
 932         pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
 933 # endif /* >= KERNEL_VERSION(5, 4, 0) */
 934         Log6((" %p", pSG->aSegs[iSeg].pv));
 935         pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS;
 936         Assert(iSeg <= pSG->cSegsAlloc);
 937     }

the 5.4 stuff was introduced to support the 5.4 kernel version with ticket #18945

That change in Linux was: PATCH v3 0/7 Convert skb_frag_t to bio_vec https://www.spinics.net/lists/netdev/msg585545.html

So the OpenSuse folks decided to backport this from 5.4 to their 5.3 kernel of OpenSuse 15.2

comment:3 by Frank Batschulat (Oracle), 4 years ago

Owner: set to Frank Batschulat (Oracle)
Status: newaccepted

comment:4 by Frank Batschulat (Oracle), 4 years ago

Component: installerhost support
Keywords: opensuse 15.2 5.3 5.4 added
Version: VirtualBox 6.1.10

comment:5 by Frank Batschulat (Oracle), 4 years ago

so I checked the upstream 5.3.18 kernel sources and they are still the same:

https://elixir.bootlin.com/linux/v5.3.18/source/include/linux/skbuff.h#L311

typedef struct skb_frag_struct skb_frag_t;

struct skb_frag_struct {
	struct {
		struct page *p;
	} page;
#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
	__u32 page_offset;
	__u32 size;
#else
	__u16 page_offset;
	__u16 size;
#endif
};

while on the 5.4 kernel branch is has become:
https://elixir.bootlin.com/linux/v5.4/source/include/linux/skbuff.h#L319

typedef struct bio_vec skb_frag_t;

which indeed then has:
https://elixir.bootlin.com/linux/v5.4/source/include/linux/bvec.h#L18

struct bio_vec {
	struct page	*bv_page;
	unsigned int	bv_len;
	unsigned int	bv_offset;
};

ie. somewhere in the OpenSuse specific version of 5.3.18, 5.3.18-lp152.20.7-default that must have been backported from the 5.4 kernel branch.

Last edited 4 years ago by Frank Batschulat (Oracle) (previous) (diff)

comment:6 by bLuE, 4 years ago

Hello,

Upon going though your comments, here is a bit more information it may help. I've looked at the 5.3.18-lp152.19.2 src.rpm (not the lp152.20.7), which should have these changes too.

grep -A 4 'struct bio_vec {' include/linux/bvec.h

struct bio_vec {

struct page *bv_page; unsigned int bv_len; unsigned int bv_offset;

};

There's also a changelog on spec file with the following (stripped): Wed Oct 16 18:51:52 CEST 2019 - <strippped>@suse.de ...

  • net: Convert skb_frag_t to bio_vec (jsc#SLE-7979 jsc#SLE-7981).

...

I could also find a reference on a patch for it on the same src.rpm: ... patches.suse/net-Convert-skb_frag_t-to-bio_vec.patch ...

So, apparently OpenSUSE did backport that particular change.

Cheers, bLuE

in reply to:  6 comment:7 by Frank Batschulat (Oracle), 4 years ago

Replying to bLuE:

Upon going though your comments, here is a bit more information it may help. I've looked at the 5.3.18-lp152.19.2 src.rpm (not the lp152.20.7), which should have these changes too.

Thanks for this detective work, this confirmation and detail is much appreciated.

comment:8 by Frank Batschulat (Oracle), 4 years ago

we find the backport in the SLES archive:

https://lists.opensuse.org/opensuse-factory/2019-11/msg00065.html

==== kernel-kvmsmall ====
Version update (5.3.1 -> 5.3.8)
.....
- net: Convert skb_frag_t to bio_vec (jsc#SLE-7979 jsc#SLE-7981).
net: Rename skb_frag_t size to bv_len (jsc#SLE-7979
jsc#SLE-7981).
- net: Rename skb_frag page to bv_page (jsc#SLE-7979
jsc#SLE-7981).
- net: Reorder the contents of skb_frag_t (jsc#SLE-7979
jsc#SLE-7981).

So apparently as part of the update to 5.3.8 these 5.4 changes got backported and merged into this.

comment:9 by ichamel, 4 years ago

Hi, I reported basically the same problem and today compared the VBoxNetFlt-linux.c in 6.1.10 from virtualbox and opensuse Leap 15.2. The problem is with the detection of the kernel version. It eems the Leap 15.2 is treated as a 4.xx kernel not 5.xx. In leap 15.2 opensuse defined its own OPENSUSE_152 Makro and queries that with defined(OPENSUSE_152) to force to compile the kernel 5.xx code. Pls see their code snippet :

# if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
defined(OPENSUSE_152)

pSG->aSegs[iSeg].cb = pFrag->bv_len; pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;

# else /* < KERNEL_VERSION(5, 4, 0) */

pSG->aSegs[iSeg].cb = pFrag->size; pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;

# endif /* >= KERNEL_VERSION(5, 4, 0) */

Following is a diff comparing both versions of VBoxNetFlt-linux.c

1c1 < /* $Id: VBoxNetFlt-linux.c 135976 2020-02-04 10:35:17Z bird $ */ ---

/* $Id: VBoxNetFlt-linux.c $ */

75a76,79

# if defined(CONFIG_SUSE_VERSION) & CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 2 # define OPENSUSE_152 # endif

927c931 < # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) ---

# if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
defined(OPENSUSE_152)

948c952 < # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) ---

# if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
defined(OPENSUSE_152)

These modifications are the only of this sort in /usr/share/virtualbox/src.

Rgds ... ichamel

comment:10 by ichamel, 4 years ago

Sry I forgot "uname -r" :

Linux claire 5.3.18-lp152.33-default #1 SMP Wed Jul 22 06:32:33 UTC 2020 (e5a8383) x86_64 x86_64 x86_64 GNU/Linux

comment:11 by jcdole, 4 years ago

For Oracle virtualbox users like me, what does this entail?

in reply to:  11 comment:12 by ichamel, 4 years ago

Replying to jcdole:

For Oracle virtualbox users like me, what does this entail?

You could modify that single file by applying the opensuse changes and call vboxconfig afterwards. It should compile properly and you can run virtualbox with this temporary solution until virtualbox.org comes up with the real patch...

Here again the diff of the virtualbox-file at the left and the opensuse version at the right, properly formatted now, I hope :

1c1
< /* $Id: VBoxNetFlt-linux.c 135976 2020-02-04 10:35:17Z bird $ */
---
> /* $Id: VBoxNetFlt-linux.c $ */
75a76,79
> # if defined(CONFIG_SUSE_VERSION) & CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 2
> #  define OPENSUSE_152
> # endif
>
927c931
< # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
---
> # if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(OPENSUSE_152)
948c952
< # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
---
> # if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(OPENSUSE_152)

The file to modify is /usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/VBoxNetFlt-linux.c

The patch file :

--- VBoxNetFlt-linux.c  2020-04-09 19:56:04.000000000 +0200
+++ /usr/src/kernel-modules/virtualbox/src/vboxnetflt/linux/VBoxNetFlt-linux.c  2020-06-11 16:32:18.000000000 +0200
@@ -1,4 +1,4 @@
-/* $Id: VBoxNetFlt-linux.c 135976 2020-02-04 10:35:17Z bird $ */
+/* $Id: VBoxNetFlt-linux.c $ */
 /** @file
  * VBoxNetFlt - Network Filter Driver (Host), Linux Specific Code.
  */
@@ -73,6 +73,10 @@
 #define VBOXNETFLT_OS_SPECFIC 1
 #include "../VBoxNetFltInternal.h"

+# if defined(CONFIG_SUSE_VERSION) & CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 2
+#  define OPENSUSE_152
+# endif
+
 typedef struct VBOXNETFLTNOTIFIER {
     struct notifier_block Notifier;
     PVBOXNETFLTINS pThis;
@@ -924,7 +928,7 @@
     for (i = 0; i < skb_shinfo(pBuf)->nr_frags; i++)
     {
         skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(OPENSUSE_152)
         pSG->aSegs[iSeg].cb = pFrag->bv_len;
         pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
 # else /* < KERNEL_VERSION(5, 4, 0) */
@@ -945,7 +949,7 @@
         for (i = 0; i < skb_shinfo(pFragBuf)->nr_frags; i++)
         {
             skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(OPENSUSE_152)
             pSG->aSegs[iSeg].cb = pFrag->bv_len;
             pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
 # else /* < KERNEL_VERSION(5, 4, 0) */

To apply the patch assuming virtualbox is installed put the above patch into a file like /tmp/patch123.diff and run as root

cd /usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/
patch -b </tmp/patch123.diff

and you should get an answer like

patching file VBoxNetFlt-linux.c

then leave the place and recompile :

cd
/sbin/vboxconfig

and that's it.

Rgds ... ichamel

Last edited 4 years ago by ichamel (previous) (diff)

comment:13 by jcdole, 4 years ago

Thank you very much for your quick answer. I will try tomorrow on a test machine, as it is the first time I do this kind of modification. Regards

comment:14 by jcdole, 4 years ago

That works.
Great thanks to ichamel for the detailed method which help me.
Regards

by Frank Batschulat (Oracle), 4 years ago

Attachment: opensuse152fix.diff.txt added

comment:15 by Frank Batschulat (Oracle), 4 years ago

The fix has been comitted to trunk with revision r139659 The fix has been backported to 6.1 with revision r139672

I'll produce and release public test builds tomorrow for Trunk and 6.1

Last edited 4 years ago by Frank Batschulat (Oracle) (previous) (diff)

comment:16 by Frank Batschulat (Oracle), 4 years ago

Testbuilds containing the fix are available as .run installer for

Trunk:
https://www.virtualbox.org/download/testcase/VirtualBox-6.1.97-139689-Linux_amd64.run

6.1.X:
https://www.virtualbox.org/download/testcase/VirtualBox-6.1.13-139685-Linux_amd64.run

remove the current installed RPM package and install the test build using the .run installer from: https://www.virtualbox.org/wiki/Testbuilds
where revision is >= 139659 for Trunk and >= 139672 for 6.1.X.

comment:17 by Manfred Schwarb, 4 years ago

Same issue exists also for 6.0.X. As far as I know it is still supported?

in reply to:  17 comment:18 by Frank Batschulat (Oracle), 4 years ago

Replying to manfredsch:

Same issue exists also for 6.0.X. As far as I know it is still supported?


No. It is not.

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

If you're looking for the latest VirtualBox 6.0 packages, see 
VirtualBox 6.0 builds. Please also use version 6.0 if you need to
 run VMs with software virtualization, as this has been discontinued
 in 6.1. Version 6.0 will remain supported until July 2020. 

 If you're looking for the latest VirtualBox 5.2 packages, see
 VirtualBox 5.2 builds. Please also use version 5.2 if you still 
need support for 32-bit hosts, as this has been discontinued in 6.0.
 Version 5.2 will remain supported until July 2020.

comment:19 by Frank Batschulat (Oracle), 4 years ago

Resolution: fixed
Status: acceptedclosed
Summary: Cannot install on OpenSUSE Leap 15.2Cannot install on OpenSUSE Leap 15.2 (fixed in SVN)
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette