{"id":13599731,"url":"https://github.com/pxlrbt/move-wsl","last_synced_at":"2025-05-15T20:02:45.631Z","repository":{"id":40305318,"uuid":"248784015","full_name":"pxlrbt/move-wsl","owner":"pxlrbt","description":"Easily move your WSL distros VHDX file to a new location.","archived":false,"fork":false,"pushed_at":"2024-05-24T13:56:41.000Z","size":114,"stargazers_count":1503,"open_issues_count":8,"forks_count":153,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-08T01:37:50.770Z","etag":null,"topics":["bash-script","batch-script","maintainer-wanted","powershell","powershell-script","windows","wsl","wsl2"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pxlrbt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-20T15:04:25.000Z","updated_at":"2025-04-07T01:08:12.000Z","dependencies_parsed_at":"2024-11-30T09:00:44.853Z","dependency_job_id":null,"html_url":"https://github.com/pxlrbt/move-wsl","commit_stats":{"total_commits":62,"total_committers":6,"mean_commits":"10.333333333333334","dds":"0.12903225806451613","last_synced_commit":"aab9704579f985bb9c94a9bfe1369cb206cc52b1"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Fmove-wsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Fmove-wsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Fmove-wsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pxlrbt%2Fmove-wsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pxlrbt","download_url":"https://codeload.github.com/pxlrbt/move-wsl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414477,"owners_count":22067270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","batch-script","maintainer-wanted","powershell","powershell-script","windows","wsl","wsl2"],"created_at":"2024-08-01T17:01:10.195Z","updated_at":"2025-05-15T20:02:44.134Z","avatar_url":"https://github.com/pxlrbt.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"\u003e [!Warning]\n\u003e As I switched the OS, I am not updating this script or fixing bugs anymore.  \n\u003e Have a look at the issue tab for some known issues.  \n\u003e Happy to merge PRs with fixes.\n\n# Move WSL\n\nPowerShell script to move WSL 1 and WSL 2 distros VHDX file to a different location.\n\n![Interactive Example](screencast.gif)\n\n## Usage\n\n\u003e **Warning**\n\u003e \n\u003e 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.\n\u003e Make sure you have a backup of your data, so you can restore in case of an error.\n\nInteractive way of moving wsl for Windows PowerShell.\n\n1) `./move-wsl.ps1`\n2) Select your distro\n3) Enter your target (i.e. `D:\\wsl target\\ubuntu`)\n\n## Moving Docker WSL\n\nBefore moving Docker WSL make sure to stop the Docker service. Otherwise Docker will crash and you may need to reset it to factory defaults.\n\n## FAQ\n\n### Default user was switched to root when moving a distro\n\nSet your default user inside your distro by adding the following configuration to your `/etc/wsl.conf`.\n\n```ini\n[user]\ndefault=YOUR_USERNAME\n```\n\nIf 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](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#user).\n\nSome 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`).\n\n### Standard distro switched when moving it\n\nSince we need to unregister to import it with the same name, the standard distro can be switched. Just set your standard distro again:\n\n```sh\nwsl -s YOUR_DISTRO\n```\n\n### WSL version was switched when moving distro\n\nOn import the distro will be registered with the current default WSL version. You can set your default WSL version with `wsl --set-default-version \u003cVersion\u003e`.\nWhen the WSL version was accidentally changed while moving, you can set the version with `wsl --set-version \u003cDistro\u003e \u003cVersion\u003e`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpxlrbt%2Fmove-wsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpxlrbt%2Fmove-wsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpxlrbt%2Fmove-wsl/lists"}