Installing WSL Ubuntu 20.04.06 in a New Location

Abstract: Resolve conflicts when installing WSL Ubuntu 20.04.06 alongside an existing version by exporting and importing the distribution to a custom directory.

Created: 2026-09-27 by

To install WSL Ubuntu 20.04.06 in a custom directory while retaining the default Ubuntu 20.04.3 installation, you must use the wsl --export and wsl --import commands. This process creates an isolated instance of the newer distribution at your specified path without affecting existing environments or system configurations.

Understanding the Dual Installation Strategy

By default, Windows Subsystem for Linux (WSL) installs distributions into a protected system location that is difficult to access directly. When you need a specific version like Ubuntu 20.04.06 alongside an older stable release such as Ubuntu 20.04.3, simply installing the new package will often overwrite or conflict with the existing one. The most robust solution is to export the desired version from Microsoft’s catalog and import it into a user-defined folder. This approach ensures that both versions can coexist, allowing you to switch between them using distinct window instances or terminal profiles. The core mechanism relies on two primary WSL management commands: wsl --export and wsl --import. The export command packages the root file system of a running distribution into a tarball, while the import command extracts that tarball into a new location and registers it as a separate WSL distribution. This method is particularly useful when you want to preserve the state of your original Ubuntu 20.04.3 installation while experimenting with updates or different configurations in the new environment.

Step-by-Step Installation Process

To begin, ensure that WSL is properly installed on your Windows machine. If you have not yet set up the infrastructure, refer to resources on Unable to Install WSL/Hyper-V on New Machine to troubleshoot any foundational issues before proceeding. Once WSL is active, you can proceed with the following steps to create the new Ubuntu instance. First, download the Ubuntu 20.04.06 distribution package. You can obtain this from the official Microsoft Store or by downloading the .appx file directly from the Ubuntu website. After downloading, you need to extract the rootfs. While you can use third-party tools, the most reliable method involves using PowerShell to handle the archive correctly. Create a temporary directory on your local drive where you will store the exported data and the final installation files. Next, run the following command in PowerShell to export the default Ubuntu distribution if you wish to clone it, or more commonly, you will import a fresh copy. However, since we are targeting a specific minor version (20.04.06), it is often easier to download the tar.gz file associated with that release. Let us assume you have downloaded the ubuntu-20.04.06.tar.gz file. Navigate to your target installation directory in PowerShell. Then, execute the import command:
wsl --import Ubuntu20.04.06 C:\WSL\Ubuntu20.04.06 .\ubuntu-20.04.06.tar.gz
In this command, Ubuntu20.04.06 is the name of the new distribution, C:\WSL\Ubuntu20.04.06 is the absolute path where the files will be stored, and the final argument points to the downloaded tarball. Ensure that the destination folder does not already exist, as the import process will fail if the directory is present. This step effectively copies the file system to your chosen location and registers the new distro within WSL.

Configuring the New Environment

After the import completes, the new distribution is registered but may not have a default user configured. By default, WSL imports often start as the root user. To set up a standard user experience, you should launch the distribution and configure a username. Open PowerShell and type:
wsl -d Ubuntu20.04.06
Once inside the new shell, you can add a regular user account using the adduser command. It is highly recommended to add this user to the sudo group to allow administrative privileges. For example:
sudo adduser [username]
sudo usermod -aG sudo [username]
Replace [username] with your desired login name. After setting the password and user details, you can exit the shell. To make this user the default for future sessions, you need to modify the configuration file located at /etc/wsl.conf inside the new distribution. Add the following lines to the file:
[user]
default=[username]
This configuration ensures that every time you launch Ubuntu20.04.06, you are automatically logged in as the non-root user, enhancing security and aligning with standard Linux practices.

Managing Multiple Distributions

With both Ubuntu 20.04.3 and Ubuntu 20.04.06 installed, you can manage them independently. Use the command wsl -l -v to list all active distributions along with their versions and states. This output helps verify that both instances are running correctly and assigned to the correct paths. You can also assign specific port forwards or network settings to each distribution if needed, though they generally share the same host network interface. If you encounter issues with package repositories, such as certificate verification errors, consult guides on Resolving Certificate Verification Failure in WSL Ubuntu for add-apt-repository to resolve SSL-related obstacles during software installation. This ensures that your new environment can fetch updates and install packages without interruption. Finally, remember that storing WSL distributions in custom locations requires sufficient disk space and appropriate permissions. Regularly backing up the contents of your custom directory via wsl --export can prevent data loss if you ever need to migrate or reinstall the distribution.

Frequently Asked Questions

Can I delete the original Ubuntu 20.04.3 after importing the new version?

Yes, you can safely remove the original distribution using wsl --unregister Ubuntu if you no longer need it. However, be aware that this action permanently deletes all data stored within that specific instance, so ensure you have backed up any important files first. The new installation remains unaffected by this removal.

Why does my new WSL distribution start as root instead of my user?

This occurs because the wsl --import command does not automatically configure a default non-root user. You must manually create a user and update the /etc/wsl.conf file to set the default login identity. Without this configuration, WSL defaults to the root account for security reasons until explicitly changed.

Is it possible to share files between the two Ubuntu installations?

While the file systems are isolated, you can access both from Windows Explorer by navigating to the respective mount points or using the \\wsl$ network path. You can also sync data between them by copying files through the Windows host OS or by using shared volumes mounted within the WSL environment.

What happens if I try to import a distro to a folder that already exists?

The import process will fail if the destination directory is not empty or already exists. You must either choose a different path or delete the existing folder contents before running the import command. Always verify the target directory is clean to avoid permission errors or silent failures.

How do I switch between the two Ubuntu versions in Visual Studio Code?

You can select the specific WSL distribution from the bottom-left corner status bar in VS Code. Click the icon, choose "Connect to WSL," and then select the desired distribution name, such as Ubuntu20.04.06, from the list. This allows you to work in different environments simultaneously within the same editor session.

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