Page 1 of 1

NAT Port Forwarding in Virtualbox 4.3

Posted: 18. Oct 2013, 10:31
by Dr_Tralala
Hi,

I'm using Virtual Box (VirtualBox-4.3.0-89960-Win.exe) on a 64 Bit windows 7 host to run a Debian Wheezy Inside the VM. The Debian should be used for development of an embedded arm system. Therefore, I set up a TFTP server in the Debian system according to this "/installing-and-testing-tftpd-in-ubuntudebian/" (Check the phrase in google (first entry). Sorry, I'm not allowed to post the uxl . . .).

I would like to use the TFPT during downloading of the embedded Linux kernel and user software to the embedded device during development.

I use NAT as networking interface in the Virtual Box. I set up the Port forwarding in for the TFTP UDP port 69 in the Virtualbox GUI.

Since the 4.3 release notes of Virtualbox says that the NAT prot forwarding is fixed, i was pretty confident that it is working, now. I did have problems with that during the last 2 weeks or so. I was never able to acces the TFTP server inside the VM through NAT with port forwarding (using Virtualbox 4.2). Now, that I installed the 4.3 version of virtual box, it is still not working.

I set up a the same VM in VMware Player (Version 4.0.5). I also use NAT with Port forwarding, there. Everything is working in the solution without any problems.

I really would prefer to use Virtualbox instead of VMware player. Can somebody tell me why the NAT port forwarding is still not working in Virtual Box 4.3?

Regards,
Maik

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 18. Oct 2013, 14:59
by Dr_Tralala
Okay, in my desperate efforts to find a solution for this, I found out that Virtualbox provides a TFTP server itself for PXE booting (I think this is something similar of what I try to implement on my guest system).

Because of the fact that Virtualbox provides an TFTP service itself, will it additionally forward the UDP port 69 requests to the guest? I can imagine that this is not the case because I don't know, how the UDP client should distinguish between the TFTP answer of the VirtualBox server or the VirtualBox clients server answer.

I have not found a possibility to turn the Virtualbox TFTP server off. Is it possible? Did somebody ever successfully run a TFTP server on a Virtualbox client over NAT with port forwarding?

Regards,
Maik

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 20. Oct 2013, 10:23
by noteirak
Don't use NAT for deployment. NAT is designed as an easy networking mode for people without any special need.
If you have any special or technical need like OS deployment, swtich to a proper networking mode : internal, host-only or bridged. But certainly not to NAT.

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 20. Oct 2013, 15:42
by Dr_Tralala
Hi noteirak,

thanbks for your answer!

I really would like to use bridged networking, believe me. But as soon as I install the bridged network adapter on my Windows 7 64 bit system, I'm not able to use our domain network as I'm used to it. It is not possible to connect to other clients in the same domain for e.g. file exchange etc., anymore.

That's why I started to use NAT. We also already succesfully set up a git server in the virtual box via NAT and port forwarding. This one works flawless (maybe because it is a TCP port ?!?).

So I can choose between bridged networking and not beeing able to use our Windows domain network properly, or I can use NAT without any chance to use my reqired TFTP server. I really would like to be able to use the virtual box, but it's network interfacing is driving me crazy. I really would appreciate if somebody could have e deeper look into my problems and provide me with some help.
Because of the fact that I do not find much posts with equal problems (although there are some, but the solutions do not work for me), I hope that there is a problem with my procedures or understanding of using virtual box.

So if I do have to provide additional informations for you to be able to help me, I would do so . . . . I just don't know, what this could be as I pointed out the problems like I observe them on my system.

Regards,
Maik

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 20. Oct 2013, 21:17
by noteirak
Why can't you use your domain anymore? I don't see any reason for this but a bad network configuration or security features in the network that blocks it.

I have found this in the depths of the user manual. Could you give it a try please?

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 21. Oct 2013, 08:24
by jorgensen
I find it strange you are trying to do development requiring Ethernet interface on a domain network where you have no control of the gateway etc.

Unless you require Ethernet connection to an external device you can use the host-only network between the guest and host which you have full control of. Otherwise you can use another NIC for development, which could be an USB device.

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 21. Oct 2013, 09:34
by Dr_Tralala
@noteirak: Honestly, I don't know WHY I cannot use the domain network anymore. I just see that it is not working as expected. As soon as I install the bridged network adapter of Virtualbox (without even starteing the Virtualbox application or a virtual machine), I'm not able anymore to see (or even to find) other domain computers in teh windows explorer. Needless to say that I'm not able to acces the shared folders on those other workstations anymore, too. It's strange that I still can use the internet and have acces to my server based home folder . . . .
Maybe you are right that there is something wrong with our network configuration, but why is it working by using VMWare player, right away? (Both, bridged ethernet adapter and NAT with port forwarding?)
And why e.g. is our git server working that listnes on a TCP port in a NAT connected Virtualbox machione?

@jorgensen: I don't know, if it is strange, or not. The envirnment is just like it is. I have to connect my board, I would like to develop for, to our network, so that the bootloader (Das U-Boot) can get Kernel and Filesystem data from my development machine via TFTP. That is all I ask and I think should be a common task also via a company network that uses switches and hubs, etc. I don't think that i have to cross a gateway because all takes places within the same subdomain (but I ahve to admit that I'm not a network expert, so I don't really know.)
Additionally my computer, where i do the development on (inside the virtual machine) ans also the virtual machine itself should have acces to the internet.

So i really think that the main questions are: Is it possible to turn off the TFTP server of Virtual Box in order to sort out if thiss affects my intentions to set a TFTP server via NAT in my virtual box? I will have a deeper look into the link that noteriak provided) and what could be the rootcause for not beeing able to use the bridged network adapter without affecting the networking of the host? Additionally one could ask why is everything working out of the box if i use VMware Player?
Again, I really would like to use Virtualbox because I'm a big fan of open source and it's community. So I still hope that there is a solution for my issues.

Regards,
Maik

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 21. Oct 2013, 11:16
by BillG
My guess is that it is caused by a conflict between the NIC driver for your physical NIC and the bridged network driver. These two have to work together for bridged networking to function correctly. It has nothing to do with the guest OS. Problems with networking on the host after installing bridged networking usually boil down to this sort of problem.

Have you checked for an updated x64 Win 7 driver for your network card? If that doesn't work, the only realistic solution is to install two NICs in the host and dedicate one to the host and one to the bridged vm(s).

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 22. Oct 2013, 01:47
by vushakov
Dr_Tralala wrote:I use NAT as networking interface in the Virtual Box. I set up the Port forwarding in for the TFTP UDP port 69 in the Virtualbox GUI.
Port 69 is a priviliged port, so if you ask NAT to forward host port 69 to the guest, NAT (which runs unpriviliged) cannot create a listening socket for it. It probably even tells you that in the VM log:

Code: Select all

00:00:05.683388 NAT: failed to redirect UDP 69 => 69

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 22. Oct 2013, 09:09
by noteirak
vushakov wrote:if you ask NAT to forward host port 69 to the guest, NAT (which runs unpriviliged) cannot create a listening socket for it.
That only applies for UNIX type of hosts, this is a Windows host and will work.

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 23. Oct 2013, 14:39
by Dr_Tralala
Hi guys,

thanks for all your contributions to the problem.

Finally, I was able to at least access my TFTP server in the Linux client (via NAT) by changing the UDP listening port from 69 to 66. Since I'm not that a linux admin expert, it took me some time to figure out the procedures for changing a default listening port, but finally managed it.
So, now, I can see in the xinetd log files, that there is somebody accessing the TFTP server on port 66. This means, that NAT port forwarding is working in Virtualbox 4.3 . . .

I really think, that the internal TFTP server of virtualbox blocks the port 69 for itself (as vishakov says).

In the end, it was all a little bit too complicated and I checked if the bridged Ethernet adapter is working well with my host domain network in Virtualbox 4.3 and it really turned out, that the problems I had with Virtualbox 4.2.x disappeared and I can use the TFTP server vie bridged Ethernet on port 69, now.

Really funny . . .

Okay, thanks again, and at least I do know now how to change default ports for Linux server services . . . ;-)

Regards,
maik

Re: NAT Port Forwarding in Virtualbox 4.3

Posted: 23. Oct 2013, 15:42
by vushakov
Dr_Tralala wrote:I really think, that the internal TFTP server of virtualbox blocks the port 69 for itself (as vushakov says).
I did not say that.