<?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: Hiiiirth</title>
    <description>The latest articles on DEV Community by Hiiiirth (@hiiiirth).</description>
    <link>https://dev.to/hiiiirth</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4166365%2Faac9308b-1ada-48cc-8376-31b1f1db0987.png</url>
      <title>DEV Community: Hiiiirth</title>
      <link>https://dev.to/hiiiirth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hiiiirth"/>
    <language>en</language>
    <item>
      <title>How I Fixed the VMware Ubuntu Network Configuration Nightmare (with Automated Scripts)</title>
      <dc:creator>Hiiiirth</dc:creator>
      <pubDate>Tue, 06 Oct 2026 16:03:13 +0000</pubDate>
      <link>https://dev.to/hiiiirth/how-i-fixed-the-vmware-ubuntu-network-configuration-nightmare-with-automated-scripts-1nfc</link>
      <guid>https://dev.to/hiiiirth/how-i-fixed-the-vmware-ubuntu-network-configuration-nightmare-with-automated-scripts-1nfc</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — VMware + Ubuntu networking breaks in ways that look like four different problems but are actually one. Here's the 6-layer checklist I now run, the three mistakes that cost me most of the evening, and the script I wrote so I never do it by hand again.&lt;/p&gt;
&lt;h2&gt;
  
  
  "Three hours, five reboots, and one blinking cursor"
&lt;/h2&gt;

&lt;p&gt;I set up an Ubuntu 26.04 LTS VM on VMware Workstation Pro 17 to learn Linux properly. The installation took twenty minutes. The networking took three hours.&lt;br&gt;
My terminal sat on this for most of it:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 2 192.168.182.2
Destination Host Unreachable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then, after I "fixed" that:&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="nv"&gt;$ &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 2 baidu.com
ping: baidu.com: Name or service not known
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The VM could reach its gateway but could not resolve a single hostname. So I did what everyone does: rebooted five times, toggled settings I did not understand, and pasted forum commands into a root shell — which is exactly how a twenty-minute problem becomes a reinstall.&lt;/p&gt;

&lt;p&gt;Since then I have read a lot of "VMware Ubuntu can't connect" threads, and the same three root causes show up again and again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistake #1: Picking a network mode without knowing how to verify it
&lt;/h2&gt;

&lt;p&gt;VMware offers three modes:&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;Your VM sits&lt;/th&gt;
&lt;th&gt;Outbound internet&lt;/th&gt;
&lt;th&gt;LAN can reach your VM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NAT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Behind your host (host acts as a router)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No (unless you add port forwarding)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bridged&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;As a peer on your physical LAN&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Host-only&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;On a private link to the host only&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Choosing between them is easy. &lt;strong&gt;Knowing which one you are actually on — and what it implies — is the hard part.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is the one command that answers it:&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;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;default via 192.168.182.2 dev ens33 proto static
192.168.182.0/24 dev ens33 proto kernel scope link src 192.168.182.128
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it bottom-up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The second line says: this subnet (.0/24) is directly attached to ens33; I do not need a gateway for it.&lt;/li&gt;
&lt;li&gt;The first line says: for anything else, hand the packet to 192.168.182.2.
That &lt;code&gt;.2&lt;/code&gt; address is the tell. Under &lt;strong&gt;NAT&lt;/strong&gt;, the gateway is VMware's virtual router — which means your host can reach the VM, but your colleague's laptop on the same Wi-Fi &lt;strong&gt;cannot&lt;/strong&gt;. Under &lt;strong&gt;Bridged&lt;/strong&gt;, the gateway is your real router, and the VM is visible to the whole LAN.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That single difference decides whether your "it works for me" demo works at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistake #2: A service listening on 127.0.0.1 while you test from the host
&lt;/h2&gt;

&lt;p&gt;Symptom: the service is definitely running. curl inside the VM returns a page instantly. The browser on your host times out.&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="nb"&gt;sudo &lt;/span&gt;ss &lt;span class="nt"&gt;-tlnp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LISTEN 0 128   127.0.0.1:8080   0.0.0.0:*   users:(("python3",pid=...))
LISTEN 0 128     0.0.0.0:22     0.0.0.0:*   users:(("sshd",pid=...))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line only accepts connections &lt;strong&gt;from inside the VM&lt;/strong&gt;. The second accepts them on any interface the firewall allows. This is not a VMware problem, a Netplan problem, or a firewall problem — it is an address-binding problem, and it is where a huge share of "works locally, not remotely" tickets are born.&lt;/p&gt;

&lt;p&gt;Fix the bind address, then re-test. Do not touch the firewall until you have confirmed which address the service is on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistake #3: The slow-VM trap — and the clipboard you did not know was broken
&lt;/h2&gt;

