zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
19.42k stars 611 forks source link

Unable to run zellij as user on WSL2 #3379

Closed RudolfVonKrugstein closed 1 month ago

RudolfVonKrugstein commented 1 month ago

2. Issues with the Zellij UI / behavior / crash

Issue description

When I try try to run zellij, I get:

❯ zellij
Failed to list existing sessions: Err(PermissionDenied)

Minimal reproduction

I installed zellij into WSL2 using cargo install zellij and ended up with:

zellij 0.40.1

If I try to start it as the normal user, I get the error above. If I do sudo zellij, it works.

Other relevant information

I am running this on WSL2/Ubuntu.

I assume, there are some files zellij tries to access that it does not have permissions to. But I am unable to find out which files these are.

I looked into several directories like ~/.cache and ~/.local/share/zellij but could not find the offender.

Maybe its some simple directory I am not looking at?

tcheronneau commented 1 month ago

Having the same issue, doing sudo su - ${USER} is working ... Maybe it's more a WSL issue than a zellij.

RudolfVonKrugstein commented 1 month ago

Having the same issue, doing sudo su - ${USER} is working ... Maybe it's more a WSL issue than a zellij.

I think so too, but it works on my private computers wsl installation, and not on my work computer wsl installation. I would love to find out why :)

unoflavora commented 1 month ago

Have you tried running zellij with strace (e.g starce zellij)? You can see what is wrong with zellij. For me, it's incorrect permissions for the folder /run/user/1001, which is also $XDG_RUNTIME_DIR. So for me, the fix is

$ sudo mkdir $XDG_RUNTIME_DIR
$ sudo chown $USER:$USER $XDG_RUNTIME_DIR
RudolfVonKrugstein commented 1 month ago

Oh, thank you! That helped. Only that my runtime dir was /mnt/wslg/runtime-dir/ and I indeed could see via strace, that that was the problem. But your commands worked either way.

augustohp commented 2 weeks ago

Related to #2453.