Comments (13)
Does
wayland-0
exist in/run/user/$UID
with version 22.10.16.0? I found thatwayland-0
is missing in version 24.3.11.0 when Systemd accidentally enabled, see [this issue]No, it doesn't.
So Wayland does not work, right? If it works, what is $XDG_RUNTIME_DIR
?
from archwsl.
The root cause is Arch mounts /tmp
and /run/user/1000
as tmpfs after startup, make the existing /tmp/.X11-unit/X0
and /run/user/1000/wayland-0
unavailable.
Disable tmp.mount
is one useful solution, but I recommend:
$ cat /etc/tmpfiles.d/wslg.conf
# See tmpfiles.d(5) for details
# link WSLg display files after system started
# Type Path Mode UID GID Age Argument
L+ /tmp/.X11-unix/X0 - - - - /mnt/wslg/.X11-unix/X0
I have no idea how to disable mounting /run/user/1000
as tmpfs, so I recommend:
$ cat ~/.config/user-tmpfiles.d/wslg.conf
# Type Path Mode UID GID Age Argument
L+ %t/wayland-0 - - - - /mnt/wslg/runtime-dir/wayland-0
L+ %t/wayland-0.lock - - - - /mnt/wslg/runtime-dir/wayland-0.lock
L+ %t/pulse/native - - - - /mnt/wslg/runtime-dir/pulse/native
L+ %t/pulse/pid - - - - /mnt/wslg/runtime-dir/pulse/pid
L+ %t/dbus-1 - - - - /mnt/wslg/runtime-dir/dbus-1
$ systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer
from archwsl.
The root cause is Arch mounts
/tmp
and/run/user/1000
as tmpfs after startup, make the existing/tmp/.X11-unit/X0
and/run/user/1000/wayland-0
unavailable.Disable
tmp.mount
is one useful solution, but I recommend:$ cat /etc/tmpfiles.d/wslg.conf # See tmpfiles.d(5) for details # link WSLg display files after system started # Type Path Mode UID GID Age Argument L+ /tmp/.X11-unix/X0 - - - - /mnt/wslg/.X11-unix/X0I have no idea how to disable mounting
/run/user/1000
as tmpfs, so I recommend:$ cat ~/.config/user-tmpfiles.d/wslg.conf # Type Path Mode UID GID Age Argument L+ %t/wayland-0 - - - - /mnt/wslg/runtime-dir/wayland-0 L+ %t/wayland-0.lock - - - - /mnt/wslg/runtime-dir/wayland-0.lock L+ %t/pulse/native - - - - /mnt/wslg/runtime-dir/pulse/native L+ %t/pulse/pid - - - - /mnt/wslg/runtime-dir/pulse/pid L+ %t/dbus-1 - - - - /mnt/wslg/runtime-dir/dbus-1 $ systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer
Does %t
refer to $XDG_RUNTIME_DIR
? Also, I tried to add L+ /run/user/1000/wayland-0 - - - - /mnt/wslg/runtime-dir/wayland-0
to /etc/tmpfiles.d/wslg.conf
, but it did not work, why?
Add: I added the content that links files in /mnt/wslg/runtime-dir
to /etc/tmpfile.d/wslg.conf
, but it did not work. Must I add the content to ~/.config/user-tmpfile.d/wslg.conf
? If so, I think my workaround might be better, since it works globally, not just for one user.
from archwsl.
- system-tmpfiles.d and user-tmpfiles.d are different services, you cannot write conf in one file
- /usr/lib/systemd/system/systemd-tmpfiles-setup.service
- /usr/lib/systemd/user/systemd-tmpfiles-setup.service
- Writing
/run/user/1000/wayland-0
to/etc/tmpfiles.d/
is useless
- file owner and group are wrong
/run/user/1000/
will be remounted as tmpfs later, clear the file
-
The only global conf location for user-tmpfiles.d is
/usr/share/user-tmpfiles.d/*.conf
but user systemd-tmpfiles-setup is not enabled by default in arch, you have to enable it for each user. -
this user service may work globally for each user(incomplete and untested):
$ cat /etc/systemd/user/wslg-user-runtime-dir.service
[Service]
ExecStart = sh -c "ln -fs /mnt/wslg/runtime-dir/* "%t
from archwsl.
system-tmpfiles.d and user-tmpfiles.d are different services, you cannot write conf in one file
/usr/lib/systemd/system/systemd-tmpfiles-setup.service
/usr/lib/systemd/user/systemd-tmpfiles-setup.service
- Writing
/run/user/1000/wayland-0
to/etc/tmpfiles.d/
is useless
file owner and group are wrong
/run/user/1000/
will be remounted as tmpfs later, clear the file
The only global conf location for user-tmpfiles.d is
/usr/share/user-tmpfiles.d/*.conf
but user systemd-tmpfiles-setup is not enabled by default in arch, you have to enable it for each user.this user service may work globally for each user(incomplete and untested):
$ cat /etc/systemd/user/wslg-user-runtime-dir.service [Service] ExecStart = sh -c "ln -fs /mnt/wslg/runtime-dir/* /run/user/"%i
Well, I think 4 should work, because my link.conf
is completely same with your wslg-user-runtime-dir.service
, and I'm using it.
from archwsl.
We'd better use %t as XDG_RUNTIME_DIR
$ cat /etc/systemd/user/wslg-user-runtime-dir.service
[Service]
ExecStart = sh -c "ln -fs /mnt/wslg/runtime-dir/* "%t
from archwsl.
We'd better use %t as XDG_RUNTIME_DIR
$ cat /etc/systemd/user/wslg-user-runtime-dir.service [Service] ExecStart = sh -c "ln -fs /mnt/wslg/runtime-dir/* "%t
I've tried this, but it did not work in my link.conf
. Maybe I need to export "ln -fs /mnt/wslg/runtime-dir/* "%t
to a file to find out why it didn't work
from archwsl.
We'd better use %t as XDG_RUNTIME_DIR
$ cat /etc/systemd/user/wslg-user-runtime-dir.service [Service] ExecStart = sh -c "ln -fs /mnt/wslg/runtime-dir/* "%t
I've tried this, but it did not work in my
link.conf
. Maybe I need to export"ln -fs /mnt/wslg/runtime-dir/* "%t
to a file to find out why it didn't work
Well, I added sh -c "echo "%t" > /home/[username]/aaa.txt"
in my link.conf
, and found that %t
is /run
.
As for your systemd-tmpfiles-setup.service
, I could not even start it. When I inputed sudo systemctl start /etc/systemd/user/wslg-user-runtime-dir.service
in my terminal, it told me "Failed to start etc-systemd-user-wslg\x2duser\x2druntime\x2ddir.service.mount: Unit etc-systemd-user-wslg\x2duser\x2druntime\x2ddir.service.mount not found."; when I typed sudo systemctl start wslg-user-runtime-dir.service
, it said "Failed to start wslg-user-runtime-dir.service: Unit wslg-user-runtime-dir.service not found." Please tell me how to start it. Thanks 😂
from archwsl.
I guess that your /etc/systemd/system/[email protected]/link.conf
is part of user init process, not a standalone user service.
User's XDG_RUNTIME_DIR is not done , when sh -c "ln -fs /mnt/wslg/runtime-dir/* "%t
executed.
from archwsl.
Maybe. BTW, do you know how to start your wslg-user-runtime-dir.service
?
from archwsl.
$ cat /etc/systemd/user/wslg-runtime-dir.service
[Service]
Type=oneshot
ExecStart=sh -c "ln -fs /mnt/wslg/runtime-dir/* "%t
[Install]
WantedBy=default.target
$ sudo systemctl --global enable wslg-runtime-dir
Created symlink /etc/systemd/user/default.target.wants/wslg-runtime-dir.service → /etc/systemd/user/wslg-runtime-dir.service.
from archwsl.
It works! Thank you so much!
from archwsl.
Related Issues (20)
- `sudo pacman -Su` results in errors HOT 2
- Missing implementation of get_mempolicy and NUMA support HOT 6
- Cannot install anymore HOT 1
- Cannot change the default user with arch.exe HOT 3
- Problem with Docker and language change HOT 18
- result of `which` is `/usr/sbin`
- Arch_Online.zip uses very old rootfs HOT 2
- How i reset my password?
- glibc-linux4 has been removed in archlinuxcn sources HOT 1
- can't start wslg HOT 3
- systemctl initializing HOT 21
- AUR makepkg utility invalid argument '/mnt/c/...' to '-ffile-prefix-map'" error: Arch.exe path should not contain spaces
- Arch_Online installer discards download after being blocked HOT 4
- Windows Defender reports Trojan from release 24.3.31.0 HOT 3
- Run GPU processes in ArchWSL HOT 1
- How to install `btrfs-progs` HOT 1
- systemd-networkd-wait-online.service is start timeout. HOT 1
- As we know in issue #308 that mesa uses llvmpipe instead of D3D12, if my laptop has a nvidia gpu as well, how to make Arch use Nvidia GPU like the Ubuntu WSL do? HOT 15
- How Do i uninstall HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archwsl.