How to install virtualbox?

The version of my manjaro is 4.19.42-1-MANJARO by uname -r,and linux kernel is linux419.
I have install virtualbox and virtualbox-host-modules-arch by

sudo pacman -Sy virtualbox

and when I run the virtualbox I get the WARNING:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.19.42-1-MANJARO) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.

so I run:sudo /sbin/vboxconfig, and I get:

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.
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.

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.

but the header linux-headers have been install by sudo pacman -S linux-headers,
if I input sudo pacman -S linux419-headers,there is an error 错误:未找到目标:linux419-headers mean no "linux419-headers",
if I run modprobe vboxdrvI get:

modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.19.42-1-MANJARO

I really don't know how to solve it, could anyone help me?
thank you!

 2 core/linux419-headers 4.19.51-2
     Header files and scripts for building modules for Linux419 kernel

There certainly are 419 headers....

Update your mirrors and system:

sudo pacman-mirrors -f5
sudo pacman -Syyu
2 Likes

it fix! Thank you very much!!!

Manjaro is different from Debian/Ubuntu/Fedora - it is a rolling system, you must keep it up to date to avoid problems :smiley:

https://wiki.manjaro.org/index.php?title=VirtualBox

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by