Page 1 of 1

[Solved] unable to perform port forwarding...

Posted: 10. Mar 2009, 22:35
by jman22
Hello! Will someone please tell me where I am going wrong in my steps? I am using a FRESH Ubuntu 8.10 (not even updates), the VBOX GUI, iptables rules flushed, and all CLI commands are ran from a non-root user account...

1. create xp from iso (created new virtual disk)
2. close out VirtualBox GUI
3. run user@ubuntu:~$ VBoxManage setextradata "xp2" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/GuestPort" 81
4. run user@ubuntu:~$ VBoxManage setextradata "xp2" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/HostPort" 81
5. run user@ubuntu:~$ VBoxManage setextradata "xp2" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/Protocol" TCP
6. output of VBoxManage getextradata "xp2" enumerate

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/LastWindowPostion, Value: 1647,371,640,527
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/GuestPort, Value: 81
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/HostPort, Value: 81
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/Protocol, Value: TCP

7. start VBOX GUI and verify xp vm settings are NAT
8. Start xp VM
9. VirtualBox error - failed to start vm xp2

NAT#0: configuration error: failed to set up redirection of 81 to 10.0.2.15:81. Probably a conflict with existing services or other rules (VERR_NAT_REDIR_SETUP).
Unknown error creating VM (VERR_NAT_REDIR_SETUP).


Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
Console
Interface:
IConsole {e3c6d4a1-a935-47ca-b16d-f9e9c496e53e}

I think I'm doing what the white papers say. Any help would be much appreciated. Thanks...

Re: unable to perform port forwarding...

Posted: 10. Mar 2009, 22:51
by Sasquatch
In Linux, a non-root user can't open ports below 1024. Why do you think they give the example of mapping port 22 to 2222, and not just 22, or 222?

Re: unable to perform port forwarding...

Posted: 10. Mar 2009, 22:53
by frank
Please refer to the user manual section 6.4.3. In short: A host port < 1024 will not work on Linux hosts. Just use another port >= 1024 on the host side and your VM will start fine.

Re: unable to perform port forwarding...

Posted: 10. Mar 2009, 23:50
by jman22
Hi guys, thanks so much for helping me with this.

Changed host port to 1025, guest port to 8080:

(same error)
NAT#0: configuration error: failed to set up redirection of 1025 to 10.0.2.15:8080. Probably a conflict with existing services or other rules (VERR_NAT_REDIR_SETUP).
Unknown error creating VM (VERR_NAT_REDIR_SETUP).


Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
Console
Interface:
IConsole {e3c6d4a1-a935-47ca-b16d-f9e9c496e53e}

I actually got the same error as before when trying the 22 to 2222 example after googleing, so I left mapping 81 to 81 in my original post, which was wrong. Sorry.

Any information I can give you guys to shed some more light on the issue?
Thanks again

Re: unable to perform port forwarding...

Posted: 11. Mar 2009, 00:21
by Sasquatch
Check your <machine>.xml file and remove any port forwarding rules, then execute this:

Code: Select all

VBoxManage setextradata "xp2" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/GuestPort" 8
VBoxManage setextradata "xp2" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/HostPort" 8080
VBoxManage setextradata "xp2" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/web/Protocol" TCP
Make sure that there isn't a service already listening to port 8080 like a local proxy on the Host.

Re: unable to perform port forwarding...

Posted: 12. Mar 2009, 00:02
by jman22
Sasquatch, thanks for your help again! I was able to find what I was looking for.

Re: unable to perform port forwarding...

Posted: 20. Aug 2009, 16:07
by SIFE2
thx ,this help me .