How to enable internet access inside Vagrant?

前端 未结 4 577
清歌不尽
清歌不尽 2021-02-01 02:37

If I run curl google.com, I can\'t see the output, only a blank page. My Vagrantfile contains:

Vagrant.configure(\"2\") do |config|
  config.vm.box          


        
4条回答
  •  隐瞒了意图╮
    2021-02-01 02:56

    I tried all of the above without success (Vagrant+Virtualbox+Ubuntu 14.04). Virtualbox was showing 'Adapter 1 (NAT): cable disconnected'. Adding the following to my Vagrantfile fixed it:

    config.vm.provider 'virtualbox' do |vb|
      vb.customize ['modifyvm', :id, '--cableconnected1', 'on']
    end
    

    Found here: https://github.com/mitchellh/vagrant/issues/7648

提交回复
热议问题