버추얼 박스 설명서 6.3.1. Configuring port forwarding with NAT에 있습니다.
[quote:3isornd0]
You will need to know which ports on the guest the service uses and to decide which ports to use on the host (often but not always you will want to use the same ports on the guest and on the host). You can use any ports on the host which are not already in use by a service. For example, to set up incoming NAT connections to an ssh server in the guest, use the following command:
[code:3isornd0]VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,2222,22"[/code:3isornd0]
With the above example, all TCP traffic arriving on port 2222 on any host interface will be forwarded to port 22 in the guest. The protocol name tcp is a mandatory attribute defining which protocol should be used for forwarding (udp could also be used). The name guestssh is purely descriptive and will be auto-generated if omitted. The number after --natpf denotes the network card, like in other parts of VBoxManage.
To remove this forwarding rule again, use the following command:
[code:3isornd0]VBoxManage modifyvm "VM name" --natpf1 delete "guestssh"[/code:3isornd0]
If for some reason the guest uses a static assigned IP address not leased from the built-in DHCP server, it is required to specify the guest IP when registering the forwarding rule:
[code:3isornd0]VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,2222,10.0.2.19,22"[/code:3isornd0]
This example is identical to the previous one, except that the NAT engine is being told that the guest can be found at the 10.0.2.19 address.
To forward all incoming traffic from a specific host interface to the guest, specify the IP of that host interface like this:
[code:3isornd0]VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,127.0.0.1,2222,22"[/code:3isornd0]
This forwards all TCP traffic arriving on the localhost interface (127.0.0.1) via port 2222 to port 22 in the guest.
It is not possible to configure incoming NAT connections while the VM is running. However, you can change the settings for a VM which is currently saved (or powered off at a snapshot).
[/quote:3isornd0]
22번으로 바로 포워딩은 못하고 2222 등의 포트를 게스트의 22번으로 포워딩하다고 합니다.
게스트 오에스가 실행될 때는 설정이 되지 않고 저장되거나 끝났을 때 설정이 된다고 합니다.