Subject: [bug#59132] [PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login.

From: dan <[email-masked]>
Date: Wed, 9 Nov 2022 12:26:12 +0800

On 11/9/2022 4:27 AM, ( wrote:
> elogind/seatd are tasked with setting up login sessions, which includes creating
> XDG_RUNTIME_DIR. They probably do work on WSL, since I'm pretty sure desktops do?

i tried the following things:

adding `(syslog-service)' and `(service elogind-service-type)' to the 
operating-system's service list.  and when i login to wsl, it shows the 
following error:

 > sudo: pam_open_session: Error in service module
 > sudo: policy plugin failed session initialization

also tried seatd, by adding `(udev-service)' and `(service 
seatd-service-type)' to the service list.  and when logging in, it shows:

 > warning: XDG_RUNTIME_DIR doesn't exists, on-first-login script won't 
execute anything.  You can check if xdg runtime directory exists, 
XDG_RUNTIME_DIR variable is set to appropriate value and manually 
execute the script by running '$HOME/.guix-home/on-first-login'

normally, when logging into wsl, users don't need to type their 
password.  i'm not sure if it related to the issue, but it might perform 
differently with a normal linux distro.

-- 
dan