wsl Ubuntu cannot connect when using emacsclient to connect to emacs server.
My emacs init.el file settings are
(setq server-socket-dir "~/.emacs.d/server")
and I see the following when trying to start the server and client:
huyu01@huyu01:~/.emacs.d/server$ emacs --daemon
Starting Emacs daemon.
huyu01@huyu01:~/.emacs.d/server$ ls ~/.emacs.d/server
server
huyu01@huyu01:~/.emacs.d/server$ ls -l ~/.emacs.d/server
total 0
srwx------ 1 huyu01 huyu01 0 May 6 17:34 server
huyu01@huyu01:~/.emacs.d/server$ whoami
huyu01
huyu01@huyu01:~/.emacs.d/server$ emacsclient --server-file=~/.emacs.d/server/server -c
emacsclient: error accessing server file "~/.emacs.d/server/server"
huyu01@huyu01:~/.emacs.d/server$ emacsclient --server-file=~/.emacs.d/server/server a
emacsclient: error accessing server file "~/.emacs.d/server/server"
huyu01@huyu01:~/.emacs.d/server$ emacsclient a
emacsclient: can't connect to /mnt/wslg/runtime-dir/emacs/server: Permission denied
emacsclient: No socket or alternate editor. Please use:
--socket-name
--server-file (or environment variable EMACS_SERVER_FILE)
How can this be solved?