<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: alok-38</title>
    <description>The latest articles on DEV Community by alok-38 (@alok38).</description>
    <link>https://dev.to/alok38</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F825053%2Fb16d725a-ca64-4848-a2c5-e440a36b03c2.jpeg</url>
      <title>DEV Community: alok-38</title>
      <link>https://dev.to/alok38</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alok38"/>
    <language>en</language>
    <item>
      <title>Host a Simple Python App on a Virtual Machine (Step-by-Step)</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Tue, 31 Mar 2026 10:33:13 +0000</pubDate>
      <link>https://dev.to/alok38/host-a-simple-python-app-on-a-virtual-machine-step-by-step-ch7</link>
      <guid>https://dev.to/alok38/host-a-simple-python-app-on-a-virtual-machine-step-by-step-ch7</guid>
      <description>&lt;h1&gt;
  
  
  Serve a Python App from a VM: From Local Server to Public Access
&lt;/h1&gt;

&lt;p&gt;In this guide, we’ll deploy a simple Python HTTP server on an AlmaLinux virtual machine and explore how network traffic flows from the VM to the host machine and beyond. By the end, you’ll be able to access your app from your local network and from external devices using a public tunnel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's learn how to:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set up a Python HTTP server on a VM&lt;/li&gt;
&lt;li&gt;Access the server from the host machine&lt;/li&gt;
&lt;li&gt;Expose the VM to external devices via Localtunnel&lt;/li&gt;
&lt;li&gt;Understand the traffic flow from client to VM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this setup, the AlmaLinux VM runs a Python HTTP server, the Fedora host acts as a KVM/QEMU host and NAT gateway, and the smartphone simulates an external client. We’ll show how to make the server accessible locally and over the internet using a tunnel.&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ Environment Setup
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AlmaLinux 10 VM (Guest)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;IP: &lt;code&gt;192.168.122.88&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Runs the Python HTTP server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Fedora Host&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;IP: &lt;code&gt;192.168.0.136&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Acts as KVM/QEMU host and NAT gateway&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Smartphone / External Device&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Connected via mobile network (e.g., Airtel)&lt;/li&gt;
&lt;li&gt;Accesses the server through a public tunnel
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          ┌─────────────┐
          │ Smartphone  │
          │ (Mobile Data)│
          └─────┬───────┘
                │
                ▼
       ┌─────────────────┐
       │ Public Tunnel   │
       │ (Localtunnel)   │
       └─────┬───────────┘
             │
             ▼
       ┌─────────────┐
       │ Fedora Host │
       │ 192.168.0.136 │
       │ KVM/QEMU + NAT│
       └─────┬───────┘
             │
             ▼
       ┌───────────────┐
       │ AlmaLinux VM  │
       │ 192.168.122.88│
       │ Python HTTP    │
       │ Server :8000   │
       └───────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2️⃣ Start the Python HTTP Server on the VM
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start Python HTTP server on all interfaces, port 8000&lt;/span&gt;
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; http.server 8000 &lt;span class="nt"&gt;--bind&lt;/span&gt; 0.0.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explaination:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The server serves the current directory as a simple web app.&lt;/li&gt;
&lt;li&gt;You can test locally inside the VM:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://127.0.0.1:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Access from the Host Machine
&lt;/h3&gt;

&lt;p&gt;The host machine can reach the VM directly using its private IP. This is useful for testing that the Python HTTP server is running before exposing it externally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Test access from Fedora host&lt;/span&gt;
curl http://192.168.122.88:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  ✅ Expected output:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A directory listing of the files served by the Python HTTP server&lt;/li&gt;
&lt;li&gt;Or the contents of an index.html file if present&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Tip: If you see a connection refused error, make sure the Python server is running and bound to 0.0.0.0.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  Access from External Devices / Smartphone
&lt;/h4&gt;

&lt;p&gt;Smartphones or external devices on a different network cannot reach the VM’s private IP directly. To solve this, we use Localtunnel to create a public HTTPS URL that forwards traffic to the VM.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Node.js and Localtunnel on the VM
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install Node.js and npm (if not already installed)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs npm

&lt;span class="c"&gt;# Install Localtunnel globally&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; localtunnel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start the tunnel
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Forward port 8000 to a public URL&lt;/span&gt;
lt &lt;span class="nt"&gt;--port&lt;/span&gt; 8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Localtunnel will generate a public URL, e.g., &lt;a href="https://hot-deer-send.loca.lt" rel="noopener noreferrer"&gt;https://hot-deer-send.loca.lt&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open this URL in your smartphone browser → you should see the Python app content.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Tip: Each time you start Localtunnel, the URL changes unless you specify a custom subdomain.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  Content Served by Python Server
&lt;/h4&gt;

&lt;p&gt;By default, the Python HTTP server serves the current directory as a simple web app. Example directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/home/alok/systems-thinking
├── server.py
├── venv/
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Accessing the server URL lists these files automatically in HTML&lt;/li&gt;
&lt;li&gt;You can place an &lt;code&gt;index.html&lt;/code&gt; file to serve a custom homepage&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Traffic Flow Diagram
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Smartphone / Mobile Data]
            │
            ▼
    [Public Tunnel via Localtunnel]
            │
            ▼
       [Fedora Host 192.168.0.136]
        (KVM/QEMU + NAT)
            │
            ▼
      [AlmaLinux VM 192.168.122.88]
         Python HTTP Server :8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Smartphone requests → public tunnel → host → VM → Python server → response flows back the same way.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;This completes the core tutorial flow: from environment setup → VM server → host access → external access → traffic understanding.&lt;/p&gt;

</description>
      <category>virtualmachine</category>
      <category>python</category>
      <category>fedora</category>
    </item>
    <item>
      <title>Rocky Linux VirtualBox VM Networking Setup &amp; SSH Access Using Windows 11 with Smartphone Hotspot</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Wed, 11 Mar 2026 10:32:15 +0000</pubDate>
      <link>https://dev.to/alok38/rocky-linux-virtualbox-vm-networking-setup-ssh-access-using-windows-11-with-smartphone-hotspot-jpp</link>
      <guid>https://dev.to/alok38/rocky-linux-virtualbox-vm-networking-setup-ssh-access-using-windows-11-with-smartphone-hotspot-jpp</guid>
      <description>&lt;h1&gt;
  
  
  SSH into Rocky Linux VM on VirtualBox (Windows 11 + Mobile Hotspot Setup)
&lt;/h1&gt;

&lt;p&gt;When experimenting with Linux in a virtual machine, one of the most useful skills to learn is how to access the system remotely using SSH. If you're running a Rocky Linux VM inside VirtualBox on a Windows 11 host, things can feel a bit confusing—especially when your computer is connected to the internet through a smartphone hotspot instead of a traditional router. In this guide, I’ll walk through a simple and practical setup that allows you to configure networking for your Rocky Linux virtual machine and successfully SSH into it from your Windows 11 host. By the end, you’ll have a working setup that’s perfect for learning, testing, and managing your VM just like a real remote Linux server.&lt;/p&gt;




&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Host&lt;/strong&gt;: Windows 11&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internet Source&lt;/strong&gt;: Smartphone Hotspot&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guest&lt;/strong&gt;: Rocky Linux (Headless – No GUI)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtualization&lt;/strong&gt;: VirtualBox&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Initial Objective
&lt;/h2&gt;

&lt;p&gt;The goal was to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;strong&gt;headless Rocky Linux VM&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensure the VM has &lt;strong&gt;Internet access&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allow &lt;strong&gt;SSH access from Windows PowerShell&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify networking using &lt;strong&gt;systematic diagnostic tests&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  VirtualBox Network Architecture
&lt;/h2&gt;

&lt;p&gt;I configured two network adapters for this setup. At the time, I didn’t fully understand the reasoning behind it, but since the configuration worked, I proceeded with it. I plan to revisit this later and spend some time understanding the finer details of how the networking works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adapter 1 — NAT (Internet access)
&lt;/h3&gt;

&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allows the VM to &lt;strong&gt;share the host's Internet connection&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Configuration&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Adapter 1 → NAT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the Rocky Linux VM, the network interface typically receives an address similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10.0.2.15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;VirtualBox also provides a default gateway for this internal network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10.0.2.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup ensures that the VM can download packages, update the system, and access the internet without needing any additional network configuration.&lt;/p&gt;




&lt;h3&gt;
  
  
  Adapter 2 — Host-Only Adapter (VM ↔ Host communication)
&lt;/h3&gt;

&lt;p&gt;While the NAT adapter provides internet connectivity to the virtual machine, it does &lt;strong&gt;not allow the host system to directly initiate connections to the VM&lt;/strong&gt;. This is where the &lt;strong&gt;Host-Only Adapter&lt;/strong&gt; becomes useful.&lt;/p&gt;

&lt;p&gt;The Host-Only Adapter creates a &lt;strong&gt;private network between the Windows host and the virtual machine&lt;/strong&gt;. This network exists only within VirtualBox and does not depend on the external network or internet connection. In my setup, this private network is what enables me to &lt;strong&gt;SSH from the Windows host into the Rocky Linux VM&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Direct communication between &lt;strong&gt;Windows host and VM&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enables &lt;strong&gt;SSH access&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Adapter 2 → Host-Only Adapter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When this adapter is enabled, VirtualBox automatically creates a &lt;strong&gt;host-only network&lt;/strong&gt;. The default network typically looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.56.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both the Windows host and the VM receive IP addresses within this network range. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows host: 192.168.56.1
VM:           192.168.56.102
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means the host machine can directly reach the VM using the assigned address, which makes SSH access simple and reliable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture Diagram
&lt;/h2&gt;

&lt;p&gt;The following diagram illustrates how the different components in this setup are connected. The Windows host receives internet access through a &lt;strong&gt;smartphone hotspot&lt;/strong&gt;, while the virtual machine uses two adapters — one for internet access and another for direct communication with the host.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                Internet
                    │
            Smartphone Hotspot
                    │
               Windows Host
            WiFi: 10.139.205.51
                    │
        ┌───────────┴───────────┐
        │                       │
    VirtualBox NAT        Host-Only Adapter
     (Internet)            (Local Access)
      10.0.2.x              192.168.56.x
        │                       │
        └────── Rocky Linux VM ──────┘
                 10.0.2.15
               192.168.56.102
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adapter 1 (NAT)&lt;/strong&gt; allows the VM to access the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adapter 2 (Host-only)&lt;/strong&gt; allows the Windows host to directly connect to the VM.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This dual-adapter setup is commonly used when you want a VM to behave like a real server that is both &lt;strong&gt;internet-enabled and locally accessible&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Network Verification Commands
&lt;/h2&gt;

&lt;p&gt;Once the VM is running, it's useful to verify that both network adapters are active and correctly assigned IP addresses.&lt;/p&gt;

&lt;h4&gt;
  
  
  Check interfaces
&lt;/h4&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lists all network interfaces&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shows assigned IP addresses&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Result (truncated):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lo
enp0s3 → 10.0.2.15
enp0s8 → 192.168.56.102
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Meaning:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Interface&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;lo&lt;/td&gt;
&lt;td&gt;loopback&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;enp0s3&lt;/td&gt;
&lt;td&gt;NAT adapter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;enp0s8&lt;/td&gt;
&lt;td&gt;Host-only adapter&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;From this output, we can confirm that both network adapters are active:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;enp0s3&lt;/code&gt; is connected to the &lt;strong&gt;NAT network&lt;/strong&gt;, providing internet access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;enp0s8&lt;/code&gt; is connected to the &lt;strong&gt;Host-only network&lt;/strong&gt;, enabling communication with the Windows host.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This host-only IP address is the one that will be used when connecting to the VM via SSH.&lt;/p&gt;




&lt;h2&gt;
  
  
  Verify Routing Table
&lt;/h2&gt;

&lt;p&gt;After confirming that both network interfaces are active, the next step is to verify how the system routes network traffic. In Linux, the routing table determines &lt;strong&gt;where outgoing network packets should be sent&lt;/strong&gt; depending on their destination.&lt;/p&gt;

&lt;p&gt;To view the routing table, run the following command inside the Rocky Linux VM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip route
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Truncated result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;default via 10.0.2.2 dev enp0s3
192.168.56.0/24 dev enp0s8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output shows the key routing rules that the system uses to decide how traffic should flow.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;default via 10.0.2.2&lt;/td&gt;
&lt;td&gt;Internet gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;192.168.56.0&lt;/td&gt;
&lt;td&gt;host-only network&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Connectivity Tests (Layer-by-layer)
&lt;/h2&gt;

&lt;p&gt;Once the network interfaces and routing table are confirmed, the next step is to verify connectivity step by step. A good troubleshooting approach is to test the network &lt;strong&gt;layer by layer&lt;/strong&gt;, starting from the closest network component and gradually moving outward.&lt;/p&gt;

&lt;p&gt;The first component to test is the &lt;strong&gt;VirtualBox NAT gateway&lt;/strong&gt;, which acts as the router that connects the VM to the outside network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test NAT Gateway
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 10.0.2.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify connection to &lt;strong&gt;VirtualBox NAT router&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This command sends three ICMP packets to the NAT gateway. If the gateway responds, it confirms that the VM can successfully communicate with the VirtualBox networking layer.&lt;/p&gt;

&lt;p&gt;A successful response indicates that the &lt;strong&gt;NAT adapter is functioning correctly&lt;/strong&gt; and that the VM can reach its default gateway. This is an important first step because all external network traffic from the VM must pass through this gateway.&lt;/p&gt;




&lt;h4&gt;
  
  
  Test Host-only Network
&lt;/h4&gt;

&lt;p&gt;After confirming that the NAT network is functioning correctly, the next step is to test connectivity between the &lt;strong&gt;Rocky Linux VM and the Windows host&lt;/strong&gt;. This communication happens through the &lt;strong&gt;Host-only Adapter&lt;/strong&gt;, which is responsible for enabling direct interaction between the host and the virtual machine.&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 192.168.56.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify VM ↔ Windows host connectivity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This command attempts to send three ICMP packets to the host-only interface on the Windows machine (&lt;code&gt;192.168.56.1&lt;/code&gt;). If the network is configured correctly, the host should respond to these requests.&lt;/p&gt;

&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;100% packet loss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This result indicates that the &lt;strong&gt;VM is unable to reach the Windows host over the host-only network&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At this point, we know that while the VM has internet connectivity through the NAT adapter, communication with the host system is not yet functioning as expected. This is an important discovery because &lt;strong&gt;SSH access relies on this host-only network&lt;/strong&gt;, so resolving this connectivity issue will be necessary before proceeding further.&lt;/p&gt;




&lt;h2&gt;
  
  
  Diagnosing the Issue
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Checking the interface state&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since the host-only ping test failed, the next step is to verify whether the corresponding network interface inside the VM is actually active. In this setup, the host-only adapter is mapped to the interface &lt;code&gt;enp0s8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To check the status of the interface, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip &lt;span class="nb"&gt;link &lt;/span&gt;show enp0s8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;state UP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The interface is active.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This confirms that the network interface itself is &lt;strong&gt;enabled and operational&lt;/strong&gt; inside the VM. In other words, the failure of the previous ping test is &lt;strong&gt;not caused by the interface being down&lt;/strong&gt;, which means the issue likely lies elsewhere in the network path—possibly at the host side or within the host-only network configuration.&lt;/p&gt;




&lt;h3&gt;
  
  
  Checking the Host-Side Network Configuration
&lt;/h3&gt;

&lt;p&gt;Since the VM interface was confirmed to be active, the next step was to verify whether the &lt;strong&gt;Windows host actually had the host-only network adapter configured&lt;/strong&gt;. If the host-side adapter was missing or misconfigured, the VM would have no endpoint to communicate with.&lt;/p&gt;

&lt;p&gt;To check this on Windows, I opened the command prompt and ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;ipconfig&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Found:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ethernet adapter Ethernet 4
IPv4 Address: 192.168.56.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output confirms that Windows has a &lt;strong&gt;VirtualBox Host-Only Ethernet Adapter&lt;/strong&gt; configured and assigned the expected IP address within the host-only network range.&lt;/p&gt;

&lt;p&gt;At this point, both sides of the network appeared to be configured properly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;strong&gt;VM interface&lt;/strong&gt; (&lt;code&gt;enp0s8&lt;/code&gt;) &lt;strong&gt;was active&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;strong&gt;Windows host adapter had the correct IP address&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the earlier ping test still failed. This suggested that the problem was &lt;strong&gt;not with the network configuration itself&lt;/strong&gt;, but likely related to something else — such as &lt;strong&gt;Windows firewall rules blocking ICMP traffic&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real Connectivity Test — SSH
&lt;/h2&gt;

&lt;p&gt;While the earlier ping test suggested that host-only connectivity might not be working, the &lt;strong&gt;real objective of this setup was SSH access&lt;/strong&gt;. Therefore, the most reliable way to verify the network was to attempt an actual SSH connection from the Windows host to the Rocky Linux VM.&lt;/p&gt;

&lt;p&gt;From &lt;strong&gt;Windows PowerShell&lt;/strong&gt;, I executed the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh alok@192.168.56.102&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the network and SSH service were functioning correctly, this command should establish a remote shell session with the virtual machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[alok@localhost ~]$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prompt indicates that the SSH connection was successfully established and that the terminal session is now running on the &lt;strong&gt;Rocky Linux virtual machine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Meaning:&lt;/p&gt;

&lt;p&gt;✅ SSH server running&lt;br&gt;
✅ Host-only network working&lt;br&gt;
✅ Authentication successful&lt;/p&gt;

&lt;p&gt;Despite the earlier ICMP ping failure, the SSH test confirms that &lt;strong&gt;the host-only network is functioning correctly for actual application traffic&lt;/strong&gt;. This means the VM can now be accessed just like any other remote Linux server.&lt;/p&gt;

&lt;p&gt;The system behaves like a &lt;strong&gt;real remote Linux server&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Real Connectivity Test — SSH
&lt;/h2&gt;

&lt;p&gt;Although earlier ping tests suggested a possible issue with host-only connectivity, the &lt;strong&gt;ultimate goal of this setup was to access the VM via SSH&lt;/strong&gt;. The most practical way to verify that everything is working is therefore to attempt an actual SSH login from the Windows host.&lt;/p&gt;

&lt;p&gt;From &lt;strong&gt;Windows PowerShell&lt;/strong&gt;, the following command was executed to connect to the Rocky Linux virtual machine:&lt;/p&gt;

&lt;p&gt;Command executed from &lt;strong&gt;Windows PowerShell&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh alok@192.168.56.102
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the network configuration and SSH service are functioning correctly, this command should establish a remote shell session with the VM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[alok@localhost ~]$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prompt confirms that the SSH connection was successfully established and that the session is now running on the &lt;strong&gt;Rocky Linux system inside the VirtualBox VM.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Meaning:&lt;/p&gt;

&lt;p&gt;✅ SSH server running&lt;br&gt;
✅ Host-only network working&lt;br&gt;
✅ Authentication successful&lt;/p&gt;

&lt;p&gt;Even though the earlier ICMP ping test failed, the successful SSH connection demonstrates that &lt;strong&gt;the host-only network is operational for real application traffic&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The system behaves like a &lt;strong&gt;real remote Linux server&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Final Working Network State
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VirtualBox NAT&lt;/td&gt;
&lt;td&gt;✅ Working&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host-only adapter&lt;/td&gt;
&lt;td&gt;✅ Working&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM networking&lt;/td&gt;
&lt;td&gt;✅ Correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Routing&lt;/td&gt;
&lt;td&gt;✅ Correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSH access&lt;/td&gt;
&lt;td&gt;✅ Working&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Internet access&lt;/td&gt;
&lt;td&gt;✅ Available&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NAT vs Bridged vs Host-only&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;NAT&lt;/td&gt;
&lt;td&gt;Internet access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host-only&lt;/td&gt;
&lt;td&gt;VM ↔ host communication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bridged&lt;/td&gt;
&lt;td&gt;VM appears as separate device on LAN&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For hotspot connections, NAT is the most reliable.&lt;/p&gt;


&lt;h3&gt;
  
  
  Key Commands Used
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip a
ip route
ip &lt;span class="nb"&gt;link &lt;/span&gt;show enp0s8
ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 &amp;lt;ip&amp;gt;
systemctl status sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;ipconfig&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nx"&gt;ssh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="nx"&gt;vm-ip&lt;/span&gt;&lt;span class="se"&gt;`
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Recommended next steps
&lt;/h3&gt;

&lt;p&gt;Connecting three VM's together and practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SSH key authentication&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linux networking&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ansible automation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kubernetes clusters&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When ready!&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>linux</category>
      <category>hotspot</category>
      <category>virtualmachine</category>
    </item>
    <item>
      <title>Getting acquainted with basic Linux commands commonly used for debugging slow servers</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Sat, 07 Mar 2026 05:57:15 +0000</pubDate>
      <link>https://dev.to/alok38/getting-acquainted-with-basic-linux-commands-commonly-used-for-debugging-slow-servers-1cna</link>
      <guid>https://dev.to/alok38/getting-acquainted-with-basic-linux-commands-commonly-used-for-debugging-slow-servers-1cna</guid>
      <description>&lt;h1&gt;
  
  
  Getting Started with Linux for DevOps: Monitoring CPU, Memory, and More
&lt;/h1&gt;

&lt;p&gt;I keep hearing that Linux remains the dominant operating system for servers, containers, cloud instances, Kubernetes nodes, CI/CD runners, monitoring agents, and virtually every production environment that DevOps engineers touch in 2026 and beyond. Because of this, strong practical Linux skills are expected in almost every serious DevOps, SRE, or Platform Engineering role.&lt;/p&gt;

&lt;p&gt;In this post, we won’t tackle complex production issues—like a containerized application not responding or nginx underperforming—just yet. Instead, we’ll focus on preliminary checks such as CPU uptime, memory usage, and more which includes realistic troubleshooting scenarios. &lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A Linux distribution (examples here use &lt;strong&gt;Rocky Linux&lt;/strong&gt; on &lt;strong&gt;VirtualBox&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH access to the virtual machine&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. Installing the required tools
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dnf install -y sysstat strace perf iotop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sysstat&lt;/code&gt; -&amp;gt; provides &lt;code&gt;sar&lt;/code&gt; (system activity reporter), a tool used to &lt;strong&gt;collect, report, and save system performance metrics over time.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Live example of &lt;code&gt;sar&lt;/code&gt; in action &lt;strong&gt;CPU usage in 1-second intervals, 5 times&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fohav4yq0oafirz5nl79f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fohav4yq0oafirz5nl79f.png" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's break it down
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;%user&lt;/strong&gt; → CPU used by user processes (your applications) → very low (0%)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;%nice&lt;/strong&gt; → CPU used by &lt;strong&gt;nice/low-priority processes&lt;/strong&gt; → 0%&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;%system&lt;/strong&gt; → CPU used by kernel/system processes → small (0.5–5%)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;%iowait&lt;/strong&gt; → CPU waiting for disk I/O → 0% → disk is not a bottleneck&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;%steal&lt;/strong&gt; → CPU time taken by hypervisor for other VMs → 0%&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;%idle&lt;/strong&gt; → CPU idle → very high (94–99%) → CPU is mostly free&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Check System Load Safely
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uptime
top -b -n 1
vmstat 1 5
iostat -xz 1 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;top -b -n 1&lt;/code&gt; → batch mode prevents cluttering the terminal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vmstat&lt;/code&gt; and &lt;code&gt;iostat&lt;/code&gt; give quick snapshots.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Let's view the output of two commands at a time
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xlb424ga1402o33grgk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xlb424ga1402o33grgk.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's carefully decode my &lt;code&gt;uptime&lt;/code&gt; output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10:26:36 up 57 min,  2 users,  load average: 0.08, 0.02, 0.01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;10:26:36&lt;/code&gt; → the current system time when the command was run.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;up 57 min&lt;/code&gt; → the system has been running continuously for 57 minutes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;2 users&lt;/code&gt; → there are 2 active sessions currently logged into the system.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;load average: 0.08, 0.02, 0.01&lt;/code&gt; → three numbers representing average system load over (I'm ignoring this part for now)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Decoding the top command &lt;code&gt;top -b -n 1&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;top&lt;/code&gt; command shows a &lt;strong&gt;live, interactive view of system processes, CPU, memory, swap, and load averages&lt;/strong&gt;. I won't try to learn the entire output. I will ignore the table for now.&lt;/p&gt;

&lt;p&gt;Here we are executing the &lt;code&gt;top&lt;/code&gt; command in batch mode with just one iteration as indicated by this switch &lt;code&gt;-n 1&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's start with the &lt;strong&gt;header&lt;/strong&gt; line
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;top - 10:27:26 up 58 min,  2 users,  load average: 0.03, 0.01, 0.00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;10:27:26&lt;/strong&gt; → current system time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;up 58 min&lt;/strong&gt; → the system has been running continuously for 58 minutes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;2 users&lt;/strong&gt; → 2 logged-in users/sessions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;load average&lt;/strong&gt;: 0.03, 0.01, 0.00 → the system load averages over 1, 5, and 15 minutes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Very low numbers → CPU is mostly idle.&lt;/li&gt;
&lt;li&gt;For 2 CPUs, load ≤ 2 is normal. Here, 0.03 is negligible.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h4&gt;
  
  
  2. Tasks
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tasks: 123 total,   1 running, 122 sleeping,   0 stopped,   0 zombie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;System is healthy; almost all processes are idle.&lt;/strong&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  3. CPU Usage
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni, 95.2 id,  0.0 wa,  4.8 hi,  0.0 si,  0.0 st
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CPU is almost completely idle; no performance pressure.&lt;/strong&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  4. Memory Usage
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MiB Mem :   3653.4 total,   2960.2 free,    439.7 used,    470.5 buff/cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Memory is abundant; system is far from pressure!&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Swap Usage
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;I’m still clarifying my understanding of swap and will write a follow-up post once I’ve learned more.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That wraps things up for now—more to come soon.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>performance</category>
      <category>bash</category>
    </item>
    <item>
      <title>VirtualBox Automation Made Easy: Frequently Used VBoxManage Commands</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Fri, 06 Mar 2026 08:52:19 +0000</pubDate>
      <link>https://dev.to/alok38/virtualbox-automation-made-easy-frequently-used-vboxmanage-commands-4f2</link>
      <guid>https://dev.to/alok38/virtualbox-automation-made-easy-frequently-used-vboxmanage-commands-4f2</guid>
      <description>&lt;h1&gt;
  
  
  Automate Your VMs Like a Pro with VBoxManage
