V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nite
V2EX  ›  分享发现

Windows10 安装 WSA

  •  
  •   nite · 2023-01-31 02:07:19 +08:00 · 2007 次点击
    这是一个创建于 451 天前的主题,其中的信息可能已经有所发展或是发生改变。

    WSA 已经在 Windows11 上线很久了,但是微软一直不给 Windows10 用,不过现在可以通过一些特殊方法安装。


    步骤

    1. 将你的系统更新到 Windows 10 22H2 10.0.19045.2311 或更高版本.
      • 你可以通过 winver 命令查看您当前的 Windows 版本.
      • 如果您的 Windows 版本低于 10.0.19045.2311, 请将您的系统更新到 10.0.19045.2311 或以上.
    2. 安装 WSL2
      • 在开始中搜索 启用或关闭 Windows 功能
      • Hyper-V适用于 Linux 的 Windows 子系统虚拟机平台 前面的选择框打勾后确定
      • 重启系统
      • 打开 Microsoft Store,搜索 Ubuntu 并安装(其他的 Linux 发行版也可以,本文使用 Ubuntu )
      • 运行 Ubuntu 等待系统启动并设置用户密码,密码会在下一步用到
    3. 获取 WSA AppX 包(在 Linux 中执行)
      • 执行 apt install git
      • 执行 cd /
      • 执行 git clone https://ghproxy.com/https://github.com/LSPosed/MagiskOnWSALocal.git
      • 执行 sudo bash /MagiskOnWSALocal/scripts/install_deps.sh(过程中会提示输入密码)
      • [可选] [推荐] 设置代理,加速下载
        • 以下操作在 Windows 执行
        • 按下 Win + R,输入 cmd 回车
        • 执行 ipconfig,找到 以太网适配器 vEthernet (WSL): 后面的 IPv4 地址
        • 编辑 \\wsl.localhost\Ubuntu\MagiskOnWSALocal\scripts\build.sh
        • 搜索 aria2c
        • aria2c 后面添加 --all-proxy="<IPv4 地址>:<Windows 代理端口号>"(注意和aria2c之间有空格)
      • 执行 sudo bash /MagiskOnWSALocal/scripts/run.sh(过程中会提示输入密码)
      • 新界面中使用 键更改选项,空格键选中,回车键确认
      • Build arch 选择 x64 还是 arm64 需要根据设备来,你可以通过以下方式确定
        • 以下操作在 Windows 执行
        • 按下 Win + R,输入 cmd 回车
        • 执行 echo %PROCESSOR_ARCHITECTURE%
        • 如果显示 x86AMD64 则选择 x64
        • 如果显示 ARM64 则选择 arm64
      • WSA release type 建议选择 insider fast
      • Magisk version 建议选择 stable
      • 其他选项根据需求选择
    4. 在 Windows 中打开路径 \\wsl.localhost\Ubuntu\MagiskOnWSALocal\output,将文件夹中的压缩包解压到合适的路径(安装路径)
    5. 下载 Patch 文件并解压,将 icu.dllWsaPatch.dll 复制到 <第 4 步解压的文件夹>\WsaClient
    6. 编辑 <第 4 步解压的文件夹>\AppxManifest.xml
      • AppxManifest.xml 找到 TargetDeviceFamily 节点

        <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.22000.120" MaxVersionTested="10.0.22000.120"/>
        

        把 MinVersion 从 10.0.22000.120 改成 10.0.19045.2311

      • AppxManifest.xml 删除 customInstall 相关节点,一共有两个

        <rescap:Capability Name="customInstallActions"/>
        
        <desktop6:Extension Category="windows.customInstall">
            <desktop6:CustomInstall Folder="CustomInstall" desktop8:RunAsUser="true">
                <desktop6:RepairActions>
                    <desktop6:RepairAction File="WsaSetup.exe" Name="Repair" Arguments="repair"/>
                </desktop6:RepairActions>
                <desktop6:UninstallActions>
                    <desktop6:UninstallAction File="WsaSetup.exe" Name="Uninstall" Arguments="uninstall"/>
                </desktop6:UninstallActions>
            </desktop6:CustomInstall>
        </desktop6:Extension>
        
    7. 运行 <第 4 步解压的文件夹>\Run.bat

    参考文章

    适用于 Windows 10 的 WSA 补丁
    Magisk on WSA (with Google Apps)

    6 条回复    2023-02-06 19:51:27 +08:00
    icoming
        1
    icoming  
       2023-02-01 22:57:08 +08:00
    不懂,但是要支持下的
    wdssmq
        2
    wdssmq  
       2023-02-04 10:49:03 +08:00
    姑且脱水下命令行:

    git clone https://ghproxy.com/https://github.com/LSPosed/MagiskOnWSALocal.git ~/tmp/wsa
    cd ~/tmp/wsa/scripts/
    sudo ./install_deps.sh
    sudo ./run.sh

    然后我这里打包时报错了 - -

    Traceback (most recent call last):
    File "generateWSALinks.py", line 28, in <module>
    from typing import OrderedDict
    ImportError: cannot import name 'OrderedDict'
    nite
        3
    nite  
    OP
       2023-02-06 15:35:51 +08:00
    @wdssmq 更新一下 python
    wdssmq
        4
    wdssmq  
       2023-02-06 16:51:36 +08:00
    @nite 可能笔记本上 ubuntu 版本比较旧的原因?换苏菲可以了,,然后来就是想在苏菲上看漫画用的。。

    所以 apk 安装器有推荐么?
    wdssmq
        5
    wdssmq  
       2023-02-06 17:14:00 +08:00
    已经成功安装 哔哩哔哩漫画 并启动,不知道会有什么坑。。
    nite
        6
    nite  
    OP
       2023-02-06 19:51:27 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2843 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:03 · PVG 23:03 · LAX 08:03 · JFK 11:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.