VBoxManage list natnetworks
VBoxManage natnetwork add --netname NATNetwork101 --network "192.168.10.0/24" --enable
VBoxManage list natnetworks
NetworkName: NATNetwork101 IP: 192.168.10.1 Network: 192.168.10.0/24 IPv6 Enabled: No IPv6 Prefix: fd17:625c:f037:2::/64 DHCP Enabled: Yes Enabled: Yes
VBoxManage natnetwork modify --netname NATNetwork101 --dhcp on
VBoxManage natnetwork start --netname NATNetwork101
Forward localhost port 1022 to 192.168.10.5:22 (eg: SSH)
VBoxManage natnetwork modify --netname NATNetwork101 --port-forward-4 "ssh:tcp:[]:1022:[192.168.10.5]:22"
VBoxManage natnetwork remove --netname NATNetwork101
VBoxManage modifyvm UbuntuVM --nic1 NATNetwork101