How to forward host ports of < 1024 to a VirtualBox NAT-connected machine?

7,137

As clarified in the VirtualBox documentation, that is a well known limitation of the NAT mode. You could do two different things.

  1. Forward ports through NAT

    VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,80000,,80"

  2. Switch to the "Bridged Networking" mode

Reading from the documentation:

This is for more advanced networking needs such as network simulations and running servers in a guest. When enabled, VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system's network stack.

Share:
7,137

Related videos on Youtube

Gargaroz
Author by

Gargaroz

Updated on September 17, 2022

Comments

  • Gargaroz
    Gargaroz over 1 year

    The manual says: "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".

    Is it possible to disable this limitation? I run main internet services (such as mail server, for example (SMTP, IMAP, LDAP, HTTP, HTTPS), as VBoxHeadless machines and capture host's ports by VBoxManage modifyvm --natpf1). The only solution I can see now is capturing a higher port and redirecting traffic meant for a lower port by means of iptables or redir. But maybe there is more natural solution?