- Make sure VM is shutdown
- Go to Network settings of the VM you want to SSH in
- Generally the first Adapter is set to NAT. Go to Advanced and click in Port Forwarding
- Create a new rule (click in the icon with a "+" sign) and enter:
Name | Protocol | Host IP | Host Port | Guest IP | Guest Port |
---|---|---|---|---|---|
ssh | TCP | 2222 | 22 |
- Click OK and start the VM (can start in headless mode if you prefer)
- Connect with
ssh -p 2222 [user]@127.0.0.1