Forward port with Nat don't work but my config seem good

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Debianuser
Posts: 19
Joined: 23. Apr 2009, 16:07
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian

Forward port with Nat don't work but my config seem good

Post by Debianuser »

Hi,

On a Windows Xp pro host, I 've installed the VirtualBox 2.2.0 (update of 2.1.4).

I have four guest Os, two Debian Etch and One Lenny. The lenny one is just to see the not so new version of Debian.
One of the Etch, lets name it guestClone came from an image of a physical machine (I must have do some trick to install it on a virtual disk smaller but it work). And it's on this one that I try to forward ssh service.

I try to putty my guestClone from my host or another machine on same network. none reach the guestClone

On the guestClone, openssh daemon listen to all network.

I have setting the forward port with VBoxmanage for my guestClone (I used the name of the guest, UUId complain so I hope its ok and not set on snapshot) like this, extrac of virtual xml config :
<ExtraDataItem name="VBoxInternal/devices/pcnet/0/Lun#0/Config/guestssh/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/devices/pcnet/0/Lun#0/Config/guestssh/HostPort" value="2222"/>
<ExtraDataItem name="VBoxInternal/devices/pcnet/0/Lun#0/Config/guestssh/GuestPort" value="22"/>
Pcnet is the correct network card, guestssh a arbritary name only used in this place and 2222 is not used on windows.

I 've tried putty with this parametre
localhost:2222
127.0.0.1:2222
10.0.2.2:2222
10.0.2.15:2222(which the ip of the guest)
and the ip of the host too.
No network connection, and with the private ip 10.0.2.x, paquet are sent to my gateway.

Host do not firewall on. I have tested without the antivirus too. Still don't work.

Putty work because I connect to my other machine. Network on the guest work because I connect to internet from it.
So why VirtualBox engine don't intercept my query ? What I have done wrong ?

On host, netstat command don't give 2222 in listen state, but I think it's ok if VirtualBox intercept connection rather than listen to network, no ?

I 'll try later other setting for the network's guest like bridge or something but I need to read the doc for that.

Nat seem better for my purpose, only forward needed service and separate network feat my need. So, I wish it could run.

Thanks for you help,

Debian User
Last edited by Debianuser on 24. Apr 2009, 10:33, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Forward port with Nat don't work but my config seem good

Post by Perryg »

Switch from NAT to bridged mode and give that a try.
Debianuser
Posts: 19
Joined: 23. Apr 2009, 16:07
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian

Re: Forward port with Nat don't work but my config seem good

Post by Debianuser »

Hi,

After checked the manual for the brigde mode, I give it a try.

I was facing the same problem Virtual Box 2.2.0 Bridged Networking. As explain in this post, the repair install correct that.

I have try again Nat to see if my problem was not related but don't work either.

With bridge mode set to guestclone, I connect to the guestClone via Putty. That prouve that guestClone network+sshd is working.

But I don't understand why the forward port with Nat don't work.

One suspect could be the antivirus. It have a firewall filter in the network interface. Nothing is filter but I know it could break some VPN product. Anyone use TrendMicro and forward port with Nat for guestOs ?

Debianuser
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Forward port with Nat don't work but my config seem good

Post by Sasquatch »

I don't use that. You need to check if the Guest actually has a working network connection with NAT. Sometimes, the DHCP doesn't respond during boot. I've had that a couple of times with my Linux VMs. Setting the second NIC to NAT could help, but you need to change the port forward rules too by editing the XML file. A dhclient on the guest after boot can help when you don't have an IP address.
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.
Debianuser
Posts: 19
Joined: 23. Apr 2009, 16:07
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian

Re: Forward port with Nat don't work but my config seem good

Post by Debianuser »

Hi,

For all my test, guest was able to connect to internet (tested by launching aptitude update as ping could not work with nat).

I just see the post about Nat problem My Linux guest and NAT does work in VBox2.2 in Linux Guest section (the search engine don't seem to work well, nat research didn't give result).

I don't have this problem but perhaps, if I set the nat on card two, it can solve the forward port thing (it's my only network problem).

I give it a try, setting second card (don't use the first and config my Guest according) and port forwarding (rule for the second net card pcnet/0 => pcnet/1 )on another VBguestEtch.
But it don't work either. to complet the test I try again bridge mode and this method it work on this second guest.

For a reason, I don't see, the VirtualBox don't intercept paquet for the guest. Are my settings incorrects ?

I use the name of the virtual guest to set Extradata (no the UUID or Snapshot name).

I putty localhost or 127.0.0.1 or the ip of the host with the HostPort (2222).

When I try ip of the guest it goes on the gateway (I think it's Ok because of Nat and nothing tell to host to go on VB).

Debianuser
Debianuser
Posts: 19
Joined: 23. Apr 2009, 16:07
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian

Re: Forward port with Nat don't work but my config seem good

Post by Debianuser »

Hi,

I try again Nat with port forwarding ssh (guest/22 and host/2222), see at the log. It seem the config is taken in account :
00:00:00.831 [/Devices/pcnet/] (level 2)
00:00:00.831
00:00:00.831 [/Devices/pcnet/0/] (level 3)
00:00:00.831 Trusted <integer> = 0x0000000000000001 (1)
00:00:00.831 PCIDeviceNo <integer> = 0x0000000000000003 (3)
00:00:00.831 PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:00.831
00:00:00.831 [/Devices/pcnet/0/Config/] (level 4)
00:00:00.831 Am79C973 <integer> = 0x0000000000000001 (1)
00:00:00.831 MAC <bytes> = "08 00 27 3b bb 18" (cb=6)
00:00:00.831 CableConnected <integer> = 0x0000000000000001 (1)
00:00:00.831 LineSpeed <integer> = 0x0000000000000000 (0)
00:00:00.831
00:00:00.831 [/Devices/pcnet/0/LUN#999/] (level 4)
00:00:00.831 Driver <string> = "MainStatus" (cch=11)
00:00:00.831
00:00:00.831 [/Devices/pcnet/0/LUN#999/Config/] (level 5)
00:00:00.831 papLeds <integer> = 0x0000000000e67498 (15103128)
00:00:00.831
00:00:00.831 [/Devices/pcnet/0/LUN#0/] (level 4)
00:00:00.832 Driver <string> = "NAT" (cch=4)
00:00:00.832
00:00:00.832 [/Devices/pcnet/0/LUN#0/Config/] (level 5)
00:00:00.832 TFTPPrefix <string> = "C:\Documents and Settings\myprofil\.VirtualBox\TFTP" (cch=74)
00:00:00.832 BootFile <string> = "VBLenny.pxe" (cch=12)
00:00:00.832
00:00:00.832 [/Devices/pcnet/0/Lun#0/] (level 4)
00:00:00.832
00:00:00.832 [/Devices/pcnet/0/Lun#0/Config/] (level 5)
00:00:00.832
00:00:00.832 [/Devices/pcnet/0/Lun#0/Config/guestssh/] (level 6)
00:00:00.832 Protocol <string> = "TCP" (cch=4)
00:00:00.832 GuestPort <integer> = 0x0000000000000016 (22)
00:00:00.832 HostPort <integer> = 0x00000000000008ae (2222)

But still connection refused when I try putty on localhost/2222. Connection refused mean no service available at this state.

It's very strange that this function don't work so unless I make mistake in writing the line (case sensitive ?), the Trend Micro filter is probably in cause :

<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/Lun#0/Config/guestssh/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/Lun#0/Config/guestssh/GuestPort" value="22"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/Lun#0/Config/guestssh/HostPort" value="2222"/>

++
Debianuser
Post Reply