The problem I see is that port-forwarding happens at two levels.
When you port-forward between the VM and the host, you're making any 
service available on the VM available on the host.

However, when you do port-forwarding between docker (i.e. docker-compose) 
and the VM you are making a docker service available to the VM (but not to 
the host!!).

So I would suggest you do the following,

1. `netstat -tlpn` from within the VM. What does it say? Is AppDock  and 
AppWin accessible from the VM? I.e. docker-compose will tell you what ports 
you are exporting (making available to the VM). Also notice the IP to which 
the port is exported. If it's 127.0.0.1 then it will not be exported beyond 
the VM.

2. If port 4241 and 4242 are exported to all interfaces, i.e. 0.0.0.0, then 
Vagrantfile should port-forward the same ports from the VM to the host.

Then you should be able to access the Docker container from the host.

I hope that helps.


On Sunday, 19 April 2020 02:10:11 UTC-4, Sorcerer Stone wrote:
>
> Dennis,
> This is what I am trying to do.
> I am trying to understand how an app works and to see how files from that 
> type of app are being transfer.
>
> In my vagrantfile, 
> 1/ I setup a private network IP: 192.168.33.10 & port forwarded host: 4241 
> guest: 4242
> where Host is Win10 (with HyperV disabled) & Guest is Ubuntu 18.4 - all 
> with latest updates.
> I attached my vagrantfile for your reference & why I think my problem most 
> likely come from (my lack of understanding on) the vagrant side.
> The vagrantfile calls a docker compose file which in turn, defines what 
> containers to pull/run for the app.
> The app uses port 4242 by default. Hence I port forwarded 4241 on the host 
> side (see reason below).
>
> I have the same app (itself using port 4242 by default) that is installed 
> using msi file in Windows and configured to send and receive files from its 
> docker equivalent described above.
> To simplify, let the Win host app be AppWin and its docker counterpart be 
> AppDock.
>
> I have problem sending files from the AppWin to AppDock.
> However, I have no problem sending files from AppDock to AppWin.
>
> AppDock config file points to the IP address of AppWin which is the IP 
> Address of the host computer (I attached the output of my ipconfig for your 
> reference).
>
> As to your comment on subnet. The subnet which AppDock reside is different 
> from the subnet which AppWin is on (I attached the output of my ifconfig 
> for your reference).
>
> On the VirtualBox side, I have setup 2 global Host-Only Ethernet Adapters 
> (#2 & #3 with IP 192.168.29.1 & 192.168.33.1 respectively) There is a 3rd 
> Host-Only Ethernet Adapter (with IP=192.168.56.1 but I have problem using 
> it). I attached a screenshot of this setup for your reference 
> (GlobalNetwork.jpg).
>
> The network setup for AppDock, is: Adapter 1 uses NAT & with port 
> forwarding, as shown in the attached screenshot (NAT & PortForwarding.jpg). 
> Adapter 2 uses Host-Only Adapter on Ethernet Adapter #3 described above 
> (HostOnlyAdapter.jpg).
>
> So here is my issue.
> I config AppDock to send file to the port # of AppWin on host IP: 
> 192.168.1.25
> The fact that files can be send from the docker containers using the host 
> OS IP address means that part of the networking from docker to host is 
> working
>
> The other half of the networking that is not working is from the host side 
> to the docker.
> From the vagrantfile I attached, there is a private network IP set up 
> (192.168.33.10). And from the docker's perspective, it can see this IP 
> address as since from the attached ifconfig output. I can ping this IP 
> address from the shell inside the docker environment.
>
> The AppWin is configure using 192.168.33.10 and pointing to port 4241 (I 
> also tried 4242 - see my port forwarding config in NAT & PortForwarding.jpg)
> It failed to send anything. From the log in AppWin, it registered this 
> error: Peer aborted Association (or never connected)
>
> So, my question is this: 
> What IP address should I use on the host side so that I can configure 
> AppWin to communicate with AppDoc?
> It definitely is not the IP address of the private network stated in my 
> vagrantfile.
>
> Additional reference. I attached the file, bridge_network.txt, which shows 
> the network in my docker and the containers for this AppDock inside the 
> vagrant_default bridge network.
> From this file, you can see the AppDock has an internal IP: 172.18.0.5 But 
> this internal IP cannot be access from the host directly.
>
> That is the core of my problem.
>
> What IP should I use in order to send files from Host to the container in 
> Guest? 
> How should I modify the vagrantfile in order to achieve this?
>
> Thanks in advance.
> Sorcerer
>
>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/ee7a2ab8-ad95-4f1a-b95f-850252f82570%40googlegroups.com.

Reply via email to