Featured image of post Docker 推荐后端 WSL2 完全离线安装

Docker 推荐后端 WSL2 完全离线安装

Offline deploy Windows Subsystem for Linux 2 for docker engine.

这里介绍的适用于Linux的Windows子系统的离线安装使用方法,适用于 Windows 10 2004 及以上版本,含 LTSC 2021。 安装完成后可以直接作为Docker引擎的后端。

  1. GitHub 发行页面下载 WSL 的 MSI 套件
  2. DistributionInfo.json 中找到下载发行版的 .wsl 文件URL并下载所选发行版
  3. 在控制面板 -> 程序和功能 -> 启用或关闭Windows功能
    • 启用 虚拟机平台VirtualMachinePlatform
    • 启用 适用于Linux的Windows子系统
  4. 双击运行MSI包安装WSL
    • 开始菜单会多出WSL的图标,可进入GUI进行一些设置。
    • 打开 cmd 或 powershell 可以执行命令查看帮助 wsl --help
  5. 安装发行版
    • 用管理员权限运行 wsl --install --from-file <location of wsl File>
    • wsl --install --from-file C:\Users\John\Downloads\ubuntu-24.04.4-wsl-amd64.wsl
    • 会提示创建Linux发行版的用户名并设置密码
    • 不同发行版不共享账号和存储
  6. 启动WSL的发行版 wsl -d <DistroName>
  7. 关闭WSL的发行版 wsl -t <DistroName>
  8. 关闭所有在运行的发行版 wsl --shudown
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy