【问题标题】:Timeout while waiting for the machine to boot!! Vagrant-Virtualbox等待机器启动时超时!! Vagrant-Virtualbox
【发布时间】:2015-10-09 04:50:30
【问题描述】:

我有 gentoo(linux) 主机。在其上,我安装了 Virtualbox 4.3.28 和 vagrant 1.4.3(这些是 gentoo 的最新可用版本)。

在 vagrant up 上,Ubuntu 14.04 启动。我也可以 ssh 到 Ubuntu。但是,一旦它启动,我就会收到以下错误。下面是我的 Vagrantfile 和输出错误。

P.S 我从头开始创建了 Ubuntu 14.04 基础盒

-----------Vagrantfile-------------

    # -*- mode: ruby -*-

    # vi: set ft=ruby :

        Vagrant.configure(2) do |config|
          config.vm.box = "Ubuntu"
          config.vm.boot_timeout = "700"
          config.vm.provider :virtualbox do |vb|
          vb.gui = true
          end

        end 

-----------Output in terminal------------
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
**
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period. This can
mean a number of things.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.**

有解决这个问题的办法吗?

【问题讨论】:

标签: linux ubuntu timeout vagrant virtualbox


【解决方案1】:

P.S 我从头开始创建了 Ubuntu 14.04 基础盒

这可能是缺少的部分 - 当您打包一个盒子时,您需要运行一些命令,如下所述

基于 Linux 的机器最初无法启动是很常见的。 这通常是一个非常令人困惑的经历,因为不清楚为什么会这样 正在发生。最常见的情况是因为有持久性 网络设备 udev 规则需要为新规则重新设置 虚拟机。为避免此问题,请删除所有持久网络 规则。在 Ubuntu 上,这些是执行此操作所需的步骤:

$ rm /etc/udev/rules.d/70-persistent-net.rules
$ mkdir /etc/udev/rules.d/70-persistent-net.rules
$ rm -rf /dev/.udev/
$ rm /lib/udev/rules.d/75-persistent-net-generator.rules

你能确保在打包之前运行上面的命令吗?

【讨论】:

  • 感谢@Frederic 的快速回复。我尝试了上述命令。这就是我得到的。对于第一个命令,它说:“无法删除..没有这样的文件或目录。”对于第三个命令,它说“无法删除'.rf':没有这样的文件或目录”
  • " cannot remove '.rf' ? rf 是一个选项,所以rm -rf /dev/.udev/ 应该在第一个命令上工作,如果你在你的虚拟机上启用了网络,你应该有这些目录
猜你喜欢
  • 2019-02-28
  • 2015-06-01
  • 2016-11-25
  • 1970-01-01
  • 2014-06-11
  • 2018-03-25
  • 1970-01-01
  • 1970-01-01
  • 2012-04-18
相关资源
最近更新 更多