HOW TO SSH TO LINUX ON VIRTUALBOX

Published: December 1, 2025 (Updated: Dec 1, 2025)

Enjoying this content? Subscribe to the Channel!

Solve the SSH Timeout: Connecting to VirtualBox Linux VMs (CentOS, Ubuntu) from Your Windows Host


Hi there! This is Darren from Darren’s Tech Tutorials, and if you’ve been struggling to SSH into your Linux virtual machine running on VirtualBox, you’re not alone. It’s one of the most common frustrations when setting up a local development environment!

You set up your CentOS, Ubuntu, or Debian VM, fire up PuTTY on your Windows host machine, try to connect, and… timeout. Every single time.

Why does this happen? The default network settings in VirtualBox isolate your guest machine. The good news is that the fix is incredibly simple, and once configured, you’ll be able to seamlessly manage your VM without ever needing the VirtualBox GUI again.

We’re going to dive into why the connection fails and then implement the quick, two-step fix to enable seamless SSH access.


The Problem: Why Your SSH Connection Times Out

When you first install a guest operating system (like CentOS 9) in VirtualBox, the default networking mode is set to Network Address Translation (NAT).

NAT is great for giving your VM access to the internet, but it hides the VM from your host network. Think of it like this: your VM is behind a private firewall, and your Windows host machine doesn’t know how to route its SSH request through that wall directly.

If you try to use an SSH client like PuTTY or SecureCRT with the VM’s local (NAT) IP address, the connection attempt stalls and eventually results in a frustrating timeout error.

To fix this, we need to change the networking mode so that the VM receives an IP address directly from your home or office router, placing it on the same network segment as your Windows host machine.


The Simple Fix: Switching to a Bridged Network Adapter

To establish direct SSH connectivity, we need to change the network setting from NAT to Bridged Adapter. This effectively makes your VM look like a separate physical machine on your local network.

Follow these simple steps:

Step 1: Power Off the Virtual Machine

  • Crucial step! You cannot modify the network settings of a running VM.
  • Right-click on your Linux VM in the VirtualBox Manager.
  • Select Close > Power Off. Wait until the machine is completely shut down.

Step 2: Access VirtualBox Network Settings

  • In the VirtualBox Manager, right-click on the powered-off VM.
  • Click Settings.
  • In the left-hand navigation menu, click Network.

Step 3: Change Adapter Mode to Bridged

  • Under the Adapter 1 tab, look for the dropdown menu labeled Attached to:
  • Change the selection from NAT to Bridged Adapter.
  • Ensure that the Name field lists the network card associated with your Windows host machine (e.g., your physical Ethernet or Wi-Fi adapter).
  • Click OK to save the settings.

Step 4: Power On the VM

  • Start your virtual machine as you normally would.

Confirming Connectivity and Logging In via PuTTY

Once the VM is booted up using the Bridged Adapter, it will request a new IP address from your router. This new address will be on the same subnet as your Windows host, meaning they can now talk directly!

Step 5: Find the New IP Address

  • Log into your Linux VM via the VirtualBox GUI console.
  • Open a terminal window.
  • Run the command ifconfig (or ip a if your distribution uses the newer command).
  • Look at the network interface information (usually eth0 or enp0s3). You should now see an IP address that belongs to your local network (e.g., 192.168.0.137).

Step 6: SSH from Your Windows Host

Now that you have the correct IP address, you can connect from your Windows host machine using your favorite SSH client (like PuTTY):

  1. Open your SSH client.
  2. Enter the newly acquired IP address (e.g., 192.168.0.137) into the Host Name field.
  3. Click Open.

If successful, you will be prompted for your login credentials (username and password). Enter them, and you are officially connected!


You can now run commands, manage services, and interact with your virtual machine seamlessly via SSH, eliminating the need to constantly switch back and forth to the VirtualBox console interface.

Happy connecting! If this quick guide helped you solve your SSH headache, please hit the like button and subscribe to Darren’s Tech Tutorials for more clear, actionable guides. If you ran into any issues, please leave a comment below—I always do my best to help out!