PC重新启动后,无业游民的计算机无法启动。它显示端口冲突

时间:2019-01-07 10:10:33

标签: vagrant

更新After host PC reboot vagrant up shows port collision on any port

我的无业游民的机器无法启动。 通常它可以正常工作,但是今天,当我重新启动PC后,无所事事的机器不再启动。 我没有更改Vagrantfile。 它说关于港口碰撞。 如果我删除了6379的redis设置,那么它说的是端口1080,依此类推。 像所有端口都有碰撞。 如果我尝试通过VMware运行Macine,那么它会启动OK,但我无法通过ssh连接到它,因为它没有Vagrantfile中定义的设置...

这是日志:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: There was a problem while downloading the metadata for your box
==> default: to check for updates. This is not an error, since it is usually due
==> default: to temporary network problems. This is just a warning. The problem
==> default: encountered was:
==> default:
==> default: The requested URL returned error: 404
==> default:
==> default: If you want to check for box updates, verify your network connectio                                                                                                                                                                                               n
==> default: is valid and try again.
==> default: Fixed port collision for 6379 => 6379. Now on port 2250.
Vagrant found a port collision for the specified port and virtual machine.
While this port was marked to be auto-corrected, the ports in the
auto-correction range are all also used.

VM: default
Forwarded port: 1080 => 1080

这是我的Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"

  forward_port = ->(guest, host = guest) do
    config.vm.network :forwarded_port,
      guest: guest,
      host: host,
      auto_correct: true
  end

  config.vm.synced_folder "sites/", "/var/www"
  config.vm.synced_folder ".", "/vagrant", disabled: true


  forward_port[6379]      # redis
  forward_port[1080]      # mailcatcher
  forward_port[3306]      # mysql
  forward_port[80, 8080]  # nginx/apache

  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "manifests"
    puppet.manifest_file = "default.pp"
  end

  config.vm.network :private_network, ip: "33.33.33.10"

  config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"
end

0 个答案:

没有答案