首页 > 其他 > 详细

小试wsl

时间:2018-09-27 01:02:53      阅读:216      评论:0      收藏:0      [点我收藏+]

安装

管理员权限运行powershell,执行如下命令:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

或者:控制面板->程序和功能->启用或关闭Windows功能->勾选 适用于Linux的Windows子系统

然后重启电脑,打开应用商城搜索“WSL”,就可以安装Linux子系统了

管理wsl

设置默认运行的linux系统

wslconfig /setdefault <DistributionName>

卸载linux系统

wslconfig /unregister <DistributionName>

查看已安装的linux系统

wslconfig /list

设置默认登陆用户

以ubuntu为例:

ubuntu config --default-user root

配置ssh

重新安装 openssh-server,编辑配置文件 /etc/ssh/sshd_config

Port 2333
UsePrivilegeSeparation no

如果设置登录用户为root,加上:

PermitRootLogin yes
AllowUsers root

重启ssh服务

sudo service ssh --full-restart

本地wsl目录

C:\Users\XXXX\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

小试wsl

原文:https://www.cnblogs.com/antisamael/p/9710621.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!