• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Solutions

Oracle VirtualBox: Port Forwarding in NAT Network Mode

neo by neo
May 27, 2025
in Solutions
0
Oracle VirtualBox: Port Forwarding in NAT Network Mode

Oracle VirtualBox: Port Forwarding in NAT Network Mode

0
SHARES
96
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Port Forwarding with Oracle VirtualBox

Oracle VirtualBox is a powerful virtualization tool used by developers and system administrators to create and manage virtual machines. When using the NAT (Network address translation) network mode, virtual machines are isolated from the host machine and the internet unless specific networking configurations are made. One common requirement is port forwarding, which allows access to services (like SSH, HTTP, or database servers) running on the VM from the host machine or even other devices on the network.

In this article, we’ll walk you through how to set up port forwarding in VirtualBox using the NAT network mode—a useful setup when you want to access VM services without using bridged or host-only adapters.

What is NAT Network Mode?

NAT (Network Address Translation) network mode allows VMs to access the internet by sharing the host’s IP address, while remaining isolated from the local network. This mode is useful for simulating a network of VMs behind a router-like interface.

By default, inbound traffic from the host or external network is blocked. To enable access to specific services (like an SSH or web server running on the VM), you need to configure port forwarding.

ADVERTISEMENT

Prerequisites

  • Oracle VirtualBox installed on your system
  • At least one virtual machine configured and using NAT or NAT Network mode
  • A service (e.g., SSH, HTTP) running inside the VM
  • Optional: Guest Additions installed

Steps to Configure Port Forwarding

Step 1: Open Oracle VirtualBox Settings for the VM

Start by opening Oracle VirtualBox and selecting the virtual machine you want to configure. Click right click on it and “Settings” to access the VM’s configuration menu. Once you’re in the settings window, follow the steps below to set up port forwarding.

  1. Open VirtualBox Manager
  2. Select your VM and click on Settings
Oracle VirtualBox VM Settings

Step 2: Configure Port Forwarding

ADVERTISEMENT
  1. Navigate to the Network tab
  2. Click Port Forwarding
Oracle VirtualBox VM Network Settings

Here you can add rules:

ADVERTISEMENT
  • Name: SSH
  • Protocol: TCP
  • Host IP: leave empty or 127.0.0.1
  • Host Port: e.g., 2026 for SSH
  • Guest IP: optional, usually leave empty
  • Guest Port: e.g., 22 for SSH or 3389 for RDP (Remote Desktop Access)
Oracle VirtualBox Port Forwarding Rules Settings

Step 3: Access the Service from Host

After starting the VM, you can now access the services like this:

  • SSH into the VM:
ssh -p 2026 user@127.0.0.1
Tips and Notes
  • Avoid port conflicts on the host.
  • You can use other ports like 3306 for MySQL or 5432 for PostgreSQL.
  • To access from external devices, set Host IP to the host’s actual IP address.

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Remote Desktop Access to Ubuntu 24.04 from Windows

Next Post

Timeshift on Linux: How to Create and Restore System Snapshots

neo

neo

Next Post
Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

Follow Us

  • Trending
  • Comments
  • Latest
MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.