虚拟机的“流浪”问题

Avi*_*ash 6 virtualbox vagrant 16.04

$ vagrant up

The provider 'virtualbox' that was requested to back the machine
'scdev' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the installation is incomplete. Please
run `VBoxManage --version` to see the error message which should contain
instructions on how to fix this error.
Run Code Online (Sandbox Code Playgroud)

然后我尝试调查,似乎我已经有了这些包:

$ VBoxManage --version
WARNING: The character device /dev/vboxdrv does not exist.
 Please install the virtualbox-dkms package and the appropriate
 headers, most likely linux-headers-generic.

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

$ sudo apt install linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-generic is already the newest version (4.4.0.59.62).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ sudo apt install virtualbox-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
virtualbox-dkms is already the newest version (5.0.24-dfsg-0ubuntu1.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

Dyl*_*tti 8

这才几个月大,但我偶尔会遇到这个问题,我想为我的流浪汉发布解决方案/原因。

这个问题(对我来说)通常是由 Vagrant 意外结束引起的(读我的笔记本电脑电池没电了)。以下是对我有用的事情列表:

  1. 一般来说,一个modprobe vboxdrv会做的伎俩。这会重新应用内核模块,一切都很好。
  2. 或者,重新配置包 dpkg-reconfigure virtualbox-*
  3. 最坏的情况,把它全部吹走,然后再试一次 sudo apt-get remove --purge virtualbox-dkms linux-headers-generic; #etc