Move Kali Linux Windows WSL installation to another drive other than C

Dr. Gupta
2 min readOct 11, 2021

--

In this tutorial, I am sharing how I have moved my Kali Linux installation to other drive other than C.

When you are going to install Kali Linux inside windows WSL then It will automatically install it inside C-drive but not every system and laptop comes with high storage in C-drive , like mine, I have a 512 SSD inside my laptop but the C-drive contains less space in compare to D-drive so in order to save space inside C-drive, I moved my kali linux installation out of primary drive which is C and start using Kali Linux from secondary drive in my case it is D-drive.

Steps to Move Kali Linux from C to another drive:

  • First install the Kali Linux using windows store. If you don’t know how then you can follow my other tutorial on installing Kali Linux inside windows without dual boot.

https://medium.com/@Hackash/install-kali-linux-in-windows-wsl-without-dual-boot-c572cca01b14

  • Now, open windows Run ‘ Win + r ‘ or search for ‘ regedit’ and open Registry Editor.
  • Navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
Registry Editor to find Kali Linux installation ext4 file

Click on Lxss as shown in below image and click on BasePath right click and select modify, then copy the path. This is the path where Kali Linux file is located, copy it and visit the file location.

  • You will find an ext4 named Hard disk image file file.
  • Copy it and move it to anywhere else, in my case I moved it to d-drive and placed it inside a newly created folder ‘Kali-WSL’.
  • You can do something similar and then don’t forget to update the BasePath value by right clicking on it and select modify and edit the BasePath to new location of ‘ext4’ hard disk image file.
  • Now try to open the Kali Linux wsl and if you have followed all steps correctly then there won’t be any problem running it.
  • Note: you can also periodically copy the ext4 image as a backup of Kali Linux.
  • Enjoy !!

--

--

Dr. Gupta
Dr. Gupta

Written by Dr. Gupta

ll Insomniac Doctor loves Terminal || #Security_Researcher #DayTrader || Learn and Earn || #Web3_Doctor || Rookie Smart Contract Dev & Security Researcher ||

No responses yet