How to Access Your Virtual Machine on VirtualBox Using MobaXterm

If you’re running a Linux-based Virtual Machine (VM) on VirtualBox and want to connect using MobaXterm, you might face network issues. By default, VirtualBox uses NAT (Network Address Translation), which doesn’t allow direct SSH access from your host system.

The solution? Port Forwarding! Follow these simple steps to establish an SSH connection easily.

Watch this step-by-step tutorial on how to access your virtual machine on VirtualBox using MobaXterm before following the written guide.

Step 1: Configure Network Settings in VirtualBox

If your VM has an IP address like 10.0.2.15, it’s using NAT mode. To allow SSH access, we need to enable Port Forwarding.

How to check your VM IP address:

Enable Port Forwarding

  1. Open VirtualBox
  2. Select your VM → Click Settings
  3. Go to the Network tab
  4. Under Adapter 1, ensure it is set to NAT
  5. Click Advanced → Click Port Forwarding
  6. Add a new rule with the following details:
    • Protocol: TCP
    • Host IP: 127.0.0.1
    • Host Port: 2222
    • Guest IP: (Leave blank or enter your VM’s IP, e.g., 10.0.2.15)
    • Guest Port: 22 (for SSH)
  7. Click OK and restart your VM

For your reference:

Step 2: Connect to Your VM via MobaXterm

Now that Port Forwarding is set up, let’s connect using MobaXterm.

  1. Open MobaXterm
  2. Click Session → Select SSH
  3. In the Remote Host field, enter: 127.0.0.1
  4. Set Port to 2222 (as configured in Port Forwarding)
  5. Enter your VM’s username (e.g., oracle, ubuntu, root, etc.)
  6. Click OK to connect

For your reference:

Step 3: Test Your Connection

Once connected, run the following commands in MobaXterm’s terminal:

whoami
ip a

If your VM responds, you’re successfully connected! 🎉

For your reference:

Now, you can securely access and manage your VM using MobaXterm without any hassle.

Bonus Tip: Use SSH Keys for Easier Access

Instead of entering your password every time, you can set up SSH keys for passwordless login, making access more secure and convenient.

Check out this YouTube video to learn how to access your Virtual Machine on VirtualBox using MobaXterm.

Hope this guide helps! Let me know if you have any questions. 🚀

ADVERTISEMENT

Leave a Reply

Your email address will not be published. Required fields are marked *