[TOC]

0x01 常规配置

(1) 启用Win10家庭版的远程桌面服务端

描述: Win10 家庭版并不提供远程桌面服务, 只能采用第三方软件(rdpwrap)实现远程桌面,此项目的目标是启用远程桌面主机支持和并发 RDP 会话,以简化家庭使用的功能系统。
项目地址: https://github.com/stascorp/rdpwrap
注意事项: 建议使用 RDP 包装器安装 .dll 版本文件。如果您以前用其他修补程序修改过它,它随时可能会变得不稳定和崩溃。

安装流程:

  • Step 1.下载 rdpwrap 的 Release v1.6.2 版本 : https://github.com/stascorp/rdpwrap/releases/download/v1.6.2/RDPWrap-v1.6.2.zip

  • Step 2.解压 RDPWrap-v1.6.2.zips点击install.bat以管理员运行安装 rdpwrap 软件;

    1
    2
    3
    4
    5
    6
    7
    8
    9
    # 目录: D:\InstallTools\RDPWrap-v1.6.2
    Mode LastWriteTime Length Name
    ---- ------------- ------ ----
    -a---- 2021/1/21 13:11 458 install.bat
    -a---- 2021/1/21 13:11 1045504 RDPCheck.exe
    -a---- 2021/1/21 13:11 1096192 RDPConf.exe
    -a---- 2021/1/21 13:11 1460224 RDPWInst.exe
    -a---- 2021/1/21 13:11 249 uninstall.bat
    -a---- 2021/1/21 13:11 249 update.bat
  • Step 3.查看当前计算机 c:\Windows\System32\termsrv.dll 版本

WeiyiGeek.10.0.19041.84

WeiyiGeek.10.0.19041.84

  • Step 4.然后在github中找到匹配当前版本,并修改 C:\Program Files\RDP Wrapper\rdpwrap.ini 配置文文件 -> 在文件末尾追加如下内容;
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    [10.0.19041.84-SLInit]
    bInitialized.x86 =CF920
    bServerSku.x86 =CF924
    lMaxUserSessions.x86 =CF928
    bAppServerAllowed.x86 =CF930
    bRemoteConnAllowed.x86=CF938
    bMultimonAllowed.x86 =CF93C
    ulMaxDebugSessions.x86=CF940
    bFUSEnabled.x86 =CF944
    bInitialized.x64 =103FF8
    bServerSku.x64 =103FFC
    lMaxUserSessions.x64 =104000
    bAppServerAllowed.x64 =104008
    bRemoteConnAllowed.x64=104010
    bMultimonAllowed.x64 =104014
    ulMaxDebugSessions.x64=104018
    bFUSEnabled.x64 =10401C

    [10.0.19041.84]
    LocalOnlyPatch.x86 =1
    LocalOnlyOffset.x86 =B46B9
    LocalOnlyCode.x86 =jmpshort
    LocalOnlyPatch.x64 =1
    LocalOnlyOffset.x64 =87611
    LocalOnlyCode.x64 =jmpshort
    SingleUserPatch.x86 =1
    SingleUserOffset.x86 =3AD27
    SingleUserCode.x86 =Zero
    SingleUserPatch.x64 =1
    SingleUserOffset.x64 =0BF0C
    SingleUserCode.x64 =Zero
    DefPolicyPatch.x86 =1
    DefPolicyOffset.x86 =3D7D9
    DefPolicyCode.x86 =CDefPolicy_Query_eax_ecx
    DefPolicyPatch.x64 =1
    DefPolicyOffset.x64 =17ED5
    DefPolicyCode.x64 =CDefPolicy_Query_eax_rcx
    SLInitHook.x86 =1
    SLInitOffset.x86 =66658
    SLInitFunc.x86 =New_CSLQuery_Initialize
    SLInitHook.x64 =1
    SLInitOffset.x64 =1BDFC
    SLInitFunc.x64 =New_CSLQuery_Initialize

