Private network on windows 10 not working with vagrant 1.8.7 with centos 7 box and docker

39 views
Skip to first unread message

rdo...@gmail.com

unread,
Nov 29, 2016, 2:54:54 AM11/29/16
to Vagrant
I want to setup a development environment on windows 10. So I installed the latest vagrant 1.8.7 with vagrant-vbguest plugin for synced folders.

I Defined my Vagrantfile as:

Vagrant.configure("2") do |config|

  config
.vm.box = "centos/7"
  config
.vm.synced_folder ".", "/vagrant", type: "virtualbox"
 
# config.vm.network "forwarded_port", guest: 8080, host: 8080
  config
.vm.network "private_network", ip: "192.168.11.11", netmask: "255.255.255.0"

end

When I start this box and ssh into the box I disabled selinux and installed latest docker and docker-compose.

In /vagrant I added the following docker-compose.yml:

nginx:
    image
: nginx:latest
    ports
:
       
- 8080:80

Now when I do "docker-compose up -d", the docker machine is running fine. If I use Vagrantfile with "forwarded_port" (as commented in Vagrantfile) I can access nginx via http://localhost:8080

But when I use private_network I can't get nginx welcome screen when visiting http://192.168.11.11:8080.

It worked the first time, but when I halt or restart vagrant it doesn't work anymore. What am I doing wrong? Struggling with this for more than a day!

rdo...@gmail.com

unread,
Nov 29, 2016, 4:35:04 AM11/29/16
to Vagrant
I removed the vbguest addition. This doesn't seem to help. It just works one time and after a vagrant halt && vagrant up , it doesn't work anymore. Very strange bug.
Reply all
Reply to author
Forward
0 new messages