When you deploy a VirtualBox guest system, it will not, by default, be accessible from your local system. The guest systems are not connected to the same network as your local machine. In order to SSH into one of the guest system, you will need to setup port forwarding of the guest system’s network adaptor.

Version Notes: Created on September 19, 2023. Covers version 7.0.10 of Oracle VirtualBox on Windows 11 and PuTTY v0.79.
Update the Virtual Guest Settings
- Launch the VirtualBox Manager
- Select the machine you want to configure on the left
- Click Settings

Open Network Adapter Settings
- Click the Network tab on the left
- Adapter 1 should be enabled and Attached to NAT
- Click the triangle to expand the Advanced settings if not already displayed
- Click the Port Forwarding button

Add Port Forwarding Rule
Network Address Translation (NAT) allows you to connect to a port on your local system and have that traffic directed to a different port on the guest system. We will set this up so that when we connect to the localhost using a certain port, it will connect to the SSH port on the guest.
- Click the Plus button to add a new rule.
- Name: Give it any name you choose.
- Host Port: Enter a Host port. This is the port number you will use on the host to start the connection.
- This can be any number (within reason)
- I chose 2215 for this system, but most any number will work.
- This number must be unique across all your virtual guests
- This can be any number (within reason)
- Guest Port: Select a Guest port. This is the port on the VM that you want to connect to.
- SSH listens on port 22 so that is port we will provide.
- Click OK
- Click OK again to return to the VirtualBox Manager

Connect via PuTTY
If you are using OpenSSH, you can skip this section.
- Download the PuTTY SSH client
- Launch the executable
- Host Name: 127.0.01
Port: The host port you enter on the previous step.
Saved Sessions: Enter a name to save this session as. This can be anything.
- Host Name: 127.0.01
- Click Save
- Click Open to launch the connection

Connect via OpenSSH
You can also connect using OpenSSH from a Windows Terminal.
$ ssh -p 2215 localhost
All Done
You should get the standard warning asking you to confirm the fingerprint. You should then have a command prompt on your VirtualBox guest system.