WSL
WSL copied to clipboard
WSLg generates a large number of RdClientAutoTrace files
Windows Version
10.0.x
WSL Version
0.58.3.0 - now
Are you using WSL 1 or WSL 2?
- [X] WSL 2
Repro Steps
The details can be found at the discussion https://github.com/microsoft/WSL/discussions/8486
we think this should be an issue.
Expected Behavior
do nothing
Actual Behavior
wsl generates a lot of RdClientAutoTrace files that take up so much disk space.
Some potentially relevant elements:
https://github.com/microsoft/WSL/issues/8544#issuecomment-1197586956 https://github.com/microsoft/WSL/issues/9752#issuecomment-1478381675
It's devastating my poor 512GB SSD is full just three days after I removed the files. Is there any temporary solution for this?
It's devastating my poor 512GB SSD is full just three days after I removed the files. Is there any temporary solution for this?
my current solution is to have a scheduled task that deletes those files periodically. I am doing it for wsl as well as for some outlook trace files that also have the same behaviour. Script here: https://github.com/0x6f677548/shell-utils/blob/main/file/Delete-OldFiles.ps1
Temporary solution, turn off support for GUI applications in WSL:
User can also choose to turn off the system distro entirely by adding the following entry in their .wslconfig file (located at c:\users\MyUser\.wslconfig). This will turn off support for GUI applications in WSL.
[wsl2]
guiApplications=false
https://github.com/microsoft/wslg#wslg-system-distro https://github.com/microsoft/WSL/discussions/8486#discussioncomment-5560022
Temporary solution, turn off support for GUI applications in WSL:
User can also choose to turn off the system distro entirely by adding the following entry in their .wslconfig file (located at c:\users\MyUser.wslconfig). This will turn off support for GUI applications in WSL.
[wsl2] guiApplications=falsehttps://github.com/microsoft/wslg#wslg-system-distro #8486 (comment)
I've added this to my .wslconfig but it didn't help
Same issue here, seems like compiled version of RD Client has a bug:
MSRDC_WILFailure : "D:\a\_work\1\s\RdClient\RdClient.SessionHost\exe\msrdc\MSRDCRecoveryManager.cpp", 175, "", "msrdc.exe", 14448, 1, 0, 0x80070002, true
MSRDC_WILFailure : "D:\a\_work\1\s\RdClient\RdClient.SessionHost\exe\msrdc\MSRDCRecoveryManager.cpp", 42, "", "msrdc.exe", 14448, 1, 0, 0x80070002, true
MSRDC_WILFailure : "D:\a\_work\1\s\RdClient\RdClient.SessionHost\exe\msrdc\MSRDCRecoveryManager.cpp", 31, "", "msrdc.exe", 14448, 1, 0, 0x80070002, true
Update: Upon looking into the trace log I found that "EnableMSRDCTelemetry" is missing within registry. I may have fixed the issue by installing Microsoft Remote Desktop MSI (not sure if that works with the AppStore version) followed by system reboot. The error logs for now stopped spamming the RdClientAutoTrace directory.
You can get it here: https://go.microsoft.com/fwlink/?linkid=2068602
I discovered I had this issue last night, my 500GB SSD was filled in less than an hour when I walked away from my PC. I tried updating the RD Client as https://github.com/microsoft/WSL/issues/10216#issuecomment-1607242027 mentioned above and that did not fix it for me.
What did fix it for me was adding the following line to .wslconfig as https://github.com/microsoft/WSL/issues/10216#issuecomment-1600239227 mentions.
[wsl2]
guiApplications=false
My WSL version output if it's helpful:
WSL version: 1.3.11.0
Kernel version: 5.15.90.2-3
WSLg version: 1.0.54
MSRDC version: 1.2.4240
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25880.1000-230602-1350.main
Windows version: 10.0.22621.1992
Last time I know it was working was about a week ago if that's helpful.
I came up with a simple solution that doesn't require disabling guiApplications:
- Delete the folder
%temp%\DiagOutputDir\RdClientAutoTrace - Create a txt file under
%temp%\DiagOutputDirand rename it toRdClientAutoTrace, make sure you have delete the extension name.txtof the file - No RdClientAutoTrace files will be created any more
I just had to delete over 100gb of these files.
This needs to be fixed asap.
Does this method have a side effect ?
No side effects. Those files are all tracing logs.
I have the same issue, my disk consumed almost all of the usable space overnight.
I deleted following option out of my .wslgconfig (%UserProfile%.wslgconfig)
WSL2_WESTON_SHELL_OVERRIDE=desktop-shell
Now it runs perfect.
I came up with a simple solution that doesn't require disabling guiApplications:
1. Delete the folder `%temp%\DiagOutputDir\RdClientAutoTrace` 2. Create a txt file under `%temp%\DiagOutputDir` and rename it to `RdClientAutoTrace`, make sure you have delete the extension name `.txt` of the file 3. No RdClientAutoTrace files will be created any more
Is it ok to do this? im just asking will it corrupt my wsl?
Is it ok to do this? im just asking will it corrupt my wsl?
It won't. I have used this trick for several weeks and didn't encounter any issue.
Is it ok to do this? im just asking will it corrupt my wsl?
It won't. I have used this trick for several weeks and didn't encounter any issue.
Ok thanks.
I deleted following option out of my .wslgconfig (%UserProfile%.wslgconfig)
WSL2_WESTON_SHELL_OVERRIDE=desktop-shellNow it runs perfect.
I'm wondering what leads this to fix it for you... 🤔
Is it ok to do this? im just asking will it corrupt my wsl?
It won't. I have used this trick for several weeks and didn't encounter any issue.
I tested it. Seems to not have any issues up to now.
Just noticed my system drive was full. Came across this post and deleted 384GB of ETL files!
I deny all permissions of SYSTEM user group, seems it's still adding files but just few files
That problem fill my disk. and cursor loading blinking.
Fixing temporary:
cmd>wsl --shutdown cmd>rmdir /s /q "%temp%\DiagOutputDir\RdClientAutoTrace" cmd>notepad %UserProfile%/.wslconfig
WSL2_WESTON_SHELL_OVERRIDE=desktop-shell
guiApplications=false
Hopefully the below can be used in the interim..
Stop-WSLAndCleanRdClientAutoTrace -RepoOwner 'microsoft' -RepoName 'WSL' -IssueNumber 10216
function Stop-WSLAndCleanRdClientAutoTrace {
<#
.SYNOPSIS
Stops all WSL processes and cleans up the RdClientAutoTrace directory if a specific GitHub issue is still open.
.DESCRIPTION
This function checks the status of a specified GitHub issue. If the issue is open, it proceeds to shut down all WSL instances, stop the LxssManager service, delete the RdClientAutoTrace directory, and create a dummy file to prevent future logging. Requires administrative privileges to run.
.PARAMETER RepoOwner
The owner of the GitHub repository.
.PARAMETER RepoName
The name of the GitHub repository.
.PARAMETER IssueNumber
The number of the GitHub issue to check.
.EXAMPLE
Stop-WSLAndCleanRdClientAutoTrace -RepoOwner 'microsoft' -RepoName 'WSL' -IssueNumber 10216
Checks the status of GitHub issue #10216. If open, applies the workaround to stop WSL processes and clean the RdClientAutoTrace directory.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$RepoOwner,
[Parameter(Mandatory = $true)]
[string]$RepoName,
[Parameter(Mandatory = $true)]
[int]$IssueNumber
)
# Function to check the status of a GitHub issue
function Check-GitHubIssueFixed {
param (
[string]$RepoOwner,
[string]$RepoName,
[int]$IssueNumber
)
$issueApiUrl = "https://api.github.com/repos/$RepoOwner/$RepoName/issues/$IssueNumber"
try {
$issue = Invoke-RestMethod -Uri $issueApiUrl -Headers @{Accept = 'application/vnd.github.v3+json'}
return $issue.state -eq 'closed'
}
catch {
Write-Warning "Failed to check GitHub issue status. Error: $_"
return $false
}
}
# Ensure the function is running with administrative privileges
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Error "This function requires administrative privileges. Please run PowerShell as an administrator."
return
}
# Check if the GitHub issue is fixed
$issueFixed = Check-GitHubIssueFixed -RepoOwner $RepoOwner -RepoName $RepoName -IssueNumber $IssueNumber
if (-not $issueFixed) {
Write-Host "The GitHub issue is still open. Applying the workaround..."
# Shutdown all instances of WSL
wsl --shutdown
# Stop the LxssManager service
Get-Service LxssManager | Stop-Service -Force -ErrorAction Stop
# Define the target directory and file paths
$tempPath = [System.Environment]::ExpandEnvironmentVariables('%temp%\DiagOutputDir')
$targetDir = Join-Path -Path $tempPath -ChildPath "RdClientAutoTrace"
$dummyFile = Join-Path -Path $tempPath -ChildPath "RdClientAutoTrace.txt"
# Delete the RdClientAutoTrace directory if it exists
if (Test-Path -Path $targetDir) {
Remove-Item -Path $targetDir -Recurse -Force -ErrorAction Stop
}
# Ensure the DiagOutputDir directory exists
if (-not (Test-Path -Path $tempPath)) {
New-Item -ItemType Directory -Path $tempPath | Out-Null
}
# Create a dummy RdClientAutoTrace file
New-Item -ItemType File -Path $dummyFile | Out-Null
# Rename the dummy file to RdClientAutoTrace (without .txt extension)
Rename-Item -Path $dummyFile -NewName ($dummyFile -replace '\.txt$','') -ErrorAction Stop
Write-Host "WSL processes stopped and RdClientAutoTrace directory handled."
}
else {
Write-Host "The GitHub issue has been resolved. No need to apply the workaround."
}
}
Just deleted ~100 gigs of this garbage from the last week and applied the workaround. This needs to be fixed.
I came up with a simple solution that doesn't require disabling guiApplications:
- Delete the folder
%temp%\DiagOutputDir\RdClientAutoTrace- Create a txt file under
%temp%\DiagOutputDirand rename it toRdClientAutoTrace, make sure you have delete the extension name.txtof the file- No RdClientAutoTrace files will be created any more
Didn't work. After I deleted, it creates a new Rd folder and keeps generating the file, do I miss anything?
do I miss anything? Apparently the extension name is hidden on your system and you didn't remove the extension name from the file you created.
Bump.
When this is triggered, it wears down SSDs, causes system drive to fill up and WSL to stutter like mad. This is a major regression and it looks like wasn't so much as acknowledged by m$.
the error that causes the trace file to be created also un-focused me, which is an inconvenience for some fullscreen games that minimize when unfocused; a solution i found was to run a GUI app in the background with explorer closed (maybe not needed?), this no longer caused the random un-focusings and creation of log files
Didn't work
You didn't delete .txt file extention, therefore it shown in Explorer with type Text Document.
This issue is opened for 2 years now. I've just removed 100 GB of trash generated since.. 27.12! Only 6 days! This is unacceptable!
Next to the .wslconfig configuration file (usually in the C:\Users[User] folder), create a new .wslgconfig file. Name differs by one letter. In it add two lines:
[system-distro-env]
WSLG_USE_MSTSC=true
Restart WSL: wsl --shutdown No more RdClientAutoTrace directory will be created.
You can check it by changing the value. If true - RdClientAutoTrace folder and a bunch of files are not created. If false or absence of parameter or configuration file - it is created.
Application of systemDistro is not necessary now. Actually, it could have been suggested before. I had to dig into the wslg code.
[system-distro-env] WSLG_USE_MSTSC=true
Causes problems for me when I start an Ubuntu terminal session. Pops up a Remote Desktop help box or something.