How to enable internet access inside Vagrant?

前端 未结 4 630
清歌不尽
清歌不尽 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:48

    If you are using Vagrant + VirtualBox + Ubuntu, you might want to add the following block to your VagrantFile:

    config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
    end
    

    If you are using ubuntu, and you think your firewall is on, here's how you turn off the firewall:

    sudo ufw disable
    

提交回复
热议问题