[WorksForMe] Destination unreachable when doing curl/wget but ping working!

Discussions about using Linux guests in VirtualBox.
Post Reply
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

[WorksForMe] Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

Hi All!

When I do ping to google its working fine. When I do curl/wget for the same I am getting destination unreachalbe from 10.0.2.2, what I understood is this is a gateway in virtual box. Not sure why the same is sending destination unreachable when the host windows can get the same working. Any help on the same ? I have been trying for a long time nothing working.

rgds
Bala
Last edited by socratis on 19. Feb 2018, 10:59, edited 1 time in total.
Reason: Marked as [WorksForMe].
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Destination unreachable when doing curl/wget but ping working!

Post by socratis »

The following steps might tell us what's going on:
  • ping <DefaultGateway>    <-- tests your connectivity
    ping 8.8.8.8             <-- tests outgoing connectivity
    ping google.com          <-- tests name resolution
If you can ping your "gateway", if you can ping "8.8.8.8", if you can ping "google.com", VirtualBox is working as it should. You should look elsewhere for your networking connectivity. Look in your host for firewalls, proxies, antivirus filters, web-cleaning applications, redirectors, etc.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

Thanks for your response I am able to do all. But still the same.. :-(. Will check my firewall..
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

To add some more info. I upgraded to latest virtual box and it all started from their. Please note if I am working with Bridged adapter its working, its only when I put in NAT mode its not working. Btw have checked firewall settings and all looks fine..
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

Still not working, any other pointers ?. I see issue only with NAT mode, with bridged its working fine..
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Destination unreachable when doing curl/wget but ping working!

Post by socratis »

bkannada wrote:Still not working
Did you change anything in your configuration? If not, you know the saying about "insanity"? "Doing the same thing over and over again and expecting different results". If your configuration (outside of VirtualBox) is the same, I don't expect that it will get fixed by either upgrading VirtualBox or waiting for it to be fixed. And at this point we can't simply go on with "I checked it and it seems fine".

I haven't seen any configuration, any IPs, any numbers that show your configuration, so you might want to start sharing all the gory details instead of a "it doesn't work"; it works for everyone else but you. Also, I'm willing to bet the if you re-install your host from scratch, you won't have that problem.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Destination unreachable when doing curl/wget but ping working!

Post by andyp73 »

socratis wrote:so you might want to start sharing all the gory details instead of a "it doesn't work"
I would want to be taking a look at the output from:
traceroute <url.trying.to.reach>
curl <url.trying.to.reach>
-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

Code: Select all

[root@localhost vagrant]# ping http://www.google.com
PING http://www.google.com (172.217.160.132) 56(84) bytes of data.
64 bytes from maa03s29-in-f4.1e100.net (172.217.160.132): icmp_seq=1 ttl=53 time=10.6 ms
64 bytes from maa03s29-in-f4.1e100.net (172.217.160.132): icmp_seq=2 ttl=53 time=26.1 ms
^C
--- http://www.google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 10.636/18.408/26.181/7.773 ms
[root@localhost vagrant]# traceroute http://www.google.com
traceroute to http://www.google.com (172.217.160.132), 30 hops max, 60 byte packets
 1  outer (10.0.2.2)  0.847 ms  0.783 ms  0.709 ms
 2  * * *
 3  * * *
 4  * * *
[root@localhost vagrant]# curl http://www.google.com
curl: (7) Failed connect to http://www.google.com:80; Network is unreachable
[root@localhost vagrant]#
Last edited by socratis on 13. Feb 2018, 12:02, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Destination unreachable when doing curl/wget but ping working!

Post by socratis »

bkannada wrote:
[root@localhost vagrant]#
Why do people that use 3rd party programs based on VirtualBox don't ask first on these 3rd party programs, but believe it's a VirtualBox problem?

Vagrant is a program that relies on VirtualBox but modifies its configuration files in unknown ways to us. It is not supported on these VirtualBox user forums, they have their own Vagrant support channels. If you are having this problem with a standalone version of VirtualBox, then we can continue this discussion.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

I am facing this even with standalone. This vagrant image is another one which I have brought up. FYI even I brought up a windows image in this virtualbox mode and I still have this issue.
Last edited by socratis on 13. Feb 2018, 12:25, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Destination unreachable when doing curl/wget but ping working!

Post by socratis »

As I said, if you have installed Vagrant in parallel with VirtualBox, that may affect the configuration files of VirtualBox. Please read the User Manual, ch. 10.1 Where VirtualBox stores its files. I'm going to need to see "VirtualBox.xml" and the "<VM_Name>.vbox" for the VM in question. ZIPPED please. Also:
  • Start the VM from cold-boot (not from a paused or saved state) / Observe error / Shutdown the VM (force close it if you have to).
  • With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log", ZIP it and attach it to your response (see the "Upload attachment" tab below the reply form).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

Please find attachment.. This is a trial Windows7 version I am trying to bring up.
Attachments
IE8 - Win7.zip
(3.72 KiB) Downloaded 105 times
Last edited by socratis on 13. Feb 2018, 20:34, edited 2 times in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
bkannada
Posts: 8
Joined: 8. Feb 2018, 17:37

Re: Destination unreachable when doing curl/wget but ping working!

Post by bkannada »

I found this solution. Following changes were made and it resolved all.

1) Hosts file checked for additional entries and removed c:\windows\system32\drivers\etc\hosts
2) Winsock reset done so that any issue in socket gets rectified.

C:\>netsh winsock reset {We have to open cmd.exe as admin and execute this and reboot}

Apparently I never saw anywhere any solution for the same. Hence updating this thread so it will be useful for someone facing similar issue..
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Destination unreachable when doing curl/wget but ping working!

Post by socratis »

bkannada wrote:Apparently I never saw anywhere any solution for the same.
Because it's not VirtualBox related? ;)
bkannada wrote:Hence updating this thread so it will be useful for someone facing similar issue.
Oh, definitely. I wasn't even aware of that command, so thanks. I did a quick search after that, and for future reference I found this interesting MS article on this: How to determine and to recover from Winsock2 corruption in Windows Server 2003, in Windows XP, and in Windows Vista.

But, I have to stress again that this is not a VirtualBox problem. Thanks for the feedback. Marking as [WorksForMe].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply