Skip to main content

How to uninstall & reinstall Windows Subsystem for Linux

·185 words·1 min
tech linux technology ubuntu windows windows-10 wsl
James Pettigrove
Author
James Pettigrove
Cloud Engineer with a focus on Microsoft Azure

Now that the Windows Subsystem for Linux (WSL) has been released to the masses in Windows 10 Anniversary Update and you have have installed the feature and had a play, What happens if you want to start from scratch and reset everything to a fresh state? This is something we often do in IT, especially when troubleshooting an issue. Instead of going into Programs & Features in Control Panel there is a very quick command you can run to perform the reset.

lxrun /uninstall

This will uninstall the WSL environment from your workstation. Combine it with:

lxrun /install

to reinstall the WSL environment and you are all reset.

You can also set root as the default user for WSL at the install phase with the following switch:

lxrun /install /y

Alternatively, you can define your own user at install with:

lxrun /install /setdefaultuser <username> /y

Note: if you omit the /y switch when defining your own username then you will be prompted to set a password for said user.

Super simple stuff! Go forth and get knee deep in the world of Linux, Windows Administrators

Related

BASH has arrived for all in Windows 10
·367 words·2 mins
tech bash linux technology ubuntu windows windows-10 wsl
No no, the latest update to Windows 10 will not make you want to bash your head against a brick wall; Update 1607, otherwise known as Anniversary Update 1 (code name Redstone 1) brings a very surprising feature to the Windows landscape; Linux on Windows.
Configure Public Key Authentication for SSH on Linux
·589 words·3 mins
system-administration tech linux pka public-key-authentication putty ssh sysadmin technology ubuntu windows
Very recently, I acquired myself a cheap Linux based VPS for personal use.
RSAT and MDOP for Windows 10 released
·84 words·1 min
system-administration tech mdop mdop-2015 rsat sysadmin technology windows windows-10
Sysadmin’s start your engines (err… servers?