&lt;/h1&gt;

&lt;p&gt;Ever wanted to automate your VirtualBox VMs without opening the GUI?&lt;/p&gt;

&lt;p&gt;Manually starting, stopping, and configuring multiple VMs can be tedious. With &lt;code&gt;VBoxManage&lt;/code&gt; and PowerShell, you can automate all of it—modifying resources, managing snapshots, and controlling your VMs from the command line. By the end of this guide, you'll be able to fully automate your VirtualBox workflow for &lt;strong&gt;already installed VMs&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;VirtualBox installed (latest version)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PowerShell access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of the command line&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Admin privileges (for some commands)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The examples below use &lt;strong&gt;Rocky Linux&lt;/strong&gt;, but they apply to any Linux distribution with a pre-existing VM.&lt;/p&gt;




&lt;h2&gt;
  
  
  Configure VM Resources
&lt;/h2&gt;

&lt;p&gt;If you want to adjust RAM, CPUs, or network settings for your existing VM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Adjust memory, CPUs, and NIC
VBoxManage modifyvm "RockyLinux" --memory 4096 --cpus 2 --nic1 nat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--cpus&lt;/code&gt; to suit your needs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--nic1 nat&lt;/code&gt; provides internet access through NAT.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Manage Storage (Optional)
&lt;/h2&gt;

&lt;p&gt;If you want to add new virtual disks or controllers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Add a new SATA storage controller (if needed)
VBoxManage storagectl "RockyLinux" --name "SATA Controller" --add sata

# Create and attach a 50GB virtual disk
VBoxManage createhd --filename "C:\Users\alok\VirtualBox VMs\RockyLinux\ExtraDisk.vdi" --size 50000
VBoxManage storageattach "RockyLinux" --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium "C:\Users\alok\VirtualBox VMs\RockyLinux\ExtraDisk.vdi"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Start, Pause, and Stop the VM
&lt;/h2&gt;

&lt;p&gt;Control your VM without opening the GUI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Start VM (headless mode)
VBoxManage startvm "RockyLinux" --type headless

# Pause the VM
VBoxManage controlvm "RockyLinux" pause

# Resume the VM
VBoxManage controlvm "RockyLinux" resume

# Power off the VM
VBoxManage controlvm "RockyLinux" poweroff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Snapshots
&lt;/h2&gt;

&lt;p&gt;Take and restore snapshots to save or revert VM states:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Take a snapshot
VBoxManage snapshot "RockyLinux" take "BeforeUpdate"

# Restore a snapshot
VBoxManage snapshot "RockyLinux" restore "BeforeUpdate"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Verify VM Settings
&lt;/h2&gt;

&lt;p&gt;Always check that your changes have applied correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VBoxManage showvminfo "RockyLinux"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for &lt;strong&gt;updated memory&lt;/strong&gt;, &lt;strong&gt;CPU&lt;/strong&gt;, &lt;strong&gt;NIC&lt;/strong&gt;, and disk information.&lt;/p&gt;




&lt;h3&gt;
  
  
  Final Notes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Use consistent VM names (&lt;code&gt;RockyLinux&lt;/code&gt;) to avoid errors.&lt;/li&gt;
&lt;li&gt;All commands are &lt;strong&gt;idempotent&lt;/strong&gt;, meaning you can run them repeatedly without breaking the VM.&lt;/li&gt;
&lt;li&gt;Snapshots are great for testing updates or configuration changes safely.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>virtualmachine</category>
      <category>automation</category>
    </item>
    <item>
      <title>Backend Foundations Lab — Full Walkthrough</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Fri, 27 Feb 2026 09:08:38 +0000</pubDate>
      <link>https://dev.to/alok38/backend-foundations-lab-full-walkthrough-2a6j</link>
      <guid>https://dev.to/alok38/backend-foundations-lab-full-walkthrough-2a6j</guid>
      <description>&lt;h1&gt;
  
  
  How I Finally gained a surface level intuition of how the web works (By Building a primitive Backend)
&lt;/h1&gt;

&lt;p&gt;When people say “learn how the web works,” it usually sounds abstract — DNS, client–server model, HTTP requests, ports — a bunch of terms that don’t really click until something breaks. Instead of just reading about it, I decided to set up a real Ubuntu virtual machine, run a backend server on it, and connect to it from my own computer. Along the way, I hit firewall issues, port forwarding problems, and confusing network errors — and that’s exactly when everything started to make sense. This post is a hands-on walkthrough of how I finally understood how the web actually works by building and debugging a real client–server setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Overview
&lt;/h2&gt;

&lt;p&gt;To understand how the web actually works in practice, I created a small, local client–server environment that mirrors how real backend systems operate in production — just on my own machine. The setup looked like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Host machine (Client):&lt;br&gt;
My Windows laptop, acting as the client making HTTP requests using &lt;code&gt;curl&lt;/code&gt; and SSH.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual machine (Server):&lt;br&gt;
An Ubuntu VM running inside VirtualBox, acting as the backend server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Networking:&lt;br&gt;
The VM was configured using NAT with port forwarding, so requests from my Windows machine could reach services running inside the VM (similar to how traffic reaches servers behind NAT or load balancers in the cloud).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Backend service:&lt;br&gt;
A simple Python HTTP server running on the VM to simulate a backend API/server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Access method:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH into the VM to manage the server&lt;/li&gt;
&lt;li&gt;HTTP requests from Windows to the VM to simulate real client–server communication
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client (Windows)
      |
      |  HTTP request (curl / browser)
      v
VirtualBox NAT (port forwarding)
      |
      v
Ubuntu VM (Python backend server)
      |
      v
HTTP response back to client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🎯 Goal
&lt;/h2&gt;

