linux – Vagrant Error:连接超时.重试

前端之家收集整理的这篇文章主要介绍了linux – Vagrant Error:连接超时.重试前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个服务器与Ubuntu 12.04,VirtualBox 4.3和Vagrant 1.5.1.我试图使用这个盒子 http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box然而不成功.当我运行“vagrant up”时,我收到此消息:
Bringing machine 'default' up with 'virtualBox' provider...
==> default: Importing base Box 'centos-64-x64-vBox4210'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: rafael_default_1396403974194_51967
==> default: Clearing any prevIoUsly set forwarded ports...
==> default: Clearing any prevIoUsly set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
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.

这是我的Vagrant文​​件

# Vagrantfile API/Syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # All Vagrant configuration is done here. The most common configuration
  # options are documented and commented below. For a complete reference,# please see the online documentation at vagrantup.com.

  # Every Vagrant virtual environment requires a Box to build off of.
  config.vm.Box = "centos-64-x64-vBox4210"
  config.vm.boot_timeout = 600
  # The url from where the 'config.vm.Box' Box will be fetched if it
  # doesn't already exist on the user's system.
  # config.vm.Box_url = "http://domain.com/path/to/above.Box"

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,# accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port",guest: 80,host: 8080

  # Create a private network,which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network",ip: "192.168.33.10"

  # Create a public network,which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # If true,then any SSH connections made will enable agent forwarding.
  # Default value: false
  # config.ssh.forward_agent = true

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data","/vagrant_data"
  # Enable provisioning with chef server,specifying the chef server URL,# and the path to the validation key (relative to this Vagrantfile).
  #
  # The Opscode Platform uses HTTPS. Substitute your organization for
  # ORGNAME in the URL and validation key.
  #
  # If you have your own Chef Server,use the appropriate URL,which may be
  # HTTP instead of HTTPS depending on your configuration. Also change the
  # validation key to validation.pem.
  #
  # config.vm.provision "chef_client" do |chef|
  #   chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"    
  #   chef.validation_key_path = "ORGNAME-validator.pem"
  # end
  #
  # If you're using the Opscode platform,your validator client is
  # ORGNAME-validator,replacing ORGNAME with your organization name.
  #
  # If you have your own Chef Server,the default validation client name is
  # chef-validator,unless you changed the configuration.
  #
  #   chef.validation_client_name = "ORGNAME-validator"
end

我的服务器没有图形界面
我该如何解决
谢谢.

解决方法

首先,尝试:查看您的机器配置中的vagrant私钥
$vagrant ssh-config

例:

$vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/Users/konst/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

Vagrant SSH Config Docs

第二,做:使用yorn自己的系统私钥的内容更改文件insecure_private_key的内容

原文链接:https://www.f2er.com/linux/402206.html

猜你在找的Linux相关文章