我最近用 升级了我的内核apt-get dist-upgrade
。
当我尝试在vagrant up
现有虚拟机上启动虚拟机时,出现以下错误:
$ vagrant up
Bringing machine 'myvirtualmachine' up with 'virtualbox' provider...
==> myvirtualmachine: Clearing any previously set forwarded ports...
==> myvirtualmachine: Clearing any previously set network interfaces...
==> myvirtualmachine: Preparing network interfaces based on configuration...
myvirtualmachine: Adapter 1: nat
myvirtualmachine: Adapter 2: hostonly
==> myvirtualmachine: Forwarding ports...
myvirtualmachine: 8092 (guest) => 9000 (host) (adapter 1)
myvirtualmachine: 22 (guest) => 2222 (host) (adapter 1)
==> myvirtualmachine: Running 'pre-boot' VM customizations...
==> myvirtualmachine: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "8b5f97cb-b593-4610-989d-6445fbcb7d0e", "--type", "headless"]
Stderr: VBoxManage: error: The virtual machine 'myvirtualmachine' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
我尝试重新加载虚拟机,但没有成功。即使从头开始重建虚拟机也无济于事。
我该怎么做才能恢复我的虚拟机?
版本:virtualbox 5.1.10 r112026、vagrant 1.8.7、ubuntu 16.10、linux 4.8.0-28-generic
答案1
以下是我解决问题的方法。看来 dist-upgrade 不会重建 Virtual Box 内核模块。您必须完全重新安装 VirtualBox:
sudo apt-get remove virtualbox-5.1 virtualbox-dkms
sudo apt-get install virtualbox-5.1
我也尝试过sudo apt-get --reinstall install virtualbox-dkms
(按照建议这里) 但对我来说没用。完全重新安装 virtualbox 似乎是可行的方法。