Windows 10启用Linux子系统
2019-03-24 本文已影响5人
landaliming
win10 内置 Linux 子系统,这对我们开发人员来说真的是太方便了。
1. 打开的开发者选项

2. 启动 Linux 子系统服务

3. 应用商店安装 Linux

4. 进入 Linux 子系统
进入Linux子系统的方式比较多,这里介绍两种最常用的:
- 开始菜单点图标启动
- 命令行输入 bash 启动
进入系统按照提示设置用户名和密码就可以了,至此基本可使用版本已经安装完成了。
5. 子系统和 win 文件交互互通
子系统本来就是和win互通的,常用的两种方式:
- 通过"/mnt/【盘符】/目录"的方式访问Windows目录
- 通过tcp协议进行通讯(简单点说就是用网络,端口都是通的,共用win的ip地址)
6. 更换国内源
# 1.备份原来的数据源配置文件
cp /etc/apt/sources.list /etc/apt/sources.list_backup
# 2.编辑数据源配置文件
vim /etc/apt/sources.list
# 在这里我使用的是阿里云的数据源:
#==============================================================================================
# deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
#===============================================================================================
# 3.更新配置
apt-get update
7. 其他:
对于使用过Linux的人来说,完成上面的步骤基本就完成了,有啥需求自己安装即可,和在Linux操作没啥区别。不过如果是新手,还想安装图形界面,或者觉得win的shell不好用,想自己换的可以参考下面的帖子:
https://www.cnblogs.com/huaxingtianxia/p/7999552.html