参考地址: https://github.com/stascorp/rdpwrap/issues/1087
更新参考: https://github.com/affinityv/INI-RDPWRAP/blob/master/rdpwrap.ini

  • Step 5.修改完成后执行 RDPWInst.exe -r 进行重载配置;

  • Step 6.最好点击RDPConf.exe验证安装配置情况(如出现下图所示表示成功否则请找异常),最后运行RDPCheck.exe进行验证;

WeiyiGeek.

WeiyiGeek.


错误解决:

  • (1) 如果出现 not listening [not supported] ,说明还不支持当前的 windows 版本, 是否支持此 windows 版本在 C:\Program Files\RDP Wrapper\rdpwrap.ini 中确定。
    解决办法: 如不存在则需要在去 github issue 里面找别人发的新的 rdpwrap.ini,替换或者修改 rdpwrap.ini 配置文件;
    例如: https://github.com/stascorp/rdpwrap/issues?q=Not+working+on+10.0.19041.980
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ Get-ItemProperty C:\Windows\System32\termsrv.dll | Format-Table -Property VersionInfo  -Wrap
VersionInfo
-----------
File: C:\Windows\System32\termsrv.dll
InternalName: termsrv.dll
OriginalFilename: termsrv.dll.mui
FileVersion: 10.0.19041.980 (WinBuild.160101.0800)
FileDescription: 远程桌面会话主机服务器远程连接管理器
Product: Microsoft® Windows® Operating System
ProductVersion: 10.0.19041.980
Debug: False
Patched: False
PreRelease: False
PrivateBuild: False
SpecialBuild: False
Language: 中文(简体,中国)

或者是使用老版本的 termsrv.dll 进行替换新版本的dll即可:

1
2
3
Get-Service TermService | Stop-Service
Copy-Item -Force D:\DownloadTools\RDPWrap-v1.6.2\termsrv.dll C:\Windows\System32\termsrv.dll
Start-Service TermService


  • (2) 如修改 rdpwrap.ini 或者替换 c:\Windows\System32\termsrv.dll 没有权限没有权限请运行以下reg文件或者命令

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # 注册表方式修改
    ; private.reg
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="获取TrustedInstaller权限"

    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="获取TrustedInstaller权限"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"


    # 命令直接执行
    cmd.exe /c takeown /f c:\Windows\System32\termsrv.dll && icacls c:\Windows\System32\termsrv.dll /grant administrators:F
  • (2) 10.0.19041.789 not working
    环境说明:

    1
    2
    3
    4
    5
    W10 (20H2) 19042,804
    Wrapper (rdpwrap.dll) 1.5.0.0
    Service (termsrv.dll) 10.0.19041.789

    100% working rdpwrap.ini:

    解决办法: https://github.com/stascorp/rdpwrap/issues/1317
    下载指定rdpwrap.ini文件 进行 rdpwrap.zip 覆盖,注意需要先停止RDP服务覆盖完成后启动即可;
    验证查看:

    1
    sc query TermService

    其它方式: https://www.mysysadmintips.com/windows/clients/545-multiple-rdp-remote-desktop-sessions-in-windows-10


(2) 在Win10中安装Microsoft Store

描述:

1
2
3
4
5
6
7
8
9
// 1.查看并移除旧版本的store相关的Appxpackage
PS C:\Windows\system32> Get-Appxpackage *store* | remove-Appxpackage

// 2.查看 Store 的 Appxpackage
PS C:\Windows\system32> Get-AppxPackage -allusers | Select Name, PackageFullName | select-string "WindowsStore"
@{Name=Microsoft.WindowsStore; PackageFullName=Microsoft.WindowsStore_12104.1001.1.0_x64__8wekyb3d8bbwe}

// 3.添加并注册 Appx 包
PS C:\Windows\system32> Add-appxpackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsStore_12104.1001.1.0_x64__8wekyb3d8bbwe\appxmanifest.xml" -disabledevelopmentmode

(3) 安装 msixbundle 后缀类型的软件

安装方式:

1
Add-appxpackage .\Microsoft.WindowsTerminal_1.11.2921.0_8wekyb3d8bbwe.msixbundle