Ubuntu 16.04冻结流浪者

每次我运行vagrant up ,ubuntu 16.04冻结,我必须重新启动它。

我不能把事件vagrant up --debug调试。

我正在使用widgetbox-php53框。

经过一段时间更新Vagrant到2.0.1和VirtualBox到5.2,它解决了我的问题。

我使用的是Vagrant 1.9.4和VirtualBox 5.0。

所以,我在使用Ubuntu 16.04 LTS booting VM遇到了同样的问题。

并且通过大量硬重置在一些步骤中解决这个问题 – 我已经更新到Vagrant 2.0.1VirtualBox 5.2

检查您拥有的版本:

  • vagrant -v (打开GUI:帮助 – >关于)
  • virtualbox -v

流浪汉

  1. 删除文件夹/home/USER/.vagrant.d/data/machine-index/indexindex.lock文件
  2. 下载Vagrant 2.0.1 https://www.vagrantup.com/downloads.html
  3. 安装包sudo dpkg -i vagrant_2.0.1_x86_64.deb

VirtualBox的

删除当前的虚拟框

  1. 运行sudo apt-get purge virtualbox*删除所有文件
  2. 检查是否有任何遗留dpkg -l | grep virtualbox dpkg -l | grep virtualbox
  3. (我不得不)删除sudo apt-get purge unity-scope-virtualbox

为Virtualbox添加存储库(使用apt安装)

  • sudo nano /etc/apt/sources.list
  • 添加行deb https://download.virtualbox.org/virtualbox/debian xenial contrib
  • 添加密钥wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
  • sudo apt-get update

安装最新的virtualbox

  1. 运行sudo apt-get install virtualbox-5.2
  2. 运行sudo /sbin/vboxconfig以重建设置

我遇到的问题

您可能需要销毁您的盒子并再次构建。

流浪的用户问题

 The VirtualBox VM was created with a user that doesn't match the current user running Vagrant. VirtualBox requires that the same user be used to manage the VM that was created. Please re-run Vagrant with that user. This is not a Vagrant issue. 

删除了.vagrant文​​件夹rm -rf .vagrant来解决这个问题。

重复的VM名称问题

 The name of your virtual machine couldn't be set because VirtualBox is reporting another VM with that name already exists. Most of the time, this is because of an error with VirtualBox not cleaning up properly. To fix this, verify that no VMs with that name do exist (by opening the VirtualBox GUI). If they don't, then look at the folder in the error message from VirtualBox below and remove it if there isn't any information you need in there. 

我有重复的Virtualbox名称作为VBoxManage: error: Could not rename the directory错误阻止vagrant up完成。 刚刚删除了我的Virtualbox VMs文件夹中的文件夹并通过GUI。

机器索引问题

这就是我开始冒险并从Googling带我到这里的原因。

 The machine index which stores all required information about running Vagrant environments has become corrupt. This is usually caused by external tampering of the Vagrant data folder. Vagrant cannot manage any Vagrant environments if the index is corrupt. Please attempt to manually correct it. If you are unable to manually correct it, then remove the data file at the path below. This will leave all existing Vagrant environments "orphaned" and they'll have to be destroyed manually. 

基本上,您需要升级Virtualbox和Vagrant版本。

Vagrant很容易更新(我更新到2.0.1)

以下是我将Virtualbox(或多或少)更新为5.1的方法:

 sudo apt remove virtualbox-XX sudo apt-get purge virtualbox-XX virtualbox-qt virtualbox-dkms 

现在,安装Virtualbox( 使用apt安装很重要)

 sudo apt-get install virtualbox-5.1 sudo /sbin/vboxconfig sudo apt-get install software-properties-common sudo apt-add-repository ppa:ansible/ansible sudo apt-get update sudo apt-get install ansible vagrant plugin install vagrant-vbguest vagrant plugin install vagrant-hostsupdater 

再次重新启动并构建VM

PS:永远不要用sudo制造流浪汉