无法SSH到流浪汉Ubuntu 16.04?

时间:2016-11-02 16:19:20

标签: vagrant ubuntu-16.04 vagrantfile ubuntu-server

我创建了非常简单的Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "boxcutter/ubuntu1604"
  config.vm.hostname = "r1"
  config.vm.network "forwarded_port", guest: 3000, host: 3000

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

  config.vm.provider "virtualbox" do |vb|
     vb.memory = "1024"
  end

end

启动Ubuntu 16.04服务器的一般目的。除了SSH连接之外,一切都很好。

我的日志:

vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'boxcutter/ubuntu1604' is up to date...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 3000 (guest) => 3000 (host) (adapter 1)
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: 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 the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

我替换 config.vm.box =" boxcutter / ubuntu1604" 使用方框名称" ubuntu / trusty64" 并且它运行良好,但如何修复16.04?

3 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,并且解决了更新到最后一个VirtualBox和vagrant版本的问题。试试" bento / ubuntu-16.04"流浪盒。 " ubuntu / xenial64"不适合我。

答案 1 :(得分:0)

您是否尝试过错误提到的解决方案? boot_timeout默认为300秒[1] - 您是否给了boxcutter框一点时间,例如600秒,看看之后是否会有回应?

然而,ubuntu/trusty64旁边还有ubuntu/xenial64 [2],即16.04 - 也许你想尝试一下。

答案 2 :(得分:0)

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.provider :virtualbox do |vb|
  vb.customize ["modifyvm", :id, "--memory", "2048"]
 end    

试试这可能对你有帮助。