How to get 2 instances of LibreOffice running?

I use VNC and also sit locally at my computer. If I’ve started LibreOffice locally, any document I open in VNC opens locally, invisible to me in VNC. And likewise, if I’ve left any docs open in VNC, when I return home and open a document, it opens in the VNC window and I have to log in, close all open docs, then restart VNC again.

Is there a way to have the same user (I’m running Linux) open two separate instances of LibreOffice or force it to display a window on a particular display? My VNC is at :3.0 and my localhost is :0.0. I’ve successfully done this with some programs using the --display parameter but this doesn’t work for LibreOffice.

It’s a very frustrating limitation. Especially since when I’m working remotely, the only way to get LibreOffice to run on the VNC terminal is to kill it, causing any work or open documents to risk being unsaved. They usually are safely “Recovered” but still…it just seems silly to have it not spawn a separate process in whichever display is being used.

Any thoughts or work-arounds would be fantastic.

Use -env:UserInstallation=file:///path/to/dedicated/user/profile when launching LibreOffice in VNC session using the command line. Use dialogs of that instance of LO to open files (not double-clicking to files in file manager).

Hey, fantastic. So the cli example would be:

:~$ libreoffice --writer -env:UserInstallation=file:///home/myusername

Is there any way to set this via bash or something so that it will be possible to use it doubleclicking? For instance, if I doubleclick an attachment within Thunderbird, can it open this way by default?

@Mike-Kaginski, alas, tried this and it doesn’t seem to work. Perhaps because it’s the same user profile? Could that be what’s causing the issue…? I’m running VNC on the same machine and same user profile as I’m using on localhost.

https://wiki.documentfoundation.org/UserProfile

By the way, the easiest way to spell names correctly is use copy-paste.

@mike-kaganski, apologies for the typo. I’ve tried and am getting the same thing. If I’ve already opened an instance of LibreOffice, it’s bound to the existing one. Tried with the /home/myusername/.config/libreoffice/4/user location and still opens up on localhost. Am I doing something wrong still?

It’s strange… I don’t run Linux; still, for me, command "C:\Program Files\LibreOffice\program\soffice.exe" -env:UserInstallation=file:///C:/Users/mk/AppData/Roaming/LibreOffice/4.suppl works as expected. I’d expect that for you, something like libreoffice -env:UserInstallation=file:///home/myusername/.config/libreoffice/4vnc --writer should do.

I had the flag --writer in the middle, but no, it’s not working. Thanks for trying though, and who knows, maybe I made a typo or something. Will keep playing around.

A wild guess: can’t that be that libreoffice is a kind of script that itself does some “smart” processing that finds the running instance, and so doesn’t allow the actual binary (soffice.bin) to handle the -env switch?

Alas, no, that doesn’t seem to help either. Tried with soffice instead of libreoffice and it’s the same result.

I hoped you’d try soffice.bin. Well - /me is out of ideas, sorry. Will only be able to test on a Linux in two weeks…

Well, I’ve had this issue for months now, so I am happy to wait a few weeks until you can test on Linux! :slight_smile: No worries. Thanks for all your time thus far.

Did you ever figure it out? This is the top google search result for this topic. I got two instances running using the full path: /usr/lib/libreoffice/program/soffice. That’s still a script. The actual binary executable is /usr/lib/libreoffice/program/soffice.bin.