Unable to start vagrant due to host networking issues - vagrant

I was given a large Vagrantfile as part of an inherited project and on doing vagrant up, I get the following error:
The specified host network collides with a non-hostonly network!
This will cause your specified IP to be inaccessible. Please change
the IP or name of your host only network so that it no longer matches that of
a bridged or non-hostonly network.
I have made sure no other VMs are running by checking output of vagrant global-status.
I am not on VPN and
I have restarted my machine (Mac laptop).
Yet the error persists.
What to do?
I cannot share the large Vagrantfile but still need to get past this error.
My machine is connected to the Internet using Wi-Fi only, no cable connection.
I am also not very familiar with network-debugging commands.

You need to change the IP you assigned to the VM. If the IP collapses with a network range you should change it.
For example, you might be safe using an IP from range 192.0.2.0/24
If the 192.168.0.0/16 range does not work, you can completely switch to one of the following range
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
Choosing one or the other will depend of the network configuration of your office.

Related

How to make server inside vm have same ipaddress even though we change network

I have windows server installed in a vmware with domain configured. I had configured a website in iis and kept network adapter as bridged in vmware and is able to access website outside vmware on my local computer.
Problem is when i change my network on local server, we are not able to access website because earlier network range configured was different. For eg : first time it was in 192.168.Xx.XX series after changing network entire ipaddress of local computer got changed to 10.02.XX.XX
Need to know how we can achieve this.
You can assign another VM adapter to Local server and assign him static IP of your subnet or add a second IP to exiting network Adapter. After adding static IP of your subnet to local server, you can assign this IP to you IIS site and can access it from all of your network.
You can also configure NAT/bridge connection again on your server Vmware network adapter as you did earlier (what is the issue?).
If you dont want to assign ip of your local network to server vm, you can also assign second ip address to your host machine network adapter( If clients are not many).
you should also adjust the website's or VM's ip matching your network segment.
so if your network subnet is already 10.x.x.x change your websites ip to 10.x.x.x . or if you dont want to change your website's ip then you should configure routing or NAT

Synology NAS Default IP Address

My work recently purchased a Synology DS3617xs NAS. How do I find the default IP of the NAS so I can do the initial setup?
For security, we're running on a closed system - no internet
Running RHEL 7.4, so the Synology Assistant won't work (Win /Mac /Debian only)
We have two switches but no routers, so no DHCP
From the documentation it seems you need either an internet connection or DHCP for automatic IP assignment (where you can then find the IP from your router).
Any help is greatly appreciated.
I figured out a work-around.
I connected the NAS directly to my workstation using another LAN port I have installed on my workstation. I set the IPv4 connection for this port as Link-Local Only. When the LAN port identified its IP address, I used nmap to search the network to find other IP addresses. Since the only other item on this connection was the Synology, I was able to figure out the IP.
As you dont have DCHP option, please check the subnet and IP Range of the Switches. Then set the IP for the synology diskstation manually (search with the App Synology Assistant Windows download Link). Run synology assist from your computer makes sure the NAS is up and running all lights on and the blue light solid. LAN and disk lights should be flashing. It does take a few minutes for the unit to become available the first time. if you see the IP you can just type in the IP and get to you NAS as well without the synology assistant. You will need just the DSM file for your version/ unit. usually xxx.PAT. its that easy . Maybe the extra switch is the problem.
Pat file of your Diskstation: Link
As others said, it will spend time looking for a DHCP server to allocate an IP, and if it can't it'll eventually(*) default back to a self assigned IP in the 169.254.x.x range.
It takes quite a while to time out, so if you want to set it up without a DHCP server, you need to power it up and wait for 10+ minutes till it times out looking for DHCP responses.
IF you want to set it up without DHCP, you'll want to ensure your computers IP is setup to be able to talk to this range. (eg set your netmask to 0.0.0.0 so all traffic is sent directly, instead of any configured gateway)

Access xampp from VMWARE to Public IP

Is it possible to access 127.0.0.1:8080 publicly i have a project application that is running on VM, What should I do?
Diagram:
VMachine( where xampp is installed) IP <-> Global(external) IP (167.1.174.21:8080)
I don't have any option left what should i do i'm really new to this. #respect
Yes, this is possible but there are multiple steps to the configuration and the details for each steps differ depending on the hardware/software used. In general though it can be accomplished like this:
VMware config
Configure the VM with a bridged network
Configure the guest OS to either have a dhcp reservation or static ip.
Router config
Add a dhcp reservation for the VM (if using DHCP)
Add a port forwarding rule pointing to the VM's IP address
XAMPP config
Make sure the XAMPP server is listening on all interfaces.
The key point is to make the Virtual Machine to have bridged connection.
You can do it by looking at this one.
After that do a Port Forwarding to the virtual machine like it a real machine on your LAN.
Step 1 : Apart from above solution, in your local network where xampp is installed, make your local ip as static one, like "192.168.1.125" from router settings->Address reservation option.
Once you reserve address
Step 2 : Open your router->port forwarding->set port & ip to forward.
Step 3 : Now you check your public ip, and bingo now you can go to your public ip from vmware or from any other network.
As long as the vm has a configured network and is therefor able to communicate with your LAN (using Bridged networks in the VM configuration is a good way to go) and the internet, it is possible to make it accessible to the external web/internet.
Therefor you would most likely need to define a port-redirect/port forwarding on your router, that all incoming packets on the external IP (167.1.174.21) on port 8080 gets forwarded to the local ip of your vm and the related xampp session.
A possible problem at that point might be changing IP addresses of the VM based on a possible DHCP configuration. Either use a fixed IP on the VM or configure some mac-based rule for fixed IP or increase the lease time of the dhcp-server (your router to unlimited)
That's the theory, but please think twice before you do so. Running a webserver which is available in the wild is not recommended if you are not used to IT security. And even if you decide to do so, using xampp sounds wrong to me ears. xampp is designed for local development & testing purposes, not for productive use.

