Windows SubSystem for Linux

Windows SubSystem for Linux

Install Ubuntu

Run PowerShell as administrator and input:

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

Install Ubuntu 18.04 LTS from Microsoft Store

Setup SSH

Remove inherent openssh-server and Installing a new openssh-server, because there are some problem with the former one.

sudo apt-get remove openssh-server
sudo apt-get install openssh-server

Edit the ssh server configuration file.

sudo vim /etc/ssh/sshd_config

Change to

PasswordAuthentication yes # no -> yes

Restart ssh service

sudo service ssh --full-restart

Change the source

back up the inherent source file

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

create a new source file

sudo vim /etc/apt/sources.list

Paste these in it for Ubuntu 18.04 LTS.

For others, see https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

Shared File System with Windows

Yes, it is! The Ubuntu sub system can share files with windows!

For example

$ ls /mnt/
c d  # as you can see, the c and d is the C and D disk partition in the windows

How to share files with Ubuntu by windows?

C:\Users\用户名\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

That is the root path of the Ubuntu.

Reference

[1] Windows 10 Installation Guide. https://docs.microsoft.com/zh-cn/windows/wsl/install-win10

[2] Win10 配置 Linux Ubuntu 子系统:使用教程及技巧. https://www.jianshu.com/p/5cf6849aa28f

[3] Ubuntu 镜像使用帮助. 清华大学开源软件镜像站. https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

[4] windows10 Linux子系统文件目录. https://blog.csdn.net/x356982611/article/details/80077085

posted @   健康平安快乐  阅读(679)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示