Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman - XDG_RUNTIME_DIR directory "/mnt/wslg/runtime-dir" is not owned by the current user #11542

Open
1 of 2 tasks
salcinad opened this issue Apr 30, 2024 · 11 comments
Open
1 of 2 tasks

Comments

@salcinad
Copy link

Windows Version

Microsoft Windows [Version 10.0.19045.4291]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-2

Distro Version

Ubuntu 24.04

Other Software

podman 4.9.3+ds1-1build2

Repro Steps

install Ubuntu 24.04 - wsl --install Ubuntu-24.04
basic setup: username/password, proxy in .bashrc and /etc/apt/apt.conf.d/01proxy
DNS - disable automatically generated by WSL and setup resolve.conf manually
update system: sudo apt update -y && sudo apt upgrade -y
install podman: sudo apt -y install podman
run podman info: podman info
test podman run

Expected Behavior

podman info should show relevant information and work as expected

Actual Behavior

$ podman info
ERRO[0000] XDG_RUNTIME_DIR directory "/mnt/wslg/runtime-dir" is not owned by the current user
$

$ podman run hello-world
ERRO[0000] XDG_RUNTIME_DIR directory "/mnt/wslg/runtime-dir" is not owned by the current user

Diagnostic Logs

No response

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@OneBlue
Copy link
Collaborator

OneBlue commented Apr 30, 2024

Thank you, this is a known issue with ubuntu 24.04, because there's already a UID=1000 before the WSL user is created, so the WSL user gets a different UID, which breaks wslg's expectation and leads to errors like the one you're seeing.

We've contacted the distribution maintainer to see if the UID can be fixed from their end

@salcinad
Copy link
Author

salcinad commented May 1, 2024

Seems there is an default "ubuntu" user with Ubuntu-24.04 with id 1000, user created with installation have id 1002.
$ id 1000 uid=1000(ubuntu) gid=1001(ubuntu) groups=1001(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),1000(lxd)

if i switch to that user i could run podman info, but this is not expected

$ sudo -i
# su - ubuntu
$ podman info
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
host:
  arch: amd64
  buildahVersion: 1.33.5
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
...
version:
  APIVersion: 4.9.3
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.22.1
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.3
$

@trallnag
Copy link

trallnag commented May 1, 2024

As a workaround you can install Ubuntu not from the Microsoft Store, but via wsl --import and get the image archive from here: https://cloud-images.ubuntu.com/wsl/

This way there is no prompt for creation of a new user. Note that things like Windows Terminal profile won't be added automatically.

@Stelminator
Copy link

Seems there is an default "ubuntu" user with Ubuntu-24.04 with id 1000, user created with installation have id 1002. $ id 1000 uid=1000(ubuntu) gid=1001(ubuntu) groups=1001(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),1000(lxd)

if i switch to that user i could run podman info, but this is not expected

$ sudo -i
# su - ubuntu
$ podman info
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
host:
  arch: amd64
  buildahVersion: 1.33.5
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
...
version:
  APIVersion: 4.9.3
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.22.1
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.3
$

This might be why I have a command entry in my /etc/wsl.conf

[boot]
systemd=true
command = mount --make-rshared /

@salcinad
Copy link
Author

@Stelminator that will fix the problem/message with "WARN[0000] "/" is not a shared mount" but not the real issue which we have, and thus that there is already user in rootfs image (at lease in 20240508 release from the link which @trallnag posted). And thus when the installer prompts for User creation the new user gets id 1002 and can not execute the "podman info" command as seen in first post.

@OneBlue any replay from distribution maintainer?

@akinomyoga
Copy link

I think this is also related to #10473, #10498, and #9689.

@SirMishaa
Copy link

Would be interested to have news for this ? I've just installed new Ubuntu 24.04 from scratch and I got issue like that for other tools :(

@zohaibhassan156
Copy link

I beleive its resolved in latest version. you will need to update wsl and reinstall ubuntu24

wsl --update --pre-release
wsl --install

@tusharsnx
Copy link

I updated WSL to 2.3.21 and re-installed Ubuntu-24.04 and I still have the issue. UID 1000 is preallocated to the ubuntu user.

@Stelminator
Copy link

@tusharsnx

I updated WSL to 2.3.21 and re-installed Ubuntu-24.04 and I still have the issue. UID 1000 is preallocated to the ubuntu user.

You might have an old image.

I just imported noble/20240917, and it doesn't have the pre-allocated user; I could not quickly find a changelog mentioning it.

https://cloud-images.ubuntu.com/wsl/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants