Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup a local virtual machine (ubuntu 12.4) using Vagrant (www.vagrantup.com) and need to share its resources on my local wifi network. It is basically running a webserver which should be accessible by other machines on the local network.

My local wifi adapter gets a dynamic IP address from a router.

My current config looks like this, but i cannot access the machine from another machine using the IP:

config.vm.network :private_network, ip: "192.168.56.101"
    config.vm.network :forwarded_port, guest: 80, host: 8080

How can I make this happen? Any help is highly appreciated!

share|improve this question

The private_network is a network that is only between your host and the guest vm. If you want to make the guest vm available to others systems on the same network as your host you need to use the "public_network" setup in vagrant. This will allow your guest to get/use an IP address on the network that your host is on.

config.vm.network "public_network"

http://docs.vagrantup.com/v2/networking/public_network.html

share|improve this answer
    
In my particular setup, I had to leave both the private_network and public_network options enabled. This creates 3 adapters on vagrant up but it was fixed and works as expected. – Joum Oct 28 '15 at 14:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.