最近有个大活,要频繁在WIN和LINUX之间作实验和切换。那,还不如在WIN下安装个LINUX,使用WLS,那效率就快很多了。
参考URL:
https://docs.rockylinux.org/guides/interoperability/import_rocky_to_wsl/
https://cloud.tencent.com/developer/article/2487510
一,WSL介绍
Windows Subsystem for Linux(简称WSL)是一个在Windows 10\11上能够运行原生Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,开发人员可以在 Windows 计算机上同时访问 Windows 和 Linux 的强大功能。 通过适用于 Linux 的 Windows 子系统 (WSL),开发人员可以安装 Linux 发行版(例如 Ubuntu、OpenSUSE、Kali、Debian、Arch Linux 等),并直接在 Windows 上使用 Linux 应用程序、实用程序和 Bash 命令行工具,不用进行任何修改,也无需承担传统虚拟机或双启动设置的费用。
二,WSL下的LINUX镜像下载安装
wsl --set-default-version 2
Rocky Linux
Installable WSL images (preferred)¶
-
Download the WSL image from the CDN or another mirror closer to you:
-
There are multiple options for installing a
.wslimage:- Double-click the image and it will be installed with the images default name
- Install the image via command line:
wsl --install --from-file <path-to/Rocky-10-WSL-Base.latest.x86_64.wsl> --name <machine-name>
ubuntu
选择Linux版本,下载
https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions
(2025年1月最新版本为24.04)
*4.在任意位置安装 .AppxBundle安装包改名为zip文件,解压,找到文件名包含x64的.appx文件,再次改名为.zip文件, 解压到D盘比较好找的目录,如D:\Ubuntu 点击ubuntu.exe安装
三,开机后,如何进入LINUX
直接在开始菜单搜索进入

通过CMD进入
wsl --list
wsl -d Rocky-10

可以通示sudo -i这样的命令进入管理员模式。
也可以通过其它ssh工具进入,空了再研究,但我觉得没有直接进入方便。