Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 流浪的VirtualBox不';不能正确地向前移动_Macos_Vagrant_Ip_Virtualbox_Portforwarding - Fatal编程技术网

Macos 流浪的VirtualBox不';不能正确地向前移动

Macos 流浪的VirtualBox不';不能正确地向前移动,macos,vagrant,ip,virtualbox,portforwarding,Macos,Vagrant,Ip,Virtualbox,Portforwarding,这就是我的问题。我用Vagrant在我的Mac上安装了一个虚拟机 流浪汉:1.9.1 VirtualBox:4.3.38 OSX:10.11.6 机器:geerlingguy/ubuntu1604 当我运行vagrant up时,我得到这个输出 $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'geerlingguy/ubun

这就是我的问题。我用Vagrant在我的Mac上安装了一个虚拟机

  • 流浪汉:1.9.1
  • VirtualBox:4.3.38
  • OSX:10.11.6
  • 机器:geerlingguy/ubuntu1604
当我运行
vagrant up
时,我得到这个输出

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'geerlingguy/ubuntu1604'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'geerlingguy/ubuntu1604' is up to date...
==> default: Setting the name of the VM: <name>
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> 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.
最后,在GUI模式下引导机器允许我成功登录。现在,玩了一段时间后,我注意到以下几点

  • 运行lsof-i 2222显示端口实际上没有被转发

    VirtualBo 38361 <user>   29u  IPv4 <device>      0t0  TCP localhost:2222 (LISTEN)
    
    等等

  • 非常感谢你的建议,因为这已经让我发疯好几天了。

    我明白了

    问题是,我的虚拟机试图连接到VirtualBox中的NAT适配器(适配器1),但默认情况下适配器1已断开连接。在阅读了这个GitHub问题线程()之后,我添加了


    虚拟机启动得很好。我为这个问题工作了好几天

    该框没有IP,因为vagrant无法正确设置它-能否检查
    .ssh
    文件夹的权限是否正确,以及
    授权密钥是否正确
    
    VirtualBo 38361 <user>   29u  IPv4 <device>      0t0  TCP localhost:2222 (LISTEN)
    
    VirtualBo 38361 <user>   29u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2 (LISTEN)
    VirtualBo 38361 <user>   30u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61746 (CLOSE_WAIT)
    VirtualBo 38361 <user>   31u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61750 (CLOSE_WAIT)
    VirtualBo 38361 <user>   32u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61753 (CLOSE_WAIT)
    VirtualBo 38361 <user>   30u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61746 (CLOSE_WAIT)
    VirtualBo 38361 <user>   18u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61748 (CLOSE_WAIT)
    VirtualBo 38361 <user>   29u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2 (LISTEN)
    VirtualBo 38361 <user>   30u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61746 (CLOSE_WAIT)
    VirtualBo 38361 <user>   31u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61750 (CLOSE_WAIT)
    VirtualBo 38361 <user>   32u  IPv4 <device>      0t0  TCP localhost:rockwell-csp2->localhost:61753 (CLOSE_WAIT)]
    
    config.vm.provider 'virtualbox' do |vb|
      vb.customize ['modifyvm', :id, '--cableconnected1', 'on']
    end