Skip to main content

Linux Bash Shell on Windows 10

Let's enable Ubuntu on Bash on Windows 10 Anniversary Update and later.

Windows 10: Enable 'Windows Subsystems for Linux' feature
Windows 10: Enable 'Windows Subsystems for Linux' feature



What happens if Developer mode is not enabled





Turn on developer mode





Run C:\Windows\Systems32\bash.exe


Check Ubuntu version

lsb_release -a


Update Ubuntu

sudo apt-get update



Ubuntu upgrade

sudo apt-get upgrade




Check Ubuntu version after upgrading



Notes from the fields

Ubuntu package's location in user's profile

By default, it is in:

%userprofile%\AppData\Local\Packages

In powershell, run this command to find out: Get-AppxPackage *Ubuntu*

PS C:\WINDOWS\system32> Get-AppxPackage *Ubuntu*
Name              : CanonicalGroupLimited.Ubuntu18.04onWindows
Publisher         : CN=23596F84-C3EA-4CD8-A7DF-550DCE37BCD0
Architecture      : X64
ResourceId        :                                                                                            
Version           : 2020.1804.7.0
PackageFullName   : CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc
InstallLocation   : C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc                                                                             IsFramework       : False
PackageFamilyName : CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc
PublisherId       : 79rhkp1fndgsc
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok                                                                                                                                                                                                                                                                                                                                                                                                                                      PS C:\WINDOWS\system32> 

Move Ubuntu package to another drive

Refer to this question on superuser.com: https://superuser.com/questions/1443995/how-to-move-ubuntu-on-windows-to-drive-d-or-other-drive

C:\Users\Tuyen>wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)

C:\Users\Tuyen>mkdir E:\wsl

C:\Users\Tuyen>wsl --export ubuntu-18.04 E:\wsl\ubuntu-18.04.tar.gz

C:\Users\Tuyen>dir E:\wsl\ubuntu-18.04.tar.gz
 Volume in drive E has no label.
 Volume Serial Number is 0285-3B90

 Directory of E:\wsl

03/27/2020  12:07 PM     9,084,385,280 ubuntu-18.04.tar.gz
               1 File(s)  9,084,385,280 bytes
               0 Dir(s)  158,935,080,960 bytes free

C:\Users\Tuyen>

Remove/Uninstall Ubuntu package

PS C:\WINDOWS\system32> Remove-AppxPackage -Package (Get-AppxPackage *Ubuntu*).PackageFullname
PS C:\WINDOWS\system32> (Get-AppxPackage *Ubuntu*).Name                                                        PS C:\WINDOWS\system32>              

Import Ubuntu package

C:\Users\Tuyen>wsl --import ubuntu-18.04 E:\wsl E:\wsl\ubuntu-18.04.tar.gz

C:\Users\Tuyen>wsl -l
Windows Subsystem for Linux Distributions:
ubuntu-18.04 (Default)

C:\Users\Tuyen>

Popular posts from this blog

Install Microsoft .NET Core SDK

.NET Core Software Development Kit (SDK) is a set of libraries and tools that allow developers to create .NET Core applications and libraries.

How to charge your device from USB Port

First of all, check BIOS Settings of your laptop or desktop Dell Look for USB PowerShare BIOS Settings: USB PowerShare Lenovo Look for Always On USB Charge in Off Mode BIOS Settings: Enable Always On USB Charge in Off Mode

Kali Linux on Raspberry Pi 2

Download Kali Linux for Raspberry Pi 2 Use xzcat to decompress and then dd to image Kali Linux to microSD on Windows 10. or use 7-zip to extract kali-linux-2019.1-rpi3-nexmon.img image file, then use rufus to write image to microSD card Login Kali Linux with default username root and password toor Tight VNC Server root@kali:~# apt install tightvncserver root@kali:~# vncserver :1 You will require a password to access your desktops. Password: Warning: password truncated to the length of 8. Verify: Would you like to enter a view-only password (y/n)? n xauth: file /root/.Xauthority does not exist New 'X' desktop is kali:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/kali:1.log root@kali:~# Kill vncserver root@kali:~# vncserver -kill :1 Killing Xtightvnc process ID 16102 root@kali:~#