Thanks for the info. OK, the VM is on NAT:
<Adapter slot="0" enabled="true" MACAddress="08002754FAF1" type="82540EM">
...
<NAT localhost-reachable="true">
<Forwarding name="Rule 1" proto="1" hostip="10.0.2.16" hostport="2022" guestip="10.0.2.17" guestport="22"/>
</NAT>
</Adapter>
I was able to run a NAT connection in a VM on a static IP address within the 10.0.2.0/24 range used by NAT, so it appears that your static IP of 10.0.2.17 in the VM should be OK. Can you ping 8.8.8.8 in the VM?
However, the port forwarding rule still has the issues it had before:
scottgus1 wrote:Try removing the 'host IP'.
Virtualbox Networks in Pictures: NAT wrote:When opening a port, you only need to set the host and guest port numbers. The traffic only goes through that one card, so the port forwarding rule does not need to know the IP address of the card.
Also, from the tutorial, NAT connects to the host network stack, and the host is in the "public" (WAN) side of the NAT "router". The VM is on the "private" (LAN) side if the router.
You tried to go through the NAT "router" by using a NAT LAN-side "private" IP address of 10.0.2.16, from the "public" side, the host. This won't work; that's not how one goes through a router.
To get through a router to a computer in the router's private LAN from the public side, you don't try to get in using an IP address in the router's LAN. You go into the router from the router's public WAN side's IP address, through a port in the router's port forwards:
public IP address : port# > router > private IP address : port# > PC
Virtualbox Networks in Pictures: NAT wrote:The host can connect to the NAT-connected card via: localhost:portnumber.
Other guests, internet and the LAN can connect to the NAT-connected card via: host.ip.add.ress:portnumber
You should access the VM behind NAT using the public WAN side IP address. The public WAN side of NAT is the host. So on the host, you'd access via
127.0.0.1:2022. From another computer in the host's network, you'd access the VM via the host's LAN IP address
172.21.50.63:2022