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

Failed to listen: Address already in use (os error 98) #21

Open
msdsk opened this issue Jan 24, 2022 · 5 comments
Open

Failed to listen: Address already in use (os error 98) #21

msdsk opened this issue Jan 24, 2022 · 5 comments

Comments

@msdsk
Copy link

msdsk commented Jan 24, 2022

When running wsld on wsl2 side I get an eror: Failed to listen: Address already in use (os error 98). I have in my setup wsl-vpnkit and systemd which I believe might be interfering somewhere, preventing the socket from being properly established? My .wsld.toml is now just [x11].

@nbdd0121
Copy link
Owner

I really should add more context to error messsages😅

Can you check if /tmp/.X0-lock or /tmp/.X11-unix/X0 exists? If so try delete them and retry. Apparently WSL never clean up /tmp directory.

@msdsk
Copy link
Author

msdsk commented Jan 24, 2022

It seems have been just that, there was indeed /tmp/.X11-unix/X0. Removing it makes it all work perfectly, thanks!
E: Though the problem seems to be persisting after reboots. Seems like I need to clean the temp folder every time.

@spacebat
Copy link

This workaround is no longer so easy as /tmp/.X11-unix is mounted read-only to prevent deleting the socket:
microsoft/WSL#9189

@mprasil
Copy link

mprasil commented Dec 11, 2022

@spacebat I think this might only be issue with systemd=true? Anyway if you're using systemd in your WSL distro, I have created this unit to mount rw tmpfs on top of the ro mount WSL makes:

# /etc/systemd/system/rw-x11.service
# Note: This is workaround to make /tmp/.X11-unix rw for wsld

[Unit]
Description=X11 remount service
After=systemd-tmpfiles-setup.service tmp.mount
ConditionPathExists=/tmp/.X11-unix

[Service]
Type=oneshot
ExecStart=/bin/mount -t tmpfs tmpfs /tmp/.X11-unix

[Install]
WantedBy=multi-user.target

Don't forget to sudo systemctl daemon-reload && sudo systemctl enable --now rw-x11.service to run and enable the service for future boots.

@RicardoRdzG
Copy link

this is still happening. Following mprasil it can be fixed but every time the tmp files need to be removed before wsld runs

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

5 participants