cant ping the guest from the host

This is for discussing general topics about how to use VirtualBox.
Post Reply
tom909
Posts: 28
Joined: 3. Feb 2008, 07:37

cant ping the guest from the host

Post by tom909 »

probably a stupid simple networking question that may be independent of virtualbox.

on the guest, /sbin/ifconfig reports that the guest's IP is 10.0.2.15 internet access and such works. however, I cannot ping the guest from my host. however, I can ping the host, 10.0.2.2, from the guest. maybe I am "in the wrong network". /sbin/ifconfig on the host reports only 192.168.1.106, the IP it got from the router. what I ultimately like to do is to use krdc or similar program using the rdp protocol, to display the guest on my host via this method.

having opensuse 10.3 (64bit) host using NAT for the guests and opensuse guest 10.3.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

If you would read the manual, you would know that Ping doesn't work with NAT. The reason you can ping 10.0.2.2 from the Guest, is because you ping VB itself. If you would create a second VM and use NAT there too, it would have the same ip configuration. If you want to communicate both ways with the host and guest, use Host Interface as described in the manual.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
over_clox
Volunteer
Posts: 167
Joined: 5. Apr 2008, 22:43
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu 10.04, Legacy Testing

Post by over_clox »

NAT - Network Address Translation

It _is_ on a totally different LAN; NAT translates addresses between the host and guest. Why PING doesn't work is because the packet header gets translated, but the packet data (which contains the return address) does not get translated. The host should recognize the PING, but the host isn't aware of the net that the guest is on because that's the responsibility of NAT itself, not the host. Therefore, the guest never gets a response from the PING, because the host got it and responded to the wrong return address. This works just the same the other way around too.
Soulthiefuk2000
Posts: 11
Joined: 12. Apr 2008, 18:21

Post by Soulthiefuk2000 »

Sorry to disagree.

LAN - Local Area Network

It may not be on a differant LAN but is on a differant subnet. Ping does work over NAT. This has nothing to do with packet headers but ping not working correctly with VirtualBox is a 'feature' of VB's version of NAT not a limitation of NAT. My Internet router uses NAT (as do millions of others) and I can ping Internet hosts fine.

tom909,

If you want to connect to the guest from the host you need to 'bridge' between the 2 networks. The network the guest is on is invisible to the network the host is on (because the host simulates a NAT router). If you still have problems let me know and I'll try and help.

thank,

John.
gboswellsac
Posts: 16
Joined: 8. Sep 2008, 06:11

Re: cant ping the guest from the host

Post by gboswellsac »

John, with VPC there is no problem. I can ping and use WinSCP from the XP host and Fedora guest. Are you saying VB has a subset/whatever that prevents the host from ssh ing the guest? I'm in an University environment and we have used VPC to isolate guests from the host for students to use and allowed WinSCP from the XP host and Fedora guest so students can get access to files created on the guest (no USB access in VPC). I'm trying to get VB to replace the VPC since you have USB access in the guest with VB. That was a bust as you need to give host admin rights to allow guest USB access with individual sticks. If VB is blocking ssh from host to guest on nat I'm in deep poop. Bridging brings up security issues as from the guest they can circumvent firewall/anti student activities.

Comments?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: cant ping the guest from the host

Post by Sasquatch »

gboswellsac wrote:John, with VPC there is no problem. I can ping and use WinSCP from the XP host and Fedora guest. Are you saying VB has a subset/whatever that prevents the host from ssh ing the guest? I'm in an University environment and we have used VPC to isolate guests from the host for students to use and allowed WinSCP from the XP host and Fedora guest so students can get access to files created on the guest (no USB access in VPC). I'm trying to get VB to replace the VPC since you have USB access in the guest with VB. That was a bust as you need to give host admin rights to allow guest USB access with individual sticks. If VB is blocking ssh from host to guest on nat I'm in deep poop. Bridging brings up security issues as from the guest they can circumvent firewall/anti student activities.

Comments?
This topic is more than a year old. Why did you respond to a reply when a lot has already changed? All the things that were discussed here are mostly invalid now. The only thing that IS still valid, is the inaccessibility of the Guest from the Host when using NAT.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply