• Stars
    star
    1,411
  • Rank 33,029 (Top 0.7 %)
  • Language
    PowerShell
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easily move your WSL distros VHDX file to a new location.

Move WSL

PowerShell script to move WSL 1 and WSL 2 distros VHDX file to a different location.

Interactive Example

Usage

Warning

This script uses official wsl commands and was used by a lot of people. Nevertheless some people had weird issues that resulted in broken WSL disks. Make sure you have a backup of your data, so you can restore in case of an error.

Interactive way of moving wsl for Windows PowerShell.

  1. ./move-wsl.ps1
  2. Select your distro
  3. Enter your target (i.e. D:\wsl target\ubuntu)

Moving Docker WSL

Before moving Docker WSL make sure to stop the Docker service. Otherwise Docker will crash and you may need to reset it to factory defaults.

FAQ

Default user was switched to root when moving a distro

Set your default user inside your distro by adding the following configuration to your /etc/wsl.conf.

[user]
default=YOUR_USERNAME

If the file doesn't exist create it manually. Then exit your distro, terminate it (wsl -t YOUR_DISTRO) and start it again. For further options see Microsoft Docs.

Some distributions also allow settings the default user via command line with YOUR_DISTRO config --default-user YOUR_USER (e.g. ubuntu config --default-user johndoe). Make sure to shutdown your distro before (wsl -t YOUR_DISTRO).

Standard distro switched when moving it

Since we need to unregister to import it with the same name, the standard distro can be switched. Just set your standard distro again:

wsl -s YOUR_DISTRO

WSL version was switched when moving distro

On import the distro will be registered with the current default WSL version. You can set your default WSL version with wsl --set-default-version <Version>. When the WSL version was accidentally changed while moving, you can set the version with wsl --set-version <Distro> <Version>.

More Repositories

1

filament-excel

Excel Export for Filament Admin Resources
PHP
330
star
2

filament-spotlight

Quickly navigate your Filament pages
PHP
223
star
3

filament-activity-log

Spatie activity log integration into Filament
PHP
134
star
4

filament-environment-indicator

Never confuse your tabs with different Filament environments again.
PHP
110
star
5

laravel-pdfable

Keep your PDFs logic in one place.
PHP
38
star
6

php-scoper-prefix-remover

PHP
10
star
7

cobalt2-jetbrains

Cobalt2 Theme for Jetbrains IDE.
Sass
9
star
8

markdown-css

Modern CSS style for nicely formatted markdown exports.
CSS
9
star
9

third-party-checker

Quickly check your websites for third party requests.
JavaScript
9
star
10

acf-configurator

A wrapper for easy local Advanced Custom Fields configuration in php.
PHP
8
star
11

wordpress-notifier

WordPress Notifier is an object oriented helper library for handling WordPress admin notices inside a plugin or theme. It supports persistent notices and dismissible notices out of the box and is extendable.
PHP
4
star
12

lightroom-filematcher

PHP Scripts that matches LR meta data to local files and renames them
PHP
3
star
13

wordpress-cf7-cleverreach-integration

WordPress Plugin: Integrates CleverReach® into Contact Form 7
PHP
2
star
14

filament-translate-action

PHP
1
star
15

website-diff

Utility tool that bundles a crawler and BackstopJS for visual regression testing.
JavaScript
1
star
16

wordpress-cf7-weclapp-integration

Wordpress Plugin: Integrates WeClapp into Contact Form 7 forms
PHP
1
star
17

faker-better-unique

Replaces the default Faker with an extended Faker instance that adds `betterUnique()` – `unique()` based on a key.
PHP
1
star