[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Install/uninstall Bash on Windows from command line

My name is Ito and I am an infrastructure engineer.

Are you using Bash on Windows?

I previously wrote about how to install it on this blog.
How to use Bash after Windows 10 Anniversary Update | Beyond Inc.

After it was released, I was playing around with it wondering what it could do, and
help but wonder what kind of situation it was in.
I didn't have a particularly important file in there, so
I thought I'd create it again.

Is it possible to do it from the command line? I was able to do it.

lxrun command

You can install or uninstall Bash on Windows using the lxrun command from a command prompt (administrator privileges).

*To install, you must first install Windows Subsystem for Linux from the control panel.
How to use Bash after Windows 10 Anniversary Update | Beyond Co., Ltd.
This is because the lxrun command itself is stored in this Windows Subsystem for Linux.

Let's take a look.

λ lxrun /? Performs management operations on the LX subsystem Usage: /install - Installs the subsystem Optional arguments: /y - Does not prompt user for permission /uninstall - Uninstalls the subsystem Optional arguments: /full - performs a complete uninstall /y - does not ask for user permission /setdefaultuser - configures the subsystem user to start bash with. If the user does not exist, it will be created. Optional arguments: username - Specifies the username /y - If a username is specified, do not prompt for a password /update - Update the subsystem's package index

The command is super simple.
I'll try deleting it then.

λ lxrun /uninstall /full This will uninstall Ubuntu on Windows. Your Ubuntu environment and all changes, new applications, and user data will be removed. Enter "y" to continue: y Uninstalling... λ bash -- Beta feature -- This installs Ubuntu on Windows. Ubuntu is a product distributed by Canonical and licensed under the terms found at: https://aka.ms/uowterms Please enter "y" to continue:

It seems that it was successfully uninstalled.
(If it is installed, Bash on Windows will start with the bash command)

Installation can be done with the current "bash" command, or with "lxrun /install".

λ lxrun /install -- Beta feature -- This installs Ubuntu on Windows. Ubuntu is a product distributed by Canonical and licensed under the terms found at: https://aka.ms/uowterms Enter "y" to continue: y Downloading from Windows Store... Extracting 100% file system. This process will take a few minutes... Create a default UNIX user account. The username does not have to match your Windows username. More information: https://aka.ms/wslusers Please enter a new UNIX username: unixuser Please enter a new UNIX password: Re-enter the new UNIX password: passwd: password updated successfully Installation completed successfully λ bash unixuser@BYD-PC-15:/mnt/c/Users/itou$

Yes, it's easy!

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
1,323
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author