WSL and VM: Unable to Connect WSL2 Ubuntu to VMware VM

Abstract: Resolve WSL2 Ubuntu connectivity issues with VMware VMs by aligning network modes and disabling Windows Firewall blocks.

Created: 2026-10-11 by

Connect WSL2 Ubuntu to a VMware VM by configuring the virtual network adapter to use NAT or Host-Only mode, ensuring both environments share the same subnet. You must then disable Windows Firewall rules that block local traffic and verify connectivity using ping from within the WSL terminal to confirm the IP address resolution is functioning correctly.

Understanding Network Isolation in Virtual Environments

When running WSL2 alongside VMware Workstation or Fusion on a Windows host, you are dealing with two distinct virtualization layers. WSL2 operates inside a lightweight utility VM, which itself runs as a Hyper-V virtual machine. VMware creates its own virtual switch infrastructure. By default, these networks are isolated from each other to prevent security conflicts and IP address collisions. This isolation often leads to the inability of your Ubuntu instance to reach the VMware virtual machine, resulting in connection timeouts or unreachable hosts.

The core issue usually stems from how the virtual network adapters are configured. If the VMware virtual machine is set to use "Bridged" networking, it attempts to connect directly to your physical network interface. However, WSL2 uses a virtual Ethernet adapter that may not be routed correctly through the host's physical NIC when VMware is active. Conversely, if VMware is set to NAT, it places the VM in a private subnet that is invisible to the external world, including WSL2, unless specific port forwarding rules are established.

To resolve this, you need to align the networking modes so that both the WSL2 utility VM and the VMware guest can see each other. The most reliable method involves using a shared internal network segment. This ensures that both hypervisors route traffic through a common virtual switch managed by the Windows host. It is crucial to check the current status of your network interfaces to determine which mode is currently active for both systems before making changes.

Configuring VMware Network Settings

The first step in troubleshooting this connectivity issue is to adjust the settings within VMware. Open the VMware application and navigate to the settings of the specific virtual machine you are trying to reach. Locate the network adapter configuration section. Here, you will typically see options such as Bridged, NAT, and Host-Only. For WSL2 integration, the Host-Only option is often the safest choice because it creates an isolated network that is strictly between the host and the guest, bypassing potential issues with bridging to physical hardware.

If you prefer to keep the VM accessible from the broader network, you might try switching to NAT mode. In NAT mode, VMware assigns the VM an IP address within a private range (typically starting with 192.168.x.x). You must then ensure that this subnet does not conflict with the subnet used by WSL2. You can check the WSL2 IP by opening a PowerShell window and running wsl hostname -I. If the subnets overlap, you must change the VMware NAT subnet via the Virtual Network Editor in VMware settings. This editor allows you to modify the subnet mask and gateway for each virtual network adapter.

After changing the network mode, restart the virtual machine to ensure it acquires a new IP address from the updated DHCP server. Verify that the VM has successfully obtained an IP address by logging into the Linux guest and checking its network configuration. Use the command ip addr show to list all active interfaces and their assigned IPs. Note this IP address, as you will need it to establish connections from WSL2.

Adjusting Windows Firewall Rules

Even if the network paths are correct, Windows Firewall may block incoming or outgoing traffic between the virtual adapters. Windows treats each virtual network adapter as a separate network profile, often categorizing them as "Public" networks by default. Public networks have strict firewall rules that block most inbound connections, including ICMP echo requests (ping) and SMB shares.

To fix this, open the Windows Defender Firewall with Advanced Security console. Look for the profiles associated with your virtual network adapters. Change the network location type from Public to Private for both the VMware virtual adapters and the WSL2 virtual ethernet adapter. This action relaxes the firewall rules, allowing local network discovery and file sharing. Additionally, create custom inbound rules to allow ICMPv4 traffic, which is essential for basic connectivity testing.

You should also check if any third-party antivirus software is interfering with virtual network traffic. Some security suites inject themselves into the network stack and may drop packets between virtual adapters. Temporarily disabling such software can help isolate whether it is the cause of the connection failure. Once you have adjusted the firewall settings, test the connection again from WSL2.

Verifying Connectivity from WSL2 Ubuntu

With the network modes aligned and firewall rules adjusted, the final step is to verify connectivity from your WSL2 Ubuntu instance. Open your WSL terminal and attempt to ping the IP address of the VMware VM. Use the command ping [VM_IP_ADDRESS]. If the ping is successful, you have established a basic layer 3 connection. If it fails, double-check the IP addresses and ensure that the VMware VM itself is not blocking ICMP responses in its own internal firewall.

For more complex services like SSH or database connections, ensure that the service is listening on the correct interface. On the VMware VM, check that the service is bound to 0.0.0.0 or the specific LAN IP, rather than just localhost. You can use netstat -tuln on the VM to verify listening ports. From WSL2, use nc -zv [VM_IP_ADDRESS] [PORT] to test TCP connectivity to specific services.

If you encounter persistent issues, consider reviewing related configurations for similar virtualization challenges. For instance, understanding the differences between various Ubuntu versions in Windows environments can sometimes reveal underlying compatibility quirks that affect network stacks. Additionally, if you are moving data between these environments, being aware of common errors during file transfers can help you troubleshoot higher-level application failures.

Frequently Asked Questions

Why can I ping the VMware VM but cannot SSH into it?

This indicates that the network path is functional, but the SSH service on the VM is either not running or blocking connections. Check if the SSH daemon is active on the VMware guest using sudo systemctl status ssh. Ensure that the SSH configuration allows remote logins and that no local firewall on the VM is blocking port 22.

How do I find the IP address of my WSL2 instance?

You can find the IP address by opening a PowerShell window on Windows and running the command wsl hostname -I. This returns the IP address assigned to the WSL2 virtual ethernet adapter. Keep in mind that this IP can change every time WSL2 restarts, so you may need to update your connection scripts accordingly.

Can I use Bridged networking for VMware while using WSL2?

Yes, but it is often problematic. Bridged networking connects the VM directly to your physical network, which can cause IP conflicts if WSL2 and the VM obtain addresses from the same DHCP server. It is generally safer to use Host-Only or NAT modes and manage routing explicitly to avoid interference with your physical network infrastructure.

What if the VMware VM is behind a NAT subnet that blocks WSL2?

In NAT mode, the VM is hidden from external networks. To access it from WSL2, you must configure port forwarding in the VMware NAT settings. Map a specific port on the host to the corresponding port on the VM. Then, connect from WSL2 to the host's IP address (usually 127.0.0.1) on that forwarded port.

Does disabling Hyper-V improve VMware performance?

Disabling Hyper-V can improve VMware performance because VMware relies on similar virtualization extensions. However, WSL2 requires Hyper-V to function. If you disable Hyper-V, WSL2 will stop working. A better approach is to update VMware Workstation to the latest version, which has improved integration with Hyper-V-based technologies like WSL2.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More