&lt;p&gt;This one is not about ports at all, and it is the one nobody warns you about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3a. Your host may be holding the CPU virtualization extensions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On modern Windows, Memory Integrity (VBS/HVCI) reserves VT-x, so VMware cannot drive it directly and instead coexists via the Windows Hypervisor Platform (WHP). You can check which mode you are actually in, in vmware.log:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Monitor Mode: ULM      # coexisting through WHP
Monitor Mode: CPL0     # VMware owns VT-x 
directly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are on ULM and wondering why nested virtualization refuses to work, that is why. (And do &lt;strong&gt;not&lt;/strong&gt; tick "Virtualize Intel VT-x/EPT" in the VM's processor settings in this mode — the VM simply will not boot.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3b. If &lt;code&gt;open-vm-tools&lt;/code&gt; is missing, your clipboard is silently dead.&lt;/strong&gt;&lt;br&gt;
You copy a command on the host, press paste in the VM terminal, and nothing happens. Debugging network configuration without copy-paste is a different, much slower game — and it burns time you will never attribute to the right cause.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dpkg &lt;span class="nt"&gt;-l&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;open-vm-tools        &lt;span class="c"&gt;# want "ii" = installed&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; open-vm-tools open-vm-tools-desktop
&lt;span class="c"&gt;# then log out and back in (or reboot) — the user-space parts only load on a fresh session&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The 6-layer checklist I run instead of guessing
&lt;/h2&gt;

&lt;p&gt;This is the part worth stealing. A request has to pass six gates. Test them bottom-up, and &lt;strong&gt;stop at the first one that fails:&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 addr show | &lt;span class="nb"&gt;grep &lt;/span&gt;inet      &lt;span class="c"&gt;# 1. Do I have an address at all?&lt;/span&gt;
ping &lt;span class="nt"&gt;-c&lt;/span&gt; 2 &amp;lt;your-gateway&amp;gt;      &lt;span class="c"&gt;# 2. Can I reach my gateway?&lt;/span&gt;
ping &lt;span class="nt"&gt;-c&lt;/span&gt; 2 223.5.5.5           &lt;span class="c"&gt;# 3. Can I leave the subnet? (raw IP — no DNS involved)&lt;/span&gt;
dig example.com +short        &lt;span class="c"&gt;# 4. Does DNS resolve?&lt;/span&gt;
nc &lt;span class="nt"&gt;-zv&lt;/span&gt; example.com 80         &lt;span class="c"&gt;# 5. Is the remote port open?&lt;/span&gt;
curl &lt;span class="nt"&gt;-sI&lt;/span&gt; http://example.com   &lt;span class="c"&gt;# 6. Does the application answer?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three rules make this work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Bottom-up, always.&lt;/strong&gt; Skipping to layer 6 is how you spend an hour debugging Nginx when your DNS is broken.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every layer must be testable in isolation.&lt;/strong&gt; Layer 3 uses a raw IP precisely so DNS cannot contaminate the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;After fixing a layer, re-test from the top.&lt;/strong&gt; DNS being fixed does not mean the site loads.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have never needed a seventh check.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I deliberately left out of this post
&lt;/h2&gt;

&lt;p&gt;The checklist above is 80% of the value, and it is free — please use it.&lt;/p&gt;

&lt;p&gt;But the part that actually ate my evening was not the checklist. It was the tedious, easy-to-get-wrong detail around it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Netplan YAML edge cases.&lt;/strong&gt; One wrong indent and you are locked out of your own VM. netplan try exists and auto-rolls-back after 120 seconds — I did not know that, and I learned it the hard way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An APT source list that half-applied.&lt;/strong&gt; A sed replacement matched part of a hostname and left a prefix dangling, so package updates were silently coming from two different mirrors at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A phantom source file.&lt;/strong&gt; A single typo in one cp command created ubumt.sources. APT loads anything ending in .sources, so a mirror I believed I had removed was still live — and the "wrong" file I was inspecting was never the one doing the damage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verifying DNS without trusting&lt;/strong&gt; 
/etc/resolv.conf. On Ubuntu it points at 127.0.0.53, the local stub — not your actual upstream. Reading that file tells you almost nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Knowing which of these changes are safe to roll back, and how.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Diagnosing and fixing all of this took me hours. To save you the time, I packaged the full troubleshooting document, the automated configuration shell scripts, and the rollback plan into a "Doc + Scripts" bundle. &lt;strong&gt;If you're interested in getting a copy, feel free to DM me here, and I'll share the details with you!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Every check in it is one I broke my own VM to learn. If you would rather keep debugging by hand — genuinely, more power to you: the checklist above plus man pages will get you there.
&lt;/h2&gt;

&lt;p&gt;Hit a specific error message while setting this up? Drop it in the comments and I will take a look — I read every one.&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>linux</category>
      <category>devops</category>
      <category>vmvare</category>
    </item>
  </channel>
</rss>
