Ubuntu – How to run libreoffice via ssh with x11-forwarding

command linelibreofficesshx11-forwarding

I am trying to launch loffice or localc via an established ssh connection (ForwardX11 enabled). It does however fail to show the loffice gui / splashscreen on the computer from where I run my ssh session. The loffice application runs in the remote bash but without any command line output.

All other gui applications like xterm, gvim, PyQt5 scripts work fine.
I also tried to run

/usr/lib/libreoffice/program/soffice.bin

directly, but to no avail. (loffice is a shell script redirecting to another shell script, which as far as I understand eventually launches soffice.bin.)

Also without any success I tried:

loffice --display ${DISPLAY}

Best Answer

If a LibreOffice window is open, it opens a window in the display of that process. Therefore one way would be to kill any running LibreOffice processes.