简体   繁体   中英

Can't up vagrant with boot_timeout error on Windows 10

The 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:

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. 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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