• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
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
103
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.

ADVERTISEMENT

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.

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

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

Here you can add rules:

ADVERTISEMENT
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

Related Posts

Protect Docker-Hosted Application from HTTP Flood (DDoS) Attacks Using a Bash Script
Docker

Protect Docker-Hosted Application from HTTP Flood (DDoS) Attacks Using a Bash Script

Raspberry Pi Monitoring with Monit: Docker, Temperature, Network & More
Solutions

Raspberry Pi Monitoring with Monit: Docker, Temperature & More

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

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

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

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

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

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

Install Docker on Raspberry Pi 4 with Ubuntu 22.04
Docker

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

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

Timeshift on Linux: How to Create and Restore System Snapshots

Recommended

How to Remove Application from an Ubuntu Server using dpkg

How to Remove Application from an Ubuntu Server using dpkg

Linux Real-Time Performance (CPU, Memory Usage) Metrics with htop, atop, nload, and iostat

Linux Real-Time Performance (CPU, Memory Usage) Metrics with htop, atop, nload, and iostat

Protect Docker-Hosted Application from HTTP Flood (DDoS) Attacks Using a Bash Script

Protect Docker-Hosted Application from HTTP Flood (DDoS) Attacks Using a Bash Script

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

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

Recent News

Protect Docker-Hosted Application from HTTP Flood (DDoS) Attacks Using a Bash Script

Protect Docker-Hosted Application from HTTP Flood (DDoS) Attacks Using a Bash Script

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

  • 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.