windows10上运行Linux Bash Shell

前言

对于熟悉Linux运维的工程师,如果能在Windows上运行Bash shell的话,会比用可恶的dos命令舒服得多。Windows确实提供了这样的功能。

1.打开开发者模式

"设置"->"更新和安全"->"开发者选项"->"开发人员模式"

2.安装"适用于Linux的Windows子系统"


按提示重启电脑

3.安装

运行-cmd-输入bash

提示访问https://aka.ms/wslstore 下载安装Linux分发版。

访问网页,提示打开Microsoft Store

选择你喜欢的发行版。一般来说选择Ubuntu

点击开始下载

下载完毕后,点击启动开始安装并启动

设置Linux用户和密码

4.开始你的bash之旅

重新打开cmd框,输入bash。

5.troubleshoot

在windows应用商店安装ubuntu系统,报错WslRegisterDistribution failed with error: 0x8007019e

  1. 报错:
Installing, this may take a few minutes...
Installation Failed!
Error: 0x8007019e
Press any key to continue...
  1. 原因:

未安装Windows子系统支持。

  1. 解决办法:
    1.win+x,选择Windows PowerShell(管理员)
    2.输入:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
3. 回车,输入Y,重启!
4. 重新打开已经安装的子系统,等几分钟,输入账户和密码。

参考
https://blog.csdn.net/qq_33033367/article/details/828209

posted on 2019-03-18 12:11  fanderchan  阅读(21450)  评论(1编辑  收藏  举报

导航