Introduction
In this article, we will cover the process of setting up a forwarded port for Apache running on an Ubuntu VirtualBox guest operating system, with the guest's Port 80 being accessible on the Windows 11 host through Port 22222. This configuration is particularly useful when you need to access your Apache web server from your Windows 11 host.
Prerequisites
- Apache installed on Ubuntu VirtualBox guest
- VirtualBox installed on Windows 11 host
- Basic knowledge of networking and VirtualBox
Setting Up the Network Adapter
Before we begin, ensure that the Ubuntu guest's network adapter is set to NAT. This configuration allows the guest to obtain an IP address automatically from the VirtualBox DHCP server and enables communication between the guest and the host.
Step 1: Access the VirtualBox Virtual Machine Settings
Open the VirtualBox Manager application on your Windows 11 host. Select the Ubuntu VirtualBox guest and click on the "Settings" button.
Step 2: Modify the Network Adapter
Navigate to the "Network" tab and ensure that the "Attached to" option is set to "NAT". Save the changes and restart the Ubuntu VirtualBox guest.
Forwarding Port 80 (Guest) to Port 22222 (Windows 11 Host)
Now that we have the network adapter configured, we can proceed with forwarding the Apache guest's Port 80 to the Windows 11 host's Port 22222.
Step 1: Access the VirtualBox Manager
Open the VirtualBox Manager application on your Windows 11 host.
Step 2: Modify the Port Forwarding Rules
Select the Ubuntu VirtualBox guest and click on the "Settings" button. Navigate to the "Port Forwarding" tab and click the "Add" button.
Step 3: Configure Port Forwarding
In the "Name" field, provide a descriptive name for the port forwarding rule, such as "Apache to Windows Host". In the "Host Port" field, enter the desired port number on the Windows 11 host, which in this case is 22222. In the "Guest Port" field, enter the guest's Apache Port 80, which is 80 by default.
Step 4: Save the Changes
Save the changes and restart the Ubuntu VirtualBox guest.
Testing the Configuration
Open a web browser on your Windows 11 host and visit . If the configuration is successful, you should see the default Apache webpage.
In this article, we covered the process of setting up a forwarded port for Apache running on an Ubuntu VirtualBox guest, with the guest's Port 80 being accessible on the Windows 11 host through Port 22222. This configuration is useful when you need to access your Apache web server from your Windows 11 host.