Expose virtual machine (vagrant) to local Wifi

16,204

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:
16,204

Related videos on Youtube

Philipp
Author by

Philipp

Updated on September 18, 2022

Comments

  • Philipp
    Philipp over 1 year

    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!

    • Admin
      Admin about 7 years
      Did you ever get this figured out? I've been spending all day on this and am driving myself crazy. The main answer on this page isn't very helpful.
  • Joum
    Joum over 8 years
    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.