Page 1 of 1

NAT/Port-forwarding doesn't work

Posted: 22. Dec 2008, 18:07
by MartinHerrman
Host: Gentoo
Virtual-machine OS: Ubuntu 8.10 server
VM-name: appserver_alfresco_performance_test_training
Virtualbox version: 1.6.6

The VM's configuration:

Code: Select all

martin@martindesktop ~ $ VBoxManage showvminfo appserver_alfresco_performance_test_training
VirtualBox Command Line Management Interface Version 1.6.6
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Name:            appserver_alfresco_performance_test_training
Guest OS:        Ubuntu
UUID:            a6178338-6d8d-403d-eeaa-3ab725b1ce90
Config file:     /home/martin/.VirtualBox/Machines/appserver_alfresco_performance_test_training/appserver_alfresco_performance_test_training.xml
Memory size:     1024MB
VRAM size:       8MB
Boot menu mode:  message and menu
ACPI:            on
IOAPIC:          off
PAE:             on
Time offset:     0 ms
Hardw. virt.ext: on
State:           running (since 2008-12-22T15:48:03.237000000)
Monitor count:   1
Floppy:          empty
SATA:            enabled
DVD:             empty
NIC 1:           MAC: 080027CB3505, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
UART 1:          disabled
UART 2:          disabled
Audio:           disabled (Driver: Unknown, Controller: Unknown)
Clipboard Mode:  Bidirectional
Video mode:      720x400x0
VRDP:            disabled
USB:             disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Shared folders:  <none>

VRDP Connection:    not active
Clients so far:     0

Guest:

Statistics update:                   disabled


martin@martindesktop ~ $                             
I have used the commands in the manual for portforwarding. I want to be able to connect from my host machine to the JBoss install running inside the VM.

Code: Select all

martin@martindesktop ~ $ VBoxManage getextradata "appserver_alfresco_performance_test_training" enumerate
VirtualBox Command Line Management Interface Version 1.6.6
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/LastCloseAction, Value: powerOff
Key: GUI/LastWindowPostion, Value: 313,243,724,456
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/jbossdefault/Protocol, Value: TCP
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/jbossdefault/GuestPort, Value: 8080
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/jbossdefault/HostPort, Value: 8080
Key: GUI/InfoDlgState, Value: 400,450,normal
martin@martindesktop ~ $    
When I use Links in the VM: links http://localhost:8080, JBoss page shows up. When I use firefox on my host machine, http://localhost:8080, gives an error immediately. No firewall running inside VM nor on host.

What could be the problem?

Posted: 22. Dec 2008, 21:49
by TerryE
There's a known problem with VBox 2.1.0 NAT port forwarding, but 1.6.6 should be fine. What does the CFGM dump report? Look for the [/Devices/pcnet/0/LUN#0/Config/jbossdefault] key.

Posted: 23. Dec 2008, 10:15
by MartinHerrman
Hi Terry,

thanks for your reply. This might be stupid, but: what is a CFGM dump? How can I create one? "locate -i cfgm" returns no results, search on google and virtualbox.org doesn't help either..

Thanks,

Martin

Posted: 23. Dec 2008, 11:09
by TerryE
Sorry Martin, you've never had a look at your VBox.log? The Configuration Management Section of the log (CGFM Dump) enumerates the configuration actually loaded into the VM.

Posted: 23. Dec 2008, 11:27
by MartinHerrman
ouch!

Code: Select all

01:28:52.834 [/Devices/pcnet/0/LUN#0/Config/jbossdefault/] (level 6)
01:28:52.834   Protocol  <string>  = "TCP" (cch=4)
01:28:52.834   GuestPort <integer> = 0x0000000000001f90 (8080)
01:28:52.834   HostPort  <integer> = 0x0000000000001f90 (8080)
So that's ok?

Posted: 23. Dec 2008, 11:59
by TerryE
My corresponding host:8080->guest:80 gives:

Code: Select all

00:00:05.104 [/Devices/pcnet/0/LUN#0/Config/guestwww/] (level 6)
00:00:05.104   Protocol  <string>  = "TCP" (cch=4)
00:00:05.104   GuestPort <integer> = 0x0000000000000050 (80)
00:00:05.104   HostPort  <integer> = 0x0000000000001f90 (8080)
The think that leaps out at me is that my VM takes 5 sec to get to this (on a 1.8Ghz laptop) and yours takes 89 sec. Something seems wrong here.

Posted: 23. Dec 2008, 13:09
by MartinHerrman
Ouch again!

Found the issue: I have another VM running, so I tried to connect from that VM to the jboss one. Didn't work either. So I expected that jboss only listens to localhost, which is true.. now I bind jboss to it's external interface and it works :-)

Thanks for your support!