Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get Vagrant box to communicate with host machine #11

Closed
tommyc38 opened this issue Dec 3, 2015 · 2 comments
Closed

Can't get Vagrant box to communicate with host machine #11

tommyc38 opened this issue Dec 3, 2015 · 2 comments
Assignees

Comments

@tommyc38
Copy link

tommyc38 commented Dec 3, 2015

Hey Brandon,

I am sorry for posting this here but I searched a million ways to get in touch with you and this was the best way I could come up with. I have your chapter 2 script download to by virtual box running Ubuntu 15 (guest machine) and also downloaded to my host computer (Macbook Pro). I have tried both your local and remote scripts, both as client and server on both machines, but cannot get them to communicate. I have even tried port forwarding 1060 (guest) to 8080 (host) in my Vagrant file and adjusted your script by changing the port on my host machine to 8080 as my default (and without making changes) but haven't had any luck. I am beating my head against the wall trying to figure this out and hope you can help me understand what I am doing wrong. I am going to read the first two chapters again this evening because I am sure I am missing something, likely trivial, and might be able to find the problem myself.

I did manage to get them to both work just fine running them in different terminals without Vagrant, however, I feel like it won't truly sink in unless I have two different machines that I can program to speak to one another.

Lastly, it threw me for a bit of a loop at the bottom of page 26 when you give the host name 'guinness' (great beer by the way) as your command line argument. (I have the 3rd edition). You quickly mentioned giving the host name of your other machine but for a simple minded beginner like myself I wish this would have been better explained than more or less a footnote. However, when running your remote script, I did list the host name of my Vagrant box as an argument 'vagrant-ubuntu-trusty-64' (as well as the empty string. Hopefully I have given you enough information to help me diagnose my issue. Anyway, any guidance would be greatly appreciated!

Thanks,

Tom

@brandon-rhodes brandon-rhodes self-assigned this Dec 9, 2015
@brandon-rhodes
Copy link
Owner

You might have to do a lot of experimentation with your VirtualBox configuration. There are many ways of setting up the virtual network adapter in VirtualBox which seem to result in the virtual machine and the real machine not being able to see each other — network connections originating from inside the virtual machine can reach outside to the rest of the world, but cannot see the host machine. You might want to consult VirtualBox FAQs or documentation about how to establish network connections between the host and the virtual machine.

Have you tried out the Network Playground? It provides an alternative way to have several virtual machines that can all talk: https://github.com/brandon-rhodes/fopnp/tree/m/playground#the-network-playground

You mention the hostname vagrant-ubuntu-trusty-64 — unless you can ping that hostname successfully and ask your system what its IP address is and get back a reasonable answer, it might be that you simply don't have a working hostname that you can use for the box? I would recommend that you start with the other machine's raw IP address, and first get the script working with the IP address as its command line argument. Once you get that working, then you could switch to trying a hostname to see if it is supported on your system.

@brandon-rhodes
Copy link
Owner

Since I have not heard anything back — and since I suspect that trying out the Network Playground will indeed solve your problem by giving you a collection of virtual machines that are correctly networked together such that all of the scripts in the book work and where all the network settings are correct — I am going to provisionally close this issue. But please do open it if you have something else to ask about your situation. I was just working earlier this week to get Vagrant and VirtualBox talking together on my machine, so I know that these situations can result in frustrating hours!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants