I have a virtual box running on OS X host. The guest OS is Ubuntu. I want to set up the VM to use NAT. The VM setting part was easy. adapter 1 is set to NAT.
in the host, I entered VBoxManage modifyvm "myvm-name" --natpf1 "guesthttp,tcp,,80,,80"
the command went thru fine, no errors. Then I start the VM and try typing localhost into a browser on the host. no response on it. I verified that apache is running on the guest. so, the port forwarding is failing.
If all works as I wanted, I would like to have all port 80 request on the host to be forwarded to the VM.
Any one can tell what I am doing wrong?
can't make NAT work
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: can't make NAT work
Yes, the user's manual, Chapter 6.3.3, NAT limitations:bhomass wrote:Any one can tell what I am doing wrong?
BTW, you posted in neither "Mac OS X Hosts" nor "Linux Guests" forum, but on "Linux Hosts"Chapter 6.3.3 wrote:Forwarding host ports < 1024 impossible:
On Unix-based hosts (e.g. Linux, Solaris, Mac OS X) it is not possible to bind to ports below 1024 from applications that are not run by root. As a result, if you try to configure such a port forwarding, the VM will refuse to start.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Re: can't make NAT work
sorry about wrong subforum. I am first time poster.
so, are you saying I need to run my apache as root, then forwarding of port 80 would work?
or does it mean the browser requesting localhost:80 (on Mac) needs to be launched by root? normally, the req will be coming from outside the host, so I don't understand this limitation. just who needs to be root?
so, are you saying I need to run my apache as root, then forwarding of port 80 would work?
or does it mean the browser requesting localhost:80 (on Mac) needs to be launched by root? normally, the req will be coming from outside the host, so I don't understand this limitation. just who needs to be root?
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: can't make NAT work
Never run anything as root. What you can do is use host-only and access the guest from the host or if you simply want to use NAT then use a port that is higher than 1024 Forward something like 8080 and then configure the server to handle requests on 8080.
Re: can't make NAT work
reconfigured apache on guest to port 8011
on the host, VBoxManage modifyvm "myvm-name" --natpf1 "guesthttp,tcp,,80,,8011"
still no response when I enter http://localhost on host's browser.
on the host, VBoxManage modifyvm "myvm-name" --natpf1 "guesthttp,tcp,,80,,8011"
still no response when I enter http://localhost on host's browser.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: can't make NAT work
Moved to OS X hosts.
Re: can't make NAT work
I got it now. the 8011 needs to be on the host side, not the guest side.
This really puts me in a bind. The whole idea is that the host will server up a web site from the guest when it receives an external web request. Of course, that request will be in port 80. It would be useless to change that input port request to 8011.
The only option then would be making the request come from root. But how would I do that? the request comes from an external source. It is not an app that is running on the host.
This really puts me in a bind. The whole idea is that the host will server up a web site from the guest when it receives an external web request. Of course, that request will be in port 80. It would be useless to change that input port request to 8011.
The only option then would be making the request come from root. But how would I do that? the request comes from an external source. It is not an app that is running on the host.