&lt;p&gt;Understand &lt;strong&gt;How the web works (DNS + client–server model)&lt;/strong&gt; by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;running a server on a Ubuntu VM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;connecting to it from Windows&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - debugging real network + firewall issues
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Connected to Ubuntu VM over SSH (Client → Server)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Command (from Windows)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh alok@localhost -p 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📌 What this means
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Windows = client&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ubuntu VM = server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Port forwarding:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows:2222 → VM:22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🧠 New thing I noticed
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Last login: ... from 10.0.2.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Why that happened
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;VirtualBox NAT hides your real IP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VM sees the NAT gateway (&lt;code&gt;10.0.2.2&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This is how real servers behave behind NAT/load balancers (like on &lt;strong&gt;AWS&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2️⃣ Started a web server on the VM (Become the Server)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Command (on VM)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m http.server 8000 --bind 0.0.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧠 What this did
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Started an HTTP server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Listening on:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0.0.0.0:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  - &lt;code&gt;0.0.0.0&lt;/code&gt; = accept connections from outside the VM
&lt;/h2&gt;

&lt;h2&gt;
  
  
  3️⃣ First attempt to access from Windows failed
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ❌ Command (on Windows)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ❌ Error
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unable to connect to the remote server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧠 Root cause
&lt;/h3&gt;

&lt;p&gt;Even though:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Server was running ✅&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Port forwarding was set ✅&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The &lt;strong&gt;VM firewall (ufw)&lt;/strong&gt; was blocking port 8000 
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4️⃣ Checked firewall (Found the real problem)
&lt;/h3&gt;

&lt;h2&gt;
  
  
  ✅ Command (on VM)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📌 Output (important part)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: active
OpenSSH ALLOW
22 ALLOW
3999 ALLOW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧠 What this means
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Port &lt;strong&gt;8000 was NOT allowed&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - So Windows → VM:8000 was blocked
&lt;/h2&gt;

&lt;h2&gt;
  
  
  5️⃣ Fixed firewall (Opened port 8000)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Commands (on VM)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 8000/tcp
sudo ufw reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Verified
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now shows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8000/tcp ALLOW Anywhere
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6️⃣Verified server was running (Correct diagnosis)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Command
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ss -tulnp | grep 8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tcp LISTEN 0.0.0.0:8000 users:(("python3",pid=1989))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Meaning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Python server is alive&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Listening on port 8000&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accepting external connections&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - No need to restart it
&lt;/h2&gt;

&lt;h2&gt;
  
  
  7️⃣Final success: Windows → VM HTTP request worked 🎉
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Command (on Windows)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl.exe http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;Hello from my backend server 👋&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;This response came from my Ubuntu VM.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🗺 Final working network flow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows (Client)
   ↓ curl http://localhost:8000
VirtualBox NAT (port forwarding)
   ↓
Ubuntu VM (Server)
   ↓
Python HTTP Server
   ↓
HTML response back to Windows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;









&lt;h3&gt;
  
  
  🧠 Core Concepts I Actually Learned (not just memorized)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;I experienced it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Client&lt;/td&gt;
&lt;td&gt;Windows using &lt;code&gt;curl&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server&lt;/td&gt;
&lt;td&gt;Ubuntu VM running Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP&lt;/td&gt;
&lt;td&gt;Requests + responses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ports&lt;/td&gt;
&lt;td&gt;22 (SSH), 8000 (web server)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DNS&lt;/td&gt;
&lt;td&gt;Earlier with &lt;code&gt;dig google.com&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAT&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;10.0.2.2&lt;/code&gt; hiding your real IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Firewall&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ufw&lt;/code&gt; blocking then allowing 8000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Binding&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0.0.0.0&lt;/code&gt; vs &lt;code&gt;localhost&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Infra debugging&lt;/td&gt;
&lt;td&gt;App was fine, network blocked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real-world behavior&lt;/td&gt;
&lt;td&gt;Same as cloud servers on &lt;strong&gt;AWS&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h4&gt;
  
  
  🏁 Big takeaway
&lt;/h4&gt;

&lt;p&gt;I didn’t just “learn how the web works.”&lt;br&gt;
I debugged &lt;strong&gt;real backend infrastructure problem&lt;/strong&gt;s:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Server running but unreachable&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Firewall blocking traffic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NAT hiding client IP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Port already in use&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Binding to correct network interface&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>backend</category>
      <category>virtualmachine</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Fixing “VBoxManage Is Not Recognized” in PowerShell (Windows + VirtualBox)</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Fri, 27 Feb 2026 05:58:39 +0000</pubDate>
      <link>https://dev.to/alok38/fixing-vboxmanage-is-not-recognized-in-powershell-windows-virtualbox-3ch0</link>
      <guid>https://dev.to/alok38/fixing-vboxmanage-is-not-recognized-in-powershell-windows-virtualbox-3ch0</guid>
      <description>&lt;h1&gt;
  
  
  Fixing “VBoxManage Is Not Recognized” in PowerShell on Windows
&lt;/h1&gt;

&lt;p&gt;If you’ve tried running VBoxManage in PowerShell and hit the error “VBoxManage is not recognized as the name of a cmdlet,” it usually means Windows can’t find the VirtualBox executable on your PATH. In this post, I’ll show you why this happens and the exact steps to fix it on Windows so you can get back to managing your virtual machines from the command line.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bpjhc9oxcfsne5itdr3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bpjhc9oxcfsne5itdr3.jpg" alt=" " width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔍 What does this mean?
&lt;/h2&gt;

&lt;p&gt;PowerShell couldn’t find &lt;code&gt;VBoxManage.exe&lt;/code&gt; because the VirtualBox install directory was &lt;strong&gt;not in your PATH&lt;/strong&gt; environment variable.&lt;/p&gt;


&lt;h2&gt;
  
  
  ✅ How We Fixed It (Verified VBoxManage Works)
&lt;/h2&gt;

&lt;p&gt;We ran &lt;code&gt;VBoxManage&lt;/code&gt; using its &lt;strong&gt;full path&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;amp; "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ✅ Result (Success Output)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7.2.6r172322
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🎯 What this confirmed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;VirtualBox is &lt;strong&gt;installed correctly&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;VBoxManage.exe&lt;/code&gt; exists and works&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The only issue was that PowerShell didn’t know where to find it automatically&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  This is pretty cumbersome, right?
&lt;/h3&gt;

&lt;p&gt;Let’s add this utility to the &lt;strong&gt;PATH&lt;/strong&gt; so it’s easier to use going forward.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open the start menu and type the word "edit" (without the quotes) and click &lt;strong&gt;Edit the system environment variables&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Environment variables&lt;/strong&gt; at the bottom&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4xyt9p82rju0r2vri9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4xyt9p82rju0r2vri9x.png" alt=" " width="613" height="709"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure the &lt;em&gt;Path&lt;/em&gt; variable is already selected under &lt;strong&gt;user&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkizzqkxm4sjwahtvxpb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkizzqkxm4sjwahtvxpb.png" alt=" " width="800" height="877"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Edit&lt;/strong&gt; and then click &lt;strong&gt;New&lt;/strong&gt; and add &lt;strong&gt;C:\Program Files\Oracle\VirtualBox&lt;/strong&gt; if this is the location of the binary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftr3ssrt3nwhq1hw5rcd3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftr3ssrt3nwhq1hw5rcd3.png" alt=" " width="748" height="820"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going forward, you can start using the &lt;strong&gt;VBoxManage&lt;/strong&gt; utility to manage your Virtual machines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7x0nxfgoxukk1k6d61th.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7x0nxfgoxukk1k6d61th.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>virtualbox</category>
      <category>cmd</category>
    </item>
    <item>
      <title>How to Access SSH and HTTP from Windows on a VMware Ubuntu VM</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Fri, 13 Feb 2026 05:06:54 +0000</pubDate>
      <link>https://dev.to/alok38/how-to-access-ssh-and-http-from-windows-on-a-vmware-ubuntu-vm-4pj1</link>
      <guid>https://dev.to/alok38/how-to-access-ssh-and-http-from-windows-on-a-vmware-ubuntu-vm-4pj1</guid>
      <description>&lt;h1&gt;
  
  
  Commands to execute and test both SSH and HTTP after you set up a Ubuntu VM on VMware workstation pro
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Bring interface up
sudo ip link set ens33 up
sudo dhclient -v ens33

# Check IP &amp;amp; routes
ip a
ip route

# Test Internet &amp;amp; DNS
ping -c 3 8.8.8.8
ping -c 3 google.com

# Set temporary DNS
sudo nano /etc/resolv.conf
# nameserver 8.8.8.8
# nameserver 8.8.4.4

# Install SSH and HTTP servers
sudo apt update
sudo apt install openssh-server apache2 nginx -y
sudo systemctl enable --now ssh
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp

# Resolve Apache/nginx port conflict
sudo nano /etc/apache2/ports.conf       # Listen 8080
sudo nano /etc/apache2/sites-available/000-default.conf  # &amp;lt;VirtualHost *:8080&amp;gt;
sudo systemctl restart apache2
sudo systemctl enable apache2

# Check running services &amp;amp; listening ports
sudo systemctl status apache2
sudo systemctl status nginx
sudo lsof -i :80
sudo lsof -i :8080

# VMware NAT port forwarding
# Host → VM mapping:
# 2222 → 22 (SSH)
# 8080 → 8080 (Apache)
# 80 → 80 (nginx)

# Restart VMware NAT services (Windows)
# VMware NAT Service
# VMnetDHCP Service

# Test TCP connectivity from Windows
Test-NetConnection -ComputerName 127.0.0.1 -Port 2222

# SSH from Windows
ssh alok@127.0.0.1 -p 2222

# HTTP from Windows
# nginx → http://127.0.0.1
# Apache → http://127.0.0.1:8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ubuntu</category>
      <category>vmware</category>
    </item>
    <item>
      <title>Reliable SSH to Ubuntu VMs on VMware Workstation: Bypassing Bridged Wi-Fi Issues</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Thu, 12 Feb 2026 05:24:14 +0000</pubDate>
      <link>https://dev.to/alok38/reliable-ssh-to-ubuntu-vms-on-vmware-workstation-bypassing-bridged-wi-fi-issues-1oce</link>
      <guid>https://dev.to/alok38/reliable-ssh-to-ubuntu-vms-on-vmware-workstation-bypassing-bridged-wi-fi-issues-1oce</guid>
      <description>&lt;h1&gt;
  
  
  How to SSH into Ubuntu VMs on VMware Workstation Using NAT and Port Forwarding
&lt;/h1&gt;

&lt;p&gt;Connecting to Ubuntu virtual machines from a Windows host can be tricky, especially when using Bridged networking over Wi-Fi adapters like Killer Wi-Fi, which often block VM traffic. In this guide, we show a simple, reliable method using NAT networking and port forwarding, allowing you to SSH into your VM safely and consistently without dealing with network or firewall headaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ The Problem
&lt;/h2&gt;

&lt;p&gt;I wanted to &lt;strong&gt;SSH&lt;/strong&gt; from my Windows host into a &lt;strong&gt;Ubuntu VM on VMware Workstation Pro&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My first attempt used &lt;strong&gt;Bridged networking&lt;/strong&gt;, like my EC2 setup:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows Host ↔ VM via bridged IP (192.168.45.100)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SSH &lt;strong&gt;timed out&lt;/strong&gt;, and ping failed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Firewall on Windows wasn’t the cause — disabling it changed nothing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Bridged failed:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I'm using a &lt;strong&gt;Killer Wi-Fi adapter&lt;/strong&gt;. Many modern Wi-Fi cards &lt;em&gt;don’t&lt;/em&gt; handle Bridged VM traffic reliably.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Even though the VM and host were “on the same subnet” and the VMware Bridge Protocol was enabled, packets from Windows could not reach the VM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bottom line: Bridged looked right but couldn’t communicate over Wi-Fi.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2️⃣ First Attempts / Misleads
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tried to SSH using the old Bridged IP (&lt;code&gt;192.168.45.100&lt;/code&gt;) — failed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tried &lt;code&gt;ssh 127.0.0.1&lt;/code&gt; locally inside the VM — worked, but only from inside the VM itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Firewall checks confirmed it wasn’t blocking the traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VMware settings (VMnet0, VMnet1) were correct for Bridged / Host-only, but Bridged Wi-Fi still didn’t work.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;➡ At this point, I realized Bridged over Wi-Fi is unreliable, and we needed a NAT + port forwarding solution.&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ Switching to NAT
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows Host ↔ NAT (VMnet8) ↔ VM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4️⃣ SSH Works via NAT
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -p 2222 alok@127.0.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Worked immediately — host connected to VM via NAT + port forwarding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ping and firewall issues no longer mattered.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bridged issues were completely bypassed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5️⃣ Optional SSH Config Shortcut
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Added to &lt;code&gt;C:\Users\alok\.ssh\config&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host vm
  HostName 127.0.0.1
  User alok
  Port 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now you can simply run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh vm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6️⃣ Key Takeaways
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step/Problem&lt;/th&gt;
&lt;th&gt;How We Solved It&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bridged networking fails over Wi-Fi&lt;/td&gt;
&lt;td&gt;Use NAT instead; Wi-Fi cards often block Bridged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Old IP still assigned to VM&lt;/td&gt;
&lt;td&gt;Release old IP (&lt;code&gt;sudo dhclient -r&lt;/code&gt;) &amp;amp; request new&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host cannot reach VM NAT IP&lt;/td&gt;
&lt;td&gt;Set up VMware NAT port forwarding (host:2222 → VM:22)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long SSH commands&lt;/td&gt;
&lt;td&gt;Use SSH config shortcut (&lt;code&gt;ssh vm&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reliable Wi-Fi-safe connection&lt;/td&gt;
&lt;td&gt;NAT + port forwarding works even on Wi-Fi adapters&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>vmware</category>
      <category>ubuntu</category>
      <category>ssh</category>
    </item>
    <item>
      <title>What Actually Happens When You SSH into an EC2 Instance</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Wed, 11 Feb 2026 11:46:54 +0000</pubDate>
      <link>https://dev.to/alok38/what-actually-happens-when-you-ssh-into-an-ec2-instance-19c7</link>
      <guid>https://dev.to/alok38/what-actually-happens-when-you-ssh-into-an-ec2-instance-19c7</guid>
      <description>&lt;h1&gt;
  
  
  From &lt;code&gt;ssh ec2&lt;/code&gt; to TCP SYN: Tracing a Connection End-to-End
&lt;/h1&gt;

&lt;p&gt;When an SSH connection to my EC2 instance timed out, I could’ve stopped at “fix the security group and move on.” &lt;br&gt;
Instead, I decided to trace what actually happens when you run &lt;code&gt;ssh ec2&lt;/code&gt; — from the packet leaving my laptop, &lt;br&gt;
through the Windows kernel and AWS firewalls, all the way to the SSH daemon on the server. &lt;br&gt;
This post is a hands-on walk through the real software stack beneath the abstractions: TCP handshakes, cloud networking, &lt;br&gt;
kernel drivers, and cryptographic key exchange — observed live on the wire.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Original Problem
&lt;/h2&gt;

&lt;p&gt;I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh ec2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I got:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Connection timed out
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But when I changed AWS Security Group from:&lt;/p&gt;

&lt;p&gt;❌ Custom&lt;br&gt;
to&lt;br&gt;
✅ My IP&lt;/p&gt;

&lt;p&gt;SSH started working.&lt;/p&gt;


&lt;h2&gt;
  
  
  Root cause (cloud side)
&lt;/h2&gt;

&lt;p&gt;My EC2 Security Group firewall was blocking port 22 from your IP.&lt;/p&gt;

&lt;p&gt;I got curious and I decided to understand what goes on under the hood.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1 – Try to capture packets with Wireshark
&lt;/h2&gt;

&lt;p&gt;I installed Wireshark and tried capturing traffic.&lt;/p&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;p&gt;❌ No packets were captured&lt;/p&gt;

&lt;p&gt;This told us something important:&lt;br&gt;
Wireshark GUI was running, but &lt;strong&gt;Windows kernel was not giving it packets&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 2 – Diagnose Npcap (kernel capture driver)
&lt;/h2&gt;

&lt;p&gt;Wireshark relies on &lt;strong&gt;Npcap&lt;/strong&gt; to hook into the network stack.&lt;/p&gt;

&lt;p&gt;But when I executed this command on the power shell,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sc query npcap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Returned nothing.&lt;/p&gt;

&lt;p&gt;Meaning:&lt;/p&gt;

&lt;p&gt;The packet capture driver was not installed / bound correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3 – Discover Npcap was installed but not activated
&lt;/h2&gt;

&lt;p&gt;I found:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get-ChildItem "C:\Program Files\Npcap"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Npcap files existed, including:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npcap.sys
NPFInstall.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the driver was present on disk — but &lt;strong&gt;not attached to my network interface&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4 – Manually bind the kernel driver (real infra work)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd "C:\Program Files\Npcap"
.\NPFInstall.exe -i2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Npcap Packet Driver (NPCAP) (WiFi version) has been successfully installed!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This did the critical thing:&lt;/p&gt;

&lt;p&gt;✅ Attached Npcap to your Wi-Fi network adapter&lt;br&gt;
✅ Inserted itself into the Windows networking pipeline&lt;/p&gt;

&lt;p&gt;then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.\NPFInstall.exe -r2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Then rebooted.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Step 5 – Verify kernel drivers are actually loaded
&lt;/h2&gt;

&lt;p&gt;After reboot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;driverquery | findstr /i npcap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npcap        Npcap Packet Driver
npcap_wifi   Npcap Packet Driver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My OS is now capable of exposing raw packets to userland tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6 – Launch Wireshark correctly
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start-Process "C:\Program Files\Wireshark\Wireshark.exe" -Verb RunAs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 7 – Observe the TCP handshake (what I originally wanted)
&lt;/h2&gt;

&lt;p&gt;Now when I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh ec2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And filter in Wireshark:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tcp.port == 22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;68  4.469707    172.22.55.51    54.90.199.89    TCP 66  56959 → 22 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=256 SACK_PERM
70  4.890446    54.90.199.89    172.22.55.51    TCP 66  22 → 56959 [SYN, ACK] Seq=0 Ack=1 Win=62727 Len=0 MSS=1318 SACK_PERM WS=128
71  4.890701    172.22.55.51    54.90.199.89    TCP 54  56959 → 22 [ACK] Seq=1 Ack=1 Win=65280 Len=0
72  4.909598    172.22.55.51    54.90.199.89    SSHv2   87  Client: Protocol (SSH-2.0-OpenSSH_for_Windows_9.5)
76  5.362436    54.90.199.89    172.22.55.51    SSHv2   75  Server: Protocol (SSH-2.0-OpenSSH_8.7)
77  5.362436    54.90.199.89    172.22.55.51    TCP 54  22 → 56959 [ACK] Seq=22 Ack=34 Win=62848 Len=0
78  5.385712    172.22.55.51    54.90.199.89    TCP 1372    56959 → 22 [ACK] Seq=34 Ack=22 Win=65280 Len=1318 [TCP PDU reassembled in 79]
79  5.385712    172.22.55.51    54.90.199.89    SSHv2   168 Client: Key Exchange Init
88  5.790794    54.90.199.89    172.22.55.51    SSHv2   990 Server: Key Exchange Init
90  5.799032    172.22.55.51    54.90.199.89    SSHv2   102 Client: Elliptic Curve Diffie-Hellman Key Exchange Init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I didn’t just learn “SSH uses TCP”.&lt;/p&gt;

&lt;p&gt;I &lt;strong&gt;proved it with your own packets&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Real Lessons
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1️⃣ Cloud firewalls aren’t “abstract”
&lt;/h4&gt;

&lt;p&gt;They literally drop packets on the wire.&lt;/p&gt;

&lt;h4&gt;
  
  
  2️⃣ Observability requires kernel hooks
&lt;/h4&gt;

&lt;p&gt;You can’t “see networking” without drivers.&lt;/p&gt;

&lt;h4&gt;
  
  
  3️⃣ Infra debugging is layered
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;App (ssh)
↓
OS networking stack
↓
Kernel drivers
↓
Network interface
↓
Cloud firewall
↓
Remote kernel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>aws</category>
      <category>devops</category>
      <category>ssh</category>
      <category>networking</category>
    </item>
    <item>
      <title>Full Lab: Accessing and Editing Nginx on Ubuntu VM via VS Code</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Sun, 08 Feb 2026 09:44:46 +0000</pubDate>
      <link>https://dev.to/alok38/full-lab-accessing-and-editing-nginx-on-ubuntu-vm-via-vs-code-1fh6</link>
      <guid>https://dev.to/alok38/full-lab-accessing-and-editing-nginx-on-ubuntu-vm-via-vs-code-1fh6</guid>
      <description>&lt;h2&gt;
  
  
  1️⃣ Accessing the VM via SSH in VS Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: Edit Nginx files (&lt;code&gt;/var/www/html/index.nginx-debian.html&lt;/code&gt;) directly from Windows using VS Code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setup steps:&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;Installed &lt;strong&gt;VS Code&lt;/strong&gt; and &lt;strong&gt;Remote – SSH extension&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Created/edit SSH config (&lt;code&gt;~/.ssh/config&lt;/code&gt;) with:
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host ubuntu-vm
    HostName 192.168.0.169
    User alok
    Port 22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Connected via &lt;strong&gt;Remote-SSH: Connect to Host → ubuntu-vm&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Outcome&lt;/strong&gt;: Successfully opened the VM’s filesystem and terminal in VS Code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2️⃣ First Issue: Permission denied in VS Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Error:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Failed to save 'index.nginx-debian.html': Unable to write file vscode-remote://ssh-remote+ubuntu-vm/var/www/html/index.nginx-debian.html (NoPermissions)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/var/www/html&lt;/code&gt; and &lt;code&gt;index.nginx-debian.html&lt;/code&gt; are owned by root:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt; -rw-r--r-- 1 root root index.nginx-debian.html
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;VS Code SSH session runs as &lt;code&gt;alok&lt;/code&gt;, so it cannot write to root-owned files.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Why this happens&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nginx web root is restricted to prevent accidental edits by non-root users.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  3️⃣ Troubleshooting and Solution
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Option A: Edit with sudo in terminal (quick fix)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /var/www/html/index.nginx-debian.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option B: Change ownership for lab use (I prefer this)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R alok:alok /var/www/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chown&lt;/code&gt; = change ownership&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-R&lt;/code&gt; = recursively for all files/folders in &lt;code&gt;/var/www/html&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alok:alok&lt;/code&gt; = user &lt;code&gt;alok&lt;/code&gt; and group &lt;code&gt;alok&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Effect&lt;/strong&gt;: Your VS Code SSH session now has &lt;strong&gt;write access&lt;/strong&gt;, solving EACCES errors.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;✅ Important: Safe for lab/development. Not recommended on production servers.&lt;/p&gt;




&lt;h2&gt;
  
  
  4️⃣ Editing the Nginx default page
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Opened &lt;code&gt;/var/www/html/index.nginx-debian.html&lt;/code&gt; in VS Code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replaced default HTML with:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;NginX Demo Page&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;NginX demo page from Ubuntu VM&amp;lt;/h1&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Saved file successfully after fixing ownership.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: Accessing &lt;code&gt;http://192.168.0.169/&lt;/code&gt; from Windows Chrome or other LAN devices showed the updated page.&lt;/p&gt;




&lt;h2&gt;
  
  
  5️⃣ Exploring the default Nginx setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web root&lt;/strong&gt;: &lt;code&gt;/var/www/html&lt;/code&gt; → place static HTML, CSS, JS files here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuration files&lt;/strong&gt;: &lt;code&gt;/etc/nginx/sites-available/default&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key parts of default Nginx server block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;root /var/www/html&lt;/code&gt; → serves files from web root&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;index ...&lt;/code&gt; → default file names&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;location /&lt;/code&gt; → maps URL paths to file system&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Learning points&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Nginx serves files based on server blocks and &lt;code&gt;root&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Changes in &lt;code&gt;/var/www/html&lt;/code&gt; are &lt;strong&gt;immediately visible&lt;/strong&gt; after reload.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6️⃣ Testing and verification
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Edited &lt;code&gt;index.html&lt;/code&gt; → refreshed in browser → confirmed changes appear.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Checked logs for troubleshooting:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Logs confirmed &lt;strong&gt;requests hitting the server&lt;/strong&gt; and showed no errors.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7️⃣ Key Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SSH with VS Code&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Configuring &lt;code&gt;~/.ssh/config&lt;/code&gt; makes connecting to VM fast and repeatable.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Permissions are critical&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web root files are &lt;strong&gt;root-owned&lt;/strong&gt; → editing as normal user fails.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;chown -R alok:alok /var/www/html&lt;/code&gt; fixes permissions in a safe lab environment.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Default Nginx setup&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/var/www/html&lt;/code&gt; = default web root&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/etc/nginx/sites-available/default&lt;/code&gt; = default server config&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Editing files here immediately updates the served page&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Testing workflow&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Always check &lt;strong&gt;LAN access&lt;/strong&gt; using browser&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitor logs for access/errors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use VS Code Remote-SSH for easy editing&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ✅ Outcome
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;VM is &lt;strong&gt;fully reachable&lt;/strong&gt; from Windows host and LAN devices.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nginx &lt;strong&gt;serves my custom HTML&lt;/strong&gt; correctly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VS Code edits work without errors thanks to ownership fix.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Foundation is ready for &lt;strong&gt;next steps&lt;/strong&gt;: multiple sites, reverse proxy, web apps, firewall, and security configuration.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ssh</category>
      <category>vscode</category>
      <category>nginx</category>
      <category>vmware</category>
    </item>
    <item>
      <title>How to Access Nginx Homepage on Your Smartphone from an Ubuntu VM</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Sun, 08 Feb 2026 08:46:34 +0000</pubDate>
      <link>https://dev.to/alok38/how-to-access-nginx-homepage-on-your-smartphone-from-an-ubuntu-vm-ejc</link>
      <guid>https://dev.to/alok38/how-to-access-nginx-homepage-on-your-smartphone-from-an-ubuntu-vm-ejc</guid>
      <description>&lt;h1&gt;
  
  
  🧪 Accessing Nginx from Mobile: Full Journey
&lt;/h1&gt;

&lt;p&gt;Accessing your Nginx web server from a smartphone might seem tricky at first, especially when it’s running inside an Ubuntu VM on VMware. Whether you’re experimenting with web development, learning DevOps, or just testing your local projects, being able to view your Nginx homepage on any device is a crucial skill. In this guide, we’ll walk you through every step — from setting up the VM’s network correctly, configuring Nginx, and troubleshooting connectivity issues, to finally accessing your server from a phone or other devices on the same network. By the end, you’ll understand how LAN networking, private IPs, and bridging work in practice, and you’ll be confidently serving your Nginx pages across multiple devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Virtualization&lt;/strong&gt;: VMware Workstation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Guest OS&lt;/strong&gt;: Ubuntu (any recent LTS, e.g., 22.04)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web Server&lt;/strong&gt;: Nginx (latest stable)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Networking&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bridged networking (VMnet0)&lt;/li&gt;
&lt;li&gt;Host firewall: UFW (Ubuntu)&lt;/li&gt;
&lt;li&gt;LAN access for devices on same Wi-Fi&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Host OS&lt;/strong&gt;: Windows 10/11 (used to SSH and browser test)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Client Devices&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Windows browser (Chrome/Edge)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Smartphone (iOS/Android) on same Wi-Fi&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optional Tools&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;SSH (PowerShell or terminal)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;curl (for local testing)&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;ngrok / localtunnel (if exposing Nginx outside LAN)&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptj2mfb1mdw6op8m9eot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptj2mfb1mdw6op8m9eot.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ Initial Attempt
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Situation&lt;/strong&gt;: VM is running Ubuntu with Nginx. IP on VM: 192.168.45.100 (NAT network).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From Windows host&lt;/strong&gt;: &lt;a href="http://192.168.45.100" rel="noopener noreferrer"&gt;http://192.168.45.100&lt;/a&gt; works ✅&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From phone&lt;/strong&gt;: &lt;a href="http://192.168.45.100" rel="noopener noreferrer"&gt;http://192.168.45.100&lt;/a&gt; times out ❌&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Observation&lt;/strong&gt;: Windows can access VM (same host), phone cannot.&lt;/p&gt;




&lt;h2&gt;
  
  
  2️⃣ Diagnosing the problem
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ping &lt;code&gt;192.168.45.100&lt;/code&gt; from Windows host → &lt;strong&gt;timed out&lt;/strong&gt; at first when NAT IP was used with earlier network misconfiguration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ssh alok@192.168.45.100&lt;/code&gt; → &lt;strong&gt;connection timed out&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;hostname -I&lt;/code&gt; on Ubuntu VM showed both NAT and Bridged IPs after some bridging attempts:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.45.100 192.168.0.169
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ip route&lt;/code&gt; showed default via NAT: &lt;code&gt;192.168.45.2&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The VM had &lt;strong&gt;two IPs&lt;/strong&gt; and the &lt;strong&gt;default route pointed to NAT&lt;/strong&gt;, so devices outside Windows host could not reach the VM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Network was inconsistent due to VMware NAT + Bridged mix.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3️⃣ Switching to Bridged networking
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In VMware Workstation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network adapter set to &lt;strong&gt;Bridged&lt;/strong&gt; (explicit Wi-Fi adapter selected)&lt;/li&gt;
&lt;li&gt;✅ “Replicate physical network connection state” checked&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Virtual Network Editor checked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VMnet0 → Bridged → Wi-Fi adapter&lt;/li&gt;
&lt;li&gt;VMnet1 → Host-only → ok&lt;/li&gt;
&lt;li&gt;VMnet8 → NAT → not used&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Observation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Ubuntu still had old NAT IP (&lt;code&gt;192.168.45.100&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Default route still pointed to NAT&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows host could reach Bridged IP (192.168.0.169), but the phone could not because it was on mobile data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4️⃣ Cleaning up Ubuntu network
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Removed NAT IP:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ip addr del 192.168.45.100/24 dev ens33
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Deleted old default route (if present):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ip route del default via 192.168.45.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Renewed DHCP to get proper LAN IP:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dhclient -v -r ens33
sudo dhclient -v ens33
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Verified with:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hostname -I
ip route
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.169
default via 192.168.0.1 dev ens33
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Clean, single IP on LAN → default route correct.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5️⃣ Testing Nginx from Windows
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;http://192.168.0.169&lt;/code&gt; → Nginx default page loads ✅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Observation&lt;/strong&gt;: Works on Windows because host and VM are on same LAN/subnet.&lt;/p&gt;




&lt;h2&gt;
  
  
  7️⃣ Solution: phone must be on same LAN
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connected phone to &lt;strong&gt;same public Wi-Fi&lt;/strong&gt; as laptop/VM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;http://192.168.0.169&lt;/code&gt; on phone → &lt;strong&gt;works&lt;/strong&gt; ✅&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Both phone and VM are now on &lt;strong&gt;same subnet&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Phone can send packets directly to VM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nginx responds → page loads&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8️⃣ Key Networking Lessons
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Fix / Concept&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Page loads on Windows, not phone&lt;/td&gt;
&lt;td&gt;Phone on different network (carrier)&lt;/td&gt;
&lt;td&gt;Connect phone to same Wi-Fi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM has two IPs (&lt;code&gt;192.168.45.x&lt;/code&gt; + &lt;code&gt;192.168.0.x&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;NAT + Bridged overlap&lt;/td&gt;
&lt;td&gt;Remove NAT IP and renew DHCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSH/ping fail&lt;/td&gt;
&lt;td&gt;Wrong default route&lt;/td&gt;
&lt;td&gt;Reset default route to LAN gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Page loads on LAN only&lt;/td&gt;
&lt;td&gt;Nginx listens on all interfaces&lt;/td&gt;
&lt;td&gt;Ensure &lt;code&gt;0.0.0.0:80&lt;/code&gt; in Nginx&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Important Concepts&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;NAT vs Bridged&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NAT → VM hidden behind host → only host can reach VM&lt;/li&gt;
&lt;li&gt;Bridged → VM is like a real LAN computer → any device on LAN can reach&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Private IPs are local&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;192.168.x.x&lt;/code&gt; not routable over internet → devices outside LAN cannot reach&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Default route matters&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All traffic leaves via default gateway → stale NAT route breaks connectivity&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Optional: Access VM outside LAN
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use a tunneling tool like &lt;strong&gt;ngrok&lt;/strong&gt; or &lt;strong&gt;localtunnel&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Port-forward on your router to make VM public (not recommended for public Wi-Fi)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nginx worked from Windows because host and VM shared the LAN; it failed on the phone because the phone was on a different network. Connecting the phone to the same Wi-Fi brought it into the same subnet, making the VM reachable.&lt;/p&gt;

</description>
      <category>nginx</category>
      <category>vmware</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>How to Host a Website on an Ubuntu VM Using VMware and Nginx and get unstuck if it doesn't load (Step-by-Step Guide)</title>
      <dc:creator>alok-38</dc:creator>
      <pubDate>Sun, 08 Feb 2026 06:08:20 +0000</pubDate>
      <link>https://dev.to/alok38/how-to-host-a-website-on-an-ubuntu-vm-using-vmware-and-nginx-step-by-step-guide-21io</link>
      <guid>https://dev.to/alok38/how-to-host-a-website-on-an-ubuntu-vm-using-vmware-and-nginx-step-by-step-guide-21io</guid>
      <description>&lt;h1&gt;
  
  
  🧪 Ubuntu VM Web Server Lab (VMware + SSH + Nginx)
&lt;/h1&gt;

&lt;p&gt;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).&lt;/p&gt;

&lt;h2&gt;
  
  
  🧰 Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10/11 (Host OS)
&lt;/li&gt;
&lt;li&gt;Ubuntu Linux (Guest VM)
&lt;/li&gt;
&lt;li&gt;VMware Workstation
&lt;/li&gt;
&lt;li&gt;Nginx Web Server
&lt;/li&gt;
&lt;li&gt;SSH (from PowerShell)
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎯 Why I installed Nginx
&lt;/h2&gt;

&lt;p&gt;I installed &lt;strong&gt;Nginx&lt;/strong&gt; to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Practice hosting a web service on a Linux server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test networking between &lt;strong&gt;Windows (host)&lt;/strong&gt; and &lt;strong&gt;Ubuntu VM (guest)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Learn real-world troubleshooting: firewall, ports, VM networking&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build skills that directly transfer to &lt;strong&gt;AWS EC2&lt;/strong&gt; and DevOps work&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🛠 Setup Overview
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Host OS: Windows&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VM: Ubuntu on VMware Workstation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access method: SSH from PowerShell&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Goal: Access a web page on the VM from Windows browser&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1️⃣ Connect to Ubuntu VM via SSH (from PowerShell)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh alok@&amp;lt;VM_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2️⃣ Install and start Nginx on Ubuntu
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify Nginx is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test locally on the VM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ This confirmed Nginx was working inside the VM.&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ Find the VM’s IP address
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hostname -I
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.80.129
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4️⃣ Try accessing from Windows browser
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://192.168.80.129
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❌ Issue: Page kept loading / timed out&lt;br&gt;
Error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERR_CONNECTION_TIMED_OUT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5️⃣ Check Ubuntu firewall (UFW)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output showed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Port 22 (SSH) allowed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ports 3000, 5000, 8000 allowed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;❌ Port 80 NOT allowed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔧 Fix: Allow HTTP (port 80)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 80/tcp
sudo ufw reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tried browser again ❌&lt;br&gt;
Still timing out → meaning &lt;strong&gt;firewall wasn’t the only issue&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  6️⃣ Confirm Nginx was not the problem
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
curl http://localhost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Nginx: ✅ running&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;curl localhost: ✅ works&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Conclusion:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App layer is fine. Problem is networking between Windows ↔ VM.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  7️⃣ Verify VMware network mode
&lt;/h2&gt;

&lt;p&gt;Checked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;VMware → VM Settings → Network Adapter&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mode: ✅ NAT (already selected)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So NAT wasn’t misconfigured, but NAT services might be broken.&lt;/p&gt;
&lt;h2&gt;
  
  
  8️⃣ Fix VMware NAT networking (host-side issue)
&lt;/h2&gt;

&lt;p&gt;On &lt;strong&gt;Windows&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Press &lt;code&gt;Win + R&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services.msc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Restart:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;✅ VMware NAT Service&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✅ VMware DHCP Service&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This fixed the broken network path between Windows and the VM.&lt;/p&gt;
&lt;h2&gt;
  
  
  9️⃣ Test again from Windows
&lt;/h2&gt;

&lt;p&gt;In Chrome:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://192.168.80.129
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Nginx page loaded successfully&lt;br&gt;
&lt;strong&gt;Problem solved&lt;/strong&gt; 🎉&lt;/p&gt;
&lt;h2&gt;
  
  
  🧠 Root Cause Summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;App (Nginx)&lt;/td&gt;
&lt;td&gt;✅ Working&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local access&lt;/td&gt;
&lt;td&gt;✅ &lt;code&gt;curl localhost&lt;/code&gt; works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ubuntu firewall&lt;/td&gt;
&lt;td&gt;❌ Port 80 blocked (fixed)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VMware NAT service&lt;/td&gt;
&lt;td&gt;❌ Broken on Windows (fixed by restarting services)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser access&lt;/td&gt;
&lt;td&gt;❌ Timeout → ✅ Works after fixes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  🔍 Troubleshooting Commands Used
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;On Ubuntu VM&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;On Windows&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh alok@&amp;lt;VM_IP&amp;gt;
ping &amp;lt;VM_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Windows UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;services.msc&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Restart &lt;strong&gt;VMware NAT Service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Restart &lt;strong&gt;VMware DHCP Service&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  💡 What this taught me (real-world skills)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How web servers work on Linux&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How ports and firewalls affect access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How VM networking (NAT) works&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to isolate problems by layer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App&lt;/li&gt;
&lt;li&gt;Firewall&lt;/li&gt;
&lt;li&gt;Network&lt;/li&gt;
&lt;li&gt;Host services&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This is &lt;strong&gt;exactly the same thinking&lt;/strong&gt; I'll use when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An EC2 instance won’t load&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Docker container isn’t reachable&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A service times out in production&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>webserver</category>
      <category>vmware</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
