简体   繁体   English

无法在Windows 10上因boot_timeout错误而变得流浪汉

[英]Can't up vagrant with boot_timeout error on Windows 10

The Vagrantfile: Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "bento/centos-7.3"
  config.ssh.insert_key = false

  config.vm.provider :virtualbox do |v|
    v.customize ["modifyvm", :id, "--memory", 512]
  end

  # node1
  config.vm.define "node1", primary: true do |host|
    host.vm.hostname = 'node1'
    host.vm.network :private_network, ip: "192.168.0.1"
    host.vm.network :forwarded_port, guest: 22, host: 1234, id: 'ssh'
  end

  # node2
  config.vm.define "node2" do |host|
    host.vm.hostname = 'node2'
    host.vm.network :private_network, ip: "192.168.0.2"
    host.vm.network :forwarded_port, guest: 22, host: 1235, id: 'ssh'
  end
end

When ran vagrant up , got error: vagrant up ,出现错误:

Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'node2' up with 'virtualbox' provider...
==> node1: Checking if box 'bento/centos-7.3' is up to date...
==> node1: A newer version of the box 'bento/centos-7.3' is available! You currently
==> node1: have version '2.3.4'. The latest is version '2.3.7'. Run
==> node1: `vagrant box update` to update.
==> node1: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> node1: flag to force provisioning. Provisioners marked to run always will still run.
==> node2: Checking if box 'bento/centos-7.3' is up to date...
==> node2: A newer version of the box 'bento/centos-7.3' is available! You currently
==> node2: have version '2.3.4'. The latest is version '2.3.7'. Run
==> node2: `vagrant box update` to update.
==> node2: Clearing any previously set forwarded ports...
==> node2: Clearing any previously set network interfaces...
==> node2: Preparing network interfaces based on configuration...
    node2: Adapter 1: nat
    node2: Adapter 2: hostonly
==> node2: Forwarding ports...
    node2: 22 (guest) => 1235 (host) (adapter 1)
==> node2: Running 'pre-boot' VM customizations...
==> node2: Booting VM...
==> node2: Waiting for machine to boot. This may take a few minutes...
    node2: SSH address: 127.0.0.1:1235
    node2: SSH username: vagrant
    node2: SSH auth method: private key
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.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

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.

Is it possible because of some proxy setting? 是否可能由于某些代理设置? Or some vagrant plugin been installed? 还是安装了一些流浪汉插件? Not sure why it caused the issue. 不知道为什么会引起问题。 After run up command the first time, had added new hard disk on both nodes. 第一次运行命令后,在两个节点上都添加了新硬盘。 Was that caused trouble? 那是麻烦吗? Anything clearly? 有什么清楚的吗?

The reason is I added new hard disks on Setting -> Storage -> Controller: IDE Controller , but not Controller: SATA Controller on VirtualBox. 原因是我在VirtualBox的Setting -> Storage -> Controller: IDE Controller上添加了新硬盘,但未在Controller: SATA Controller上添加了新硬盘。 After added them to the right place, it works well. 将它们添加到正确的位置后,效果很好。

By the way, vagrant can automatic realize new added hard disk. 顺便说一句,流浪汉可以自动实现新添加的硬盘。 Just run lsblk can find the new disk named sdb like this: 只需运行lsblk即可找到名为sdb的新磁盘,如下所示:

NAME        MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda           8:0    0  40G  0 disk
├─sda1        8:1    0   1G  0 part /boot
└─sda2        8:2    0  39G  0 part
  ├─cl-root 253:0    0  37G  0 lvm  /
  └─cl-swap 253:1    0   2G  0 lvm  [SWAP]
sdb           8:16   0   2G  0 disk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM