Logo

dev-resources.site

for different kinds of informations.

Install Debian in Different Location -WSL Windows

Published at
5/14/2024
Categories
windows
linux
debian
wsl
Author
krschap
Categories
4 categories in total
windows
open
linux
open
debian
open
wsl
open
Author
7 person written this
krschap
open
Install Debian in Different Location -WSL Windows

I was trying to install Debian in different location rather than the C drive . Sharing the steps I took .

OS : Windows 11
WSL Version : Wsl 2

1) First install Debian as by default in C

wsl --install -d Debian
Enter fullscreen mode Exit fullscreen mode

2) Shut down wsl

wsl --shutdown
Enter fullscreen mode Exit fullscreen mode

3) Export Debian to your desired location

In my case its E :

 wsl --export Debian E:\wsl_export\debian-ex.tar
Enter fullscreen mode Exit fullscreen mode

4) Now unregister your old Debian from wsl

wsl --unregister Debian
Enter fullscreen mode Exit fullscreen mode

5) Now import Debian to the Disk

wsl --import Debian "E:\wsl\Debian" "E:\wsl_export\debian-ex.tar"
Enter fullscreen mode Exit fullscreen mode

6) Cleanup
You can remove your backup now and set Debian as default

wsl --set-default Debian
Enter fullscreen mode Exit fullscreen mode

Extra tips

  • To make your user in debian superuser : After migrating you might loose your default login using username you created before .

Login to Debian , By default you will be logged in as root and hit following

sudo usermod -aG sudo username
Enter fullscreen mode Exit fullscreen mode
  • Change default user
nano /etc/wsl.conf
Enter fullscreen mode Exit fullscreen mode

Replace username with your username

[user]
default=username
Enter fullscreen mode Exit fullscreen mode

Now wsl --shutdown and login debian again you should be logged in as your default user with sudo access

wsl Article's
30 articles in total
Favicon
Update WSL Ubuntu password
Favicon
Building OpenCV 4.10.0 with GUI Support in WSL
Favicon
Video: Install Ubuntu using WSL 2
Favicon
Install Zellij on WSL
Favicon
Work from anywhere with VSCode Remote Tunnels
Favicon
SSL verification error at depth 2 - Zscaler | WSL
Favicon
Accelerate 1-bit LLM Inference with BitNet on WSL2 (Ubuntu)
Favicon
Just start using WSL
Favicon
Change WSL/Docker files to another disk
Favicon
Setup your laravel 11 in windows
Favicon
Install Ubuntu on WSL 2
Favicon
How to Install WSL from PowerShell on Windows 10 and 11
Favicon
WSL in AWS Windows Server 2022 Core instance
Favicon
Docker Installation Log for WSL 2 on Windows
Favicon
Enable WSL shell in GitHub Desktop
Favicon
Installing Ruby using rbenv on your WSL Ubuntu system
Favicon
How to Install Redis on Windows Using WSL2
Favicon
PowerShell Development in Neovim
Favicon
WSL: Gerenciando o disco da distro
Favicon
Docker
Favicon
Share Postgresql from Windows to WSL Linux
Favicon
Add Manjaro into WSL 2
Favicon
Using WSL2 as primary driver for 3 months with Fedora
Favicon
Wsl installation error
Favicon
Install Debian in Different Location -WSL Windows
Favicon
Monitor GPU Usage in WSL debian
Favicon
Dicas e configurações para seu sistema linux
Favicon
Instalando de maneira rápida e eficiente suas ferramentas no WSL. Pt-3
Favicon
Arch install azure cli
Favicon
Melhorando e configurando seu novo Shell linux. Pt-2

Featured ones: