Qstandardpaths: Xdg_Runtime_Dir Not Set, Defaulting to '/Tmp/Runtime-Aadithyasb'

I am using WSL in Windows 10. I have this warning getting displayed when I run a python file:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb'

I can understand that the XDG_RUNTIME_DIR environment variable is not set and it is creating its own path /tmp/runtime-aadithyasb

I am getting this warning from the moment I installed Xserver for Windows using VcXsrv to open plots when the file is ran.

Wy question is should I add this XDG_RUNTIME_DIR environment variable in windows or is there any method to set a directory under the variable for Ubuntu used under WSL?

4 Answers

I was able to find what the caused the terminal to issue the warning. Yet I am posting this so that it would be useful for people someday who are new to using WSL like me. This link helped me to solve it and gave me a better insight on how linux works under a WSL:

To solve this issue I just added the below lines to my .bashrc file:

export XDG_RUNTIME_DIR=/some/directory/you/specify 
export RUNLEVEL=3

After this just run the command

source .bashrc 

Now the warning will not keep displaying in your terminal.

4

TL;DR

Within WSL, append the following in your ~/.bashrc file in order to solve the issue:

export XDG_RUNTIME_DIR=/your/chosen/directory

However, I believe that further clarification is important for this question:

What Is XDG_RUNTIME_DIR?

The $XDG_RUNTIME_DIR environment variables is one of many environment variables which make up the XDG Base Directory Specification. The official specification is available from XDG's official website, and although the spec is not long, a more concise version is available on the Arch Wiki.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.