如何解决 vagrant up 问题

如何解决 vagrant up 问题

我安装了 VirtualBox 和 vagrant,尝试让 vagrant 工作,但出现以下错误:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

我运行sudo /sbin/vboxconfig后收到以下错误:

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

nawalabs@nawalabs-ThinkPad-X240:~/web-dev/lighthouse$ sudo /sbin/vboxconfig
vboxdrv.sh: Stopping 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:
    linux-headers-generic linux-headers-4.15.0-13-generic
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:
    linux-headers-generic linux-headers-4.15.0-13-generic

There were problems setting up VirtualBox.  To re-start the set-up process, run


/sbin/vboxconfig
as root.

我能做些什么?

安装 linux headers-generic 并执行后sudo vboxconfig,出现以下错误消息:

vboxdrv.sh: Stopping 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:
    linux-headers-generic linux-headers-4.15.0-13-generic
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:
    linux-headers-generic linux-headers-4.15.0-13-generic
There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.

相关内容