簡體   English   中英

無法在Windows 10上因boot_timeout錯誤而變得流浪漢

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

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

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.

是否可能由於某些代理設置? 還是安裝了一些流浪漢插件? 不知道為什么會引起問題。 第一次運行命令后,在兩個節點上都添加了新硬盤。 那是麻煩嗎? 有什么清楚的嗎?

原因是我在VirtualBox的Setting -> Storage -> Controller: IDE Controller上添加了新硬盤,但未在Controller: SATA Controller上添加了新硬盤。 將它們添加到正確的位置后,效果很好。

順便說一句,流浪漢可以自動實現新添加的硬盤。 只需運行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