Default values for opening links in WSL

Abstract: Resolves command not found errors when opening URLs in WSL by configuring wslview or native URI handlers.

Created: 2026-08-31 by

WSL does not have a built-in default browser for opening links from the command line. The behavior depends entirely on whether you are using the wslu package or a specific Windows build that supports native URI handlers. To configure this, you must install the appropriate helper tools and set environment variables to point to the correct execution path.

Understanding the Default Behavior

When you type a URL into a terminal running inside Windows Subsystem for Linux (WSL), the system needs a bridge to communicate with the Windows host operating system. By default, modern versions of WSL2 attempt to use a mechanism called wslview. However, this utility is not included in the base Ubuntu or Debian images installed via the Microsoft Store. If you do not have the necessary packages installed, attempting to open a link will result in a "command not found" error. The confusion often arises because users expect the Linux environment to know which browser is set as their default in Windows. It does not. The Linux kernel has no access to the Windows Registry or the user's preferred application settings by default. Therefore, the "default value" is effectively null until you explicitly configure a handler. This setup is distinct from general disk space management or remote desktop configurations, which are separate subsystems within the WSL architecture. For more information on managing your WSL installation, see our guide on Why is WSL taking up more disk space than it says it is?.

Method 1: Using the wslu Package (Recommended)

The most robust and widely supported method for handling URLs in WSL is using the wslu utilities. This package provides a suite of tools designed specifically to bridge the gap between Linux commands and Windows capabilities. It includes wslview, which can handle various URI schemes including HTTP, HTTPS, and file paths. To implement this solution, follow these steps:
  1. Install the wslu package: Open your Ubuntu terminal and run the following command to update your package list and install the utilities. You may need to use sudo depending on your user permissions.
sudo apt update
sudo apt install wslu
    Verify Installation: After installation, verify that the wslview command is available by typing wslview --help. This should display usage instructions without throwing an error.
wslview --help
    Test the Configuration: Now, try opening a simple website by running wslview https://www.example.com. The browser configured as your default in Windows should launch automatically.
This method works across almost all versions of WSL2 and is compatible with both Windows 10 and Windows 11. It is also consistent with other GUI applications you might want to run, such as those discussed in our article on Using Burp Suite within WSL (GUI)[Debian]: A Tech Support Guide, where similar bridging techniques are required.

Method 2: Native URI Handling in Newer Builds

Microsoft has been working on integrating native URI handling directly into the WSL kernel interface. In certain newer builds of Windows 11 and updated WSL versions, the system may automatically detect and open URLs if they are passed correctly. However, relying solely on this feature can be risky because it depends heavily on your specific Windows version and the current state of the WSL update channel. If you find that wslview is not recognized and you are on a very recent build, check if the system responds to direct URL arguments in standard commands. For example, some text editors like nano or vim might trigger a browser open if linked properly, but this is inconsistent. The safest approach remains installing wslu as described above. If you encounter issues with your WSL installation after updates, refer to our troubleshooting guide for Fixing WSL Not Working After Moving Ubuntu from C to D, as permission changes can sometimes break external tool integrations.

Customizing Browser Preferences

Since WSL relies on the Windows host for rendering web content, your browser choice is determined by Windows settings, not Linux settings. To change which browser opens when you click a link in WSL, you must adjust your default apps in Windows. Navigate to Settings > Apps > Default apps in Windows. Select your preferred browser (e.g., Chrome, Firefox, Edge) and set it as the default for HTTP and HTTPS protocols. Once this is done, any call to wslview from your WSL terminal will respect this Windows-level configuration. There is no need to modify environment variables in .bashrc or .zshrc unless you want to create custom aliases for convenience. For instance, you can add the following line to your shell configuration file to make opening URLs faster:
alias browse='wslview'
After saving the file, reload your shell with source ~/.bashrc. You can now simply type browse google.com to open Google in your default browser. This alias approach is particularly useful if you frequently switch between different browsers for testing purposes.

Troubleshooting Common Issues

Even with wslu installed, you may encounter situations where links fail to open. The most common cause is a mismatch between the WSL distribution and the Windows build. Ensure that your WSL version is up to date by running wsl --update in PowerShell or Command Prompt. Another potential issue involves network permissions. If your corporate firewall blocks outgoing connections from WSL, the browser may hang while trying to resolve the domain. In such cases, verify that your Windows firewall allows inbound and outbound traffic for your chosen browser. Additionally, ensure that you are not running multiple instances of the same browser that might conflict with the URI handler registration. If you are migrating your WSL environment, such as transferring it to a USB drive, be aware that registry keys and environment variables might not carry over seamlessly. Always reinstall wslu after moving your installation to ensure the binary paths are correctly registered in the new environment. See our guide on Can I Transfer My WSL Ubuntu Installation to a USB and Run It from There? for details on migration best practices.

Frequently Asked Questions

Does WSL 1 support wslview?

No, wslview is primarily designed for WSL 2 due to its reliance on the improved interoperability features between Windows and Linux. WSL 1 uses a different translation layer that may not support these external utilities as effectively. Upgrading to WSL 2 is recommended for full URL handling support.

Can I open local HTML files from WSL?

Yes, wslview can open local file paths. Simply pass the absolute path to the HTML file, such as wslview /mnt/c/Users/Name/Documents/index.html. The browser will render the local page just as it would a remote URL.

What if my default browser is Edge but I want Chrome?

You cannot force a specific browser from within Linux alone. You must change your default browser setting in Windows Settings. Once Windows is configured to use Chrome for HTTP/HTTPS, all wslview calls will automatically open Chrome.

Is there a way to open links in a specific tab of an existing browser window?

Standard wslview functionality does not support attaching to existing browser tabs. It typically launches a new window or tab depending on your browser's default behavior. Advanced scripting would be required to achieve this, which is beyond the scope of basic WSL configuration.

Why does wslview fail after a Windows update?

Windows updates can sometimes reset default app associations or update WSL components that temporarily break compatibility. Re-running wsl --update and verifying your default browser settings in Windows usually resolves the issue. If problems persist, reinstalling the wslu package ensures you have the latest binaries.

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