Vagrant 窗户上的流浪汉可以';t启动并连接ssh

Vagrant 窗户上的流浪汉可以';t启动并连接ssh,vagrant,vagrantfile,vagrant-windows,Vagrant,Vagrantfile,Vagrant Windows,所以我看了很多关于Vagrant的视频,看起来很简单:安装了VirtualBox和Vargant后,只需在Vagrant文件中指定VM框的名称,运行$Vagrant up,就可以直接使用$Vagrant ssh连接到它 然而,一周后,许多头痛/键盘坏了,这仍然不起作用 PS C:\dev\web> vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing

所以我看了很多关于Vagrant的视频,看起来很简单:安装了VirtualBox和Vargant后,只需在Vagrant文件中指定VM框的名称,运行$Vagrant up,就可以直接使用$Vagrant ssh连接到它

然而,一周后,许多头痛/键盘坏了,这仍然不起作用

PS C:\dev\web> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty32'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: Setting the name of the VM: web_default_1468168716511_77856
==> 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: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (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
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 Manager并打开新安装的框,我可以使用“vargant”作为用户名和密码完全连接到它,我可以看到它上没有安装任何东西。我不能通过PuTTY或Cygwin用ssh连接到它

执行$vagrant ssh配置将输出以下内容:

PS C:\dev\web> vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/Users/User/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL
我的流浪汉档案:

Vagrant.configure("2") do |config|

  config.vm.box = "ubuntu/trusty32"

   config.vm.provider "virtualbox" do |vb|

     vb.gui = true

   end

   config.vm.provision "shell", inline: <<-SHELL
     apt-get update
     apt-get install -y apache2
   SHELL
end
Vagrant.configure(“2”)do | config|
config.vm.box=“ubuntu/trusty32”
config.vm.provider“virtualbox”do | vb|
vb.gui=true
结束

config.vm.provision“shell”,内联:我今天遇到了一个非常类似的问题,我正在启动一个与您的(Cent OS 7)略有不同的环境,但是安装VirtualBox Guest Additions可能会有所帮助。命令
vagrant插件安装vagrant vbguest
我们应该做到这一点


页面上也有其他信息,可能会有所帮助。

您是否在嵌套的虚拟化环境中运行vagrant。意思是,你的主机是虚拟机吗?@Frank No.所有物理计算机。既然你有“vb.gui=true”,你应该得到一个交互式窗口。你有关于错误的更多细节吗?@Frank是的,当我查看虚拟机时,发现了一些与网络相关的错误!!!!!!!失败!!!!!这是一种信息。它太快了,我看不懂,试着在屏幕上录制,但还是看不懂。也许这就是VBox的问题?因为Vagrant无法连接到它,它甚至无法运行初始bash。我也有同样的问题。