1. Edit the file $HOME/.lyx/lyxrc.defaults
\serverpipe "$HOME/.lyx/lyxpipe"
2. In Lyx you set Tools-----> Preferences----> Paths----> Lyxserver Pipe:
$HOME/.lyx/lypipe
3. Restart Lyx.