WireGuard conflicts with NeosVR headless-server on Linux

By ValkaTR, 12 May, 2023
neosvr linux

WireGuard is running and starting NeosVR headless-server with the command "mono Neos.exe" segfaults with following error message:

mono_w32socket_convert_error: no translation into winsock error for (126) "Требуемый ключ недоступен"

It turns out, that segfault happens in mono, not in Neos.exe, and the reason because I had WireGuard running. When I disable WireGuard virtual network interface wg0, then Neos.exe starts working perfectly fine.

I have tried playing around with capabilities (tried CAP_NET_ADMIN, CAP_NET_BIND_SERVICE, CAP_SYS_ADMIN), run from root, running through Steam Proton temporarily.

I found this bug mentioned on github:

The trouble is that it should be fixed long time ago, but it's not. This fix activated only if environment variable ENOKEY is set. Seems like my Manjaro binaries don't have it enabled, so I downloaded mono source, activated the code by commenting environment variable check, compiled and installed to /usr/local/bin/mono:

$ git clone

$ mcedit ./mono/mono/metadata/w32socket-unix.c

(somewhere around line 1500)

$ ./ --prefix=/usr/local

$ make

$ sudo make install

As a Bonus, here's user-space systemd .service-file for running NeosVR headless server with autorestart and autostartup:

$ mkdir -pv ~/.config/systemd/user/

$ touch ~/.config/systemd/user/neosvr-server.service

$ mcedit ~/.config/systemd/user/neosvr-server.service


Description=NeosVR Server
ExecStart=/usr/local/bin/mono Neos.exe -c Config/Config.json

Now reload daemons in user-space:

$ systemctl --user daemon-reload

To run the service, type:

$ systemctl --user start neosvr-server.service

To enable autostartup after restart of the computer, type:

$ systemctl --user enable neosvr-server.service

Check status of NeosVR server service:

$ systemctl --user status neosvr-server.service

Live log can be viewed with:

$ journalctl --user --follow --unit neosvr-server.service

* mcedit - is the Midnight Commander Text Editor I use. It is my favorite ^^. You can use any other favorite text editor you like: nano, vim, mousepad, etc.