π§ͺ Ubuntu VM Web Server Lab (VMware + SSH + Nginx)
A hands-on lab to learn Linux web servers, networking, firewall rules, and real-world troubleshooting (plus how these skills transfer to AWS EC2 and DevOps).
π§° Tech Stack
- Windows 10/11 (Host OS)
- Ubuntu Linux (Guest VM)
- VMware Workstation
- Nginx Web Server
- SSH (from PowerShell)
π― Why I installed Nginx
I installed Nginx to:
Practice hosting a web service on a Linux server
Test networking between Windows (host) and Ubuntu VM (guest)
Learn real-world troubleshooting: firewall, ports, VM networking
Build skills that directly transfer to AWS EC2 and DevOps work
π Setup Overview
Host OS: Windows
VM: Ubuntu on VMware Workstation
Access method: SSH from PowerShell
Goal: Access a web page on the VM from Windows browser
1οΈβ£ Connect to Ubuntu VM via SSH (from PowerShell)
ssh alok@<VM_IP>
2οΈβ£ Install and start Nginx on Ubuntu
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
Verify Nginx is running:
sudo systemctl status nginx
Test locally on the VM:
curl http://localhost
β This confirmed Nginx was working inside the VM.
3οΈβ£ Find the VMβs IP address
hostname -I
Example:
192.168.80.129
4οΈβ£ Try accessing from Windows browser
http://192.168.80.129
β Issue: Page kept loading / timed out
Error:
ERR_CONNECTION_TIMED_OUT
5οΈβ£ Check Ubuntu firewall (UFW)
sudo ufw status
Output showed:
Port 22 (SSH) allowed
Ports 3000, 5000, 8000 allowed
β Port 80 NOT allowed
π§ Fix: Allow HTTP (port 80)
sudo ufw allow 80/tcp
sudo ufw reload
Tried browser again β
Still timing out β meaning firewall wasnβt the only issue.
6οΈβ£ Confirm Nginx was not the problem
sudo systemctl status nginx
curl http://localhost
Result:
Nginx: β running
curl localhost: β works
π Conclusion:
App layer is fine. Problem is networking between Windows β VM.
7οΈβ£ Verify VMware network mode
Checked:
VMware β VM Settings β Network Adapter
Mode: β NAT (already selected)
So NAT wasnβt misconfigured, but NAT services might be broken.
8οΈβ£ Fix VMware NAT networking (host-side issue)
On Windows:
Press
Win + RRun:
services.msc
- Restart:
β VMware NAT Service
β VMware DHCP Service
This fixed the broken network path between Windows and the VM.
9οΈβ£ Test again from Windows
In Chrome:
http://192.168.80.129
β
Nginx page loaded successfully
Problem solved π
π§ Root Cause Summary
| Layer | Status |
|---|---|
| App (Nginx) | β Working |
| Local access | β
curl localhost works |
| Ubuntu firewall | β Port 80 blocked (fixed) |
| VMware NAT service | β Broken on Windows (fixed by restarting services) |
| Browser access | β Timeout β β Works after fixes |
π Troubleshooting Commands Used
On Ubuntu VM
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
curl http://localhost
hostname -I
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw reload
On Windows
ssh alok@<VM_IP>
ping <VM_IP>
Windows UI:
-
services.msc- Restart VMware NAT Service
- Restart VMware DHCP Service
π‘ What this taught me (real-world skills)
How web servers work on Linux
How ports and firewalls affect access
How VM networking (NAT) works
-
How to isolate problems by layer:
- App
- Firewall
- Network
- Host services
This is exactly the same thinking I'll use when:
An EC2 instance wonβt load
A Docker container isnβt reachable
A service times out in production
Top comments (0)