getaddrinfo() returns 127.0.0.1 for remote host

I have an application which uses getaddrinfo() to translate from the hostname of a PC in a Windows Workgroup to the IPV4 address for that PC on the LAN. (Note, I don't mean getting the address of the PC the code is running on, I mean the address of another PC on the LAN!) This has been working in the field as well as in the lab for quite some time but now I have a Windows 7 (32 bit) PC that behaves anomalously. The hostname for this PC is "elbow".
I compiled the sample code provided by Microsoft for getaddrinfo() at http://msdn.microsoft.com/en-us/library/windows/desktop/ms738520%28v=vs.85%29.aspx
When I run this sample code on any PC on my LAN and specify "elbow" as the hostname, getaddrinfo() returns the loopback address 127.0.0.1 instead of the correct one (192.168.1.110). However, if I specify any other hostname getaddrinfo() returns the correct address!
At some point in the past "elbow" did NOT exhibit this behavior, so clearly something about that PC has changed to cause this behavior. I have tried restoring the PC disk image to a point where I think it did not cause this behavior, but that made no change.
It also makes no difference whether the PC is hardwired or wirelessly connected to the LAN. DHCP is enabled for all PCs on the LAN. The behavior is persistent even with a complete power-down of all PCs, routers and switches.
Hit a similar problem and wanted to post just in case someone else found this thread.
The same thing happened on our side with a customer installed computer. We found that the customer changed their hosts file to associate 127.0.0.1 with the pc's name... a separate program using getaddrinfo to find a certain subnetwork kept failing...they ended up renaming the computer temporarily to use this function but they also could have fixed their host file.
The hosts file on that Win 7 computer was found in /windows/system32/drivers/etc.
I wanted to update this with the answer. The elephant in the room was the ISP's DNS. I was under the mistaken impression that my subnet was isolated from the ISPs DNS but that was not the case. For whatever reason, their DNS is returning 127.0.0.1 for the hostname "elbow" but as soon as I renamed it to something else my problem went poof! I also uncovered another PC that had the same problem, and renaming it fixed it too. The thing both PCs have in common is that both had undergone OS reloads, but the problem did not become apparent until some time after those OS reloads.

Is it possible to make localhost work through a Virtual Machine?

I am using a Macbook running 10.6. I am using VMware Fusion to run an Ubuntu Server minimal virtual machine. Ubuntu Server is running your basic LAMP stack.
I do my development in Mac OS. I have VMware share a directory from Mac OS to the Ubuntu Server. Ubuntu Server uses that directory for apache.
I access my server is Mac OS in firefox using the ip address of my virtual machine. This is a pain because I have to find out what the ip address is of my virtual machine each time I boot it up. I could set a static ip address but this causes problems if I move my Macbook from network to network.
Is there any configuration (NAT or Bridged or something) that would let me access my virtual machine from the Mac OS using localhost or something similar?
Thanks
NAT should be OK. Your VM is on a different subnet that way, you can give it the static IP you like, and it won't interfere with the (dynamic) IP on your real network.
What you are looking for is the host-only networking adapter as opposed to the NAT or bridged adapters. This creates a network interface on the virtual machine that only connects the actual host. It is perfectly safe to set an IP address for this interface that does not change, and there will be no tricky NAT getting in the way. It's a little network that only exists for communication between the real host and the virtual host. It's exact purpose is so you can do development like this. I use the same feature on VirtualBox all the time, but VMWare has it as well.
Now, with a host-only adapter you might be worried that your VM now has no access to the Internet. The answer is simple. Just make two adapters. eth0, eth1. Make one of them a bridged or NAT adapter for Internet access. Make the other one the host-only adapter for your development. Most modern Linux distros will automatically route accordingly. I know for a fact that Ubuntu does, because I do it all the time. Again, this is with VirtualBox. Your mileage may vary with VMWare, but I can't imagine it's that different.
I'm using Virtual Box and typing in the computer local address (for instance 192.168.1.100) instead of localhost did the trick.
Maybe I'm misunderstanding your question but why not just add an entry in your hosts file for the virtual machine? That way you can access it with some arbitrarily assigned name (like testmachine) instead of the IP.
This is the first tutorial I found through google: http://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/
This would work best if your VM has a static IP, BTW (either no DHCP or configure the DHCP server to give that MAC the same IP every time). That way you don't have to worry about changing the hosts entry every time the DHCP server gives the VM a different IP.

Resources