DEV Community

Kapil Gorve
Kapil Gorve

Posted on • Originally published at jskap.com on

Move/Install WSl distro from C drive to another drive

'cover'

I have a small 128GB SSD. I run out of space when I install ReactNative related dev tools. So I wanted to find a way to install/move my existing distro to different location than C drive.

Move WSL to another drive

- Install LxRunOffline tool. choco install lxrunoffline

lxrunoffline list List all the installed distros on your system. I get output like this.

Microsoft Windows [Version 10.0.19041.207]
(c) 2020 Microsoft Corporation. All rights reserved.
D:\work>lxrunoffline list
Ubuntu-18.04
docker-desktop
docker-desktop-data
D:\work>
  • lxrunoffline move -n Ubuntu-18.04 -d G:\wsl\ . Move your distro to another drive. My distro name here is Ubuntu-18.04. I am moving it to G drive and wsl folder inside it. It would take some time to finish moving.

You can use the same move command to move your distro from default location to a different location inside C Drive.

👋 Hi! I’m Kapil. I am always chatty about building things, sharing my learnings, freelancing. Come say hi to me at https://twitter.com/kapilgorve

Oldest comments (5)

Collapse
 
anmoltomer profile image
Anmol Tomer

After you do this, need to restart your Windows10 machine only after that you will have your WSL working properly. Should have been mentioned in the article. Wasted an hour reading lxrunoffline and WSL docs.

Collapse
 
dineshkidd profile image
dineshkidd

After this ,wsl opens only in admin mode.

Collapse
 
undercontr profile image
undercontr

Did you manage to solve the root login in wsl after move the WSL?

Collapse
 
dineshkidd profile image
dineshkidd

Nope , reinstalled on HDD.

Thread Thread
 
undercontr profile image
undercontr

But it is not possible to install microsoft store applications to other HDD then the one windows installed in it. I tried it but it login with root with I don't want.