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

Using Discord RPC on WSL2 #36

Open
takase1121 opened this issue Aug 18, 2021 · 7 comments
Open

Using Discord RPC on WSL2 #36

takase1121 opened this issue Aug 18, 2021 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@takase1121
Copy link

takase1121 commented Aug 18, 2021

I've been using instructions from this gist for a while now. It works except some occasional bugs. I think this can be put in the wiki.

EDIT:
I just realized that was the exact instructions for WSL1. That's mean it works for both systems.

@andweeb
Copy link
Owner

andweeb commented Aug 18, 2021

Hi @takase1121! Hmmm that's interesting..

I did locally test WSL 2 with socat and npiperelay but ran into issues with the relay connection being closed all the time. I wonder if these instructions in that gist has anything that differs from the WSL 1 steps I noted here. 🤔

I'm a little busy these days but when I have the time I'll see if I can get Rich Presence to work in WSL 2 with the same steps and resolve any of those occasional bugs you're finding.

If you're able to note a checklist of issues that you're observing with the plugin in WSL 2 and/or validate what's stated in the plugin's WSL wiki page, I'd really appreciate it. I may be able to apply fixes for those even if I'm not able to personally get WSL 2 working. In any case thanks for letting me know!

@andweeb andweeb added the help wanted Extra attention is needed label Feb 5, 2022
@SeRyKii
Copy link

SeRyKii commented Jul 29, 2023

Hello, i managed to run this in WSL2. Got some random write failed 32: Broken pipe errors but it still works. I used the same instructions as the wiki has for WSL1. Only needed to run this as sudo because of some Operation not permitted errors.

image image

EDIT:
It seems that error write failed 32: Broken pipe is triggered when i start neovim without any file (just plain nvim command).

@ongyx
Copy link

ongyx commented Aug 23, 2023

Hi! I've tested out the WSL1 configuration on my Arch Linux WSL2 install (kernel 5.15.90.1-microsoft-standard-WSL2) and it works great. I ran into EACCES errors at first but it's because I didn't relog for the discord group to take effect.

For convenience, attached here is a script that cross-compiles npiperelay, creates the discord group, and adds a systemd service that automatically starts the relay on boot: https://gist.github.com/ongyx/6b05e076db3a3243e6721c90c1dc21e6
This should work on any system that uses systemd, but I haven't tested it out on other systems yet.

@Rahim-444
Copy link

I'm still struggling to make this work
when I run this command it gets stuck and never executes completely
exec socat UNIX-LISTEN:/var/run/discord-ipc-0,fork,group=discord,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/discord-ipc-0",nofork

@takase1121
Copy link
Author

I'm still struggling to make this work when I run this command it gets stuck and never executes completely exec socat UNIX-LISTEN:/var/run/discord-ipc-0,fork,group=discord,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/discord-ipc-0",nofork

It's supposed to get stuck, as long as npiperelay is running on Windows and the named pipe is created then it's working.

@Rahim-444
Copy link

It's supposed to get stuck, as long as npiperelay is running on Windows and the named pipe is created then it's working.

Well, it doesn't work for my case, I guess it doesn't always work on wsl2.

@Zedai00
Copy link

Zedai00 commented Apr 17, 2024

Hi! I've tested out the WSL1 configuration on my Arch Linux WSL2 install (kernel 5.15.90.1-microsoft-standard-WSL2) and it works great. I ran into EACCES errors at first but it's because I didn't relog for the discord group to take effect.

For convenience, attached here is a script that cross-compiles npiperelay, creates the discord group, and adds a systemd service that automatically starts the relay on boot: https://gist.github.com/ongyx/6b05e076db3a3243e6721c90c1dc21e6 This should work on any system that uses systemd, but I haven't tested it out on other systems yet.

Using this script and after shutting down wsl it works
Maybe add this to wiki or official support for wsl2

Edit:
Well forget what i said its not stable if close the nvim session then it will not work again until you restart the service
i dont know what the problem is also the error write failed 32: Broken pipe comes frequently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants