适用于Linux的Windows子系统(WSL)安装

Enable the Windows Subsystem for Linux

Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Enable Virtual Machine feature

Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your machine to complete the WSL install and update to WSL 2.

Download the Linux kernel update package

  1. Download the latest package:
    WSL2 Linux kernel update package for x64 machines
  2. 下载完成之后双击安装即可。

Set WSL 2 as your default version

Open PowerShell and run this command to set WSL 2 as the default version when installing a new Linux distribution:

wsl --set-default-version 2

Install your Linux distribution of choice

这里有两种选择:

  1. 在Microsoft Store里直接搜索“Ubuntu”,安装自己想要的版本,这种方式会自动安装到C盘下。
  2. 如果不习惯将其安装到C盘下,可以按如下方式将其安装到指定的磁盘。这里以Ubuntu1804为例:
    • 下载Ubuntu1804的wsl发行版本:
      Ubuntu_1804
    • 将下载的文件拷贝到想要安装wsl的目录下
    • ***.appx后缀改为***.zip,并解压。
    • 双击Ubuntu1804.exe即开始安装。

Shut Down and Restart Your WSL

# run the following command in cmd with Administrator rights
# shut down
net stop LxssManager
# start system
net start LxssManager

以上内容参考官方教程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值