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 = "trumobi" #config.vm.box_url = "http://192.168.136.129/package.box" config.ssh.default.username = "trumobi" config.vm.network :public_network config.vm.network :forwarded_port, host: 8000, guest: 8000 end
Configure port forwarding To set up a forwarded port so you can access Apache on your guest, add the config. vm.network parameter to your Vagrantfile. Below is the full file with port forwarding. Reload so that these changes can take effect.
The IP address can be determined by using vagrant ssh to SSH into the machine and using the appropriate command line tool to find the IP, such as ifconfig .
Default Network Interface If more than one network interface is available on the host machine, Vagrant will ask you to choose which interface the virtual machine should bridge to. A default interface can be specified by adding a :bridge clause to the network definition.
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
This happens sometimes for me if I switch the host network connection, like disconnecting my laptop Ethernet cable and start using the wireless network. I found that rebooting the Vagrant vm (vagrant halt, vagrant up) fixes things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With