1

I can't install virtual-box on UBUNTU. I have an i686 CPU, and UBNUTU 16.04 LTS.

But running this command leads to error.

$ sudo aptitude reinstall virtualbox-dkms 
The following packages will be REINSTALLED:
  virtualbox-dkms 
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 617 kB of archives. After unpacking 0 B will be used.
Get: 1 http://us.archive.ubuntu.com/ubuntu xenial/multiverse i386 virtualbox-dkms all 5.0.18-dfsg-2build1 [617 kB]
Fetched 617 kB in 2s (251 kB/s)          
(Reading database ... 189192 files and directories currently installed.)
Preparing to unpack .../virtualbox-dkms_5.0.18-dfsg-2build1_all.deb ...

------------------------------
Deleting module version: 5.0.18
completely from the DKMS tree.
------------------------------
Done.
Unpacking virtualbox-dkms (5.0.18-dfsg-2build1) over (5.0.18-dfsg-2build1) ...
Setting up virtualbox-dkms (5.0.18-dfsg-2build1) ...
Loading new virtualbox-5.0.18 DKMS files...
Building only for 4.15.0-45-generic
Building initial module for 4.15.0-45-generic
ERROR (dkms apport): kernel package linux-headers-4.15.0-45-generic is not supported
Error! Bad return status for module build on kernel: 4.15.0-45-generic (i686)
Consult /var/lib/dkms/virtualbox/5.0.18/build/make.log for more information.
Job for virtualbox.service failed because the control process exited with error code. See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
   Loaded: loaded (/etc/init.d/virtualbox; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-09-03 02:49:59 +0430; 47ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 14663 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)

Sep 03 02:49:59 ee-sys systemd[1]: Starting LSB: VirtualBox Linux kern....
Sep 03 02:49:59 ee-sys virtualbox[14663]:  * Starting VirtualBox kerne...s
Sep 03 02:49:59 ee-sys virtualbox[14663]:  * No suitable module for ru...d
Sep 03 02:49:59 ee-sys virtualbox[14663]:    ...fail!
Sep 03 02:49:59 ee-sys systemd[1]: virtualbox.service: Control process...1
Sep 03 02:49:59 ee-sys systemd[1]: Failed to start LSB: VirtualBox Lin....
Sep 03 02:49:59 ee-sys systemd[1]: virtualbox.service: Unit entered fa....
Sep 03 02:49:59 ee-sys systemd[1]: virtualbox.service: Failed with res....
Hint: Some lines were ellipsized, use -l to show in full.

System type

uname -a

Linux ee-sys 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:19 UTC 2019 i686 i686 i686 GNU/Linux

log: /var/lib/dkms/virtualbox/5.0.18/build/make.log

linux/alloc-r0drv-linux.c:31: /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘rtR0MemAllocEx’: /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/the-linux-kernel.h:252:42: error: ‘cpu_has_pge’ undeclared (first use in this function) # define MY_PAGE_KERNEL_EXEC __pgprot(cpu_has_pge ? __PAGE_KERNEL_EXEC | _PAGE_GLOBAL : __PAGE_KERNEL_EXEC) ^ ./arch/x86/include/asm/pgtable_types.h:433:36: note: in definition of macro ‘__pgprot’ #define __pgprot(x) ((pgprot_t) { (x) } ) ^ /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:269:100: note: in expansion of macro ‘MY_PAGE_KERNEL_EXEC’ pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN, MY_PAGE_KERNEL_EXEC); ^ /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/the-linux-kernel.h:252:42: note: each undeclared identifier is reported only once for each function it appears in # define MY_PAGE_KERNEL_EXEC __pgprot(cpu_has_pge ? __PAGE_KERNEL_EXEC | _PAGE_GLOBAL : __PAGE_KERNEL_EXEC) ^ ./arch/x86/include/asm/pgtable_types.h:433:36: note: in definition of macro ‘__pgprot’ #define __pgprot(x) ((pgprot_t) { (x) } ) ^ /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:269:100: note: in expansion of macro ‘MY_PAGE_KERNEL_EXEC’ pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(pHdr), GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN, MY_PAGE_KERNEL_EXEC); ^ In file included from /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:31:0: /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContAlloc’: /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/the-linux-kernel.h:309:47: error: implicit declaration of function ‘set_pages_x’ [-Werror=implicit-function-declaration] # define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages) ^ /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:444:13: note: in expansion of macro ‘MY_SET_PAGES_EXEC’ MY_SET_PAGES_EXEC(&paPages[iPage], 1); ^ /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c: In function ‘VBoxHost_RTMemContFree’: /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/the-linux-kernel.h:310:47: error: implicit declaration of function ‘set_pages_nx’ [-Werror=implicit-function-declaration] # define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages) ^ /var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:492:13: note: in expansion of macro ‘MY_SET_PAGES_NOEXEC’ MY_SET_PAGES_NOEXEC(&paPages[iPage], 1); ^ cc1: some warnings being treated as errors scripts/Makefile.build:332: recipe for target '/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o' failed make[2]: [/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o] Error 1 scripts/Makefile.build:606: recipe for target '/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv' failed make[1]: * [/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv] Error 2 Makefile:1551: recipe for target 'module/var/lib/dkms/virtualbox/5.0.18/build' failed make: *** [module/var/lib/dkms/virtualbox/5.0.18/build] Error 2 make: Leaving directory '/usr/src/linux-headers-4.15.0-45-generic'

2
  • Try a never version of VirtualBox, either 5.2.32 or 6.0.10: virtualbox.org Sep 2, 2019 at 22:36
  • As presented I can't read your actual error messages (you quoted the make log where I feel a {} code-block would be more readable, I looked at changing it but it didn't look right as it looked edited)
    – guiverc
    Sep 2, 2019 at 22:44

1 Answer 1

0

Finally I solve the problem with

  1. Remove old virtual box: sudo apt remove virtualbox

  2. Download virtualBox 5 from this link

  3. run in terminal $ sudo dpkg -i virtualbox-5.2_5.2.32-132073~Ubuntu~xenial_i386.deb

Thank you ajgringo619 for helpful comment.


Update 2021

Its highly recommended that to use apt instead of dpkg to install package.

$ sudo apt-get install ./virtualbox-5.2_5.2.32-132073~Ubuntu~xenial_i386.deb

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .