1

I have an Ubuntu 16.06LTS system (let's call it Fred) that I use while sitting in front of it and on that same system I run a VNC server (FredVNC). My problem is that when I've started an application in one environment (i.e. Fred), it ONLY runs in that environment. For example, if I start Libre Office and work on a document at home on Fred, then leave the house and want to open a .doc file in an email I'm checking remotely via a VNC client connection (to FredVNC), that .doc file does not open within VNC, but rather on my local desktop...Fred. I have to return HOME to see it. Or (alternatively) I can kill -9 Libre Office, then open the application in VNC. But then any open docs that were on Fred risk losing data.

What I would LIKE is a way to have two parallel instances of apps open up individually...so that I could be working in Libre Office in VNC, while simultaneously having Libre Office documents open on Fred.

I am assuming (perhaps naively) that there's a command line way to open up an instance of a program that will assign it to the VNC or the Fred Display. I've tried searching for this and unfortunately am in a keyword nightmare. Nothing seems to be selecting the right terms and I get totally off topic results.

If anyone knows what I need to do that would be hugely helpful. Thanks in advance!

1

It looks like your VNC server creates a virtual desktop instead of providing the existing one (which is, I believe, more common behavior). Plus Libre Office uses a single "main" process per user. When you open an additional file, the new process detects the existing one, relies the job to it and exits. I guess the old process sticks to whichever display was right at the moment it started.

After you kill the old process, a new one can open a file and persist, becoming the "main" Libre Office process from now on. It uses the display it considers right.

I think you could reconfigure the VNC server to provide the existing desktop. On the other hand I guess you had your reasons to use a separate virtual desktop, so you may not want to change this.

What I would LIKE is a way to have two parallel instances of apps open up individually...so that I could be working in Libre Office in VNC, while simultaneously having Libre Office documents open on Fred.

I don't know any way to make Libre Office ignore the old process running for the same user. There's a --display option but I cannot make it work.

See this question: X11 forwarding - grab windows of programs already running. My answer there introduces xpra. If you run (the first) Libre Office with xpra, you will be able to attach to its window(s) from elsewhere.

See what else you can do. In my opinion the main advantage over VNC is the ability to choose the operation mode at the moment you connect. You can start a new desktop, clone an existing one, run a program or attach to a program already running with xpra. Quite flexible, I think.

In the worst case scenario you would get to your existing desktop only to gently close non-"xpra-ed" Libre Office windows without losing data. Then you would run Libre Office anew, this time with xpra, still from the remote client.

  • Thank you very much for the thoughts -- yes, exactly, you have understood what's wrong or what I need to do. It might be that xpra will help me prevent this issue, so I will look into it. Not exactly what I want (there's no way to force Libre Office to run 2 instances??) but perhaps enough of a work around. – confused Jul 17 '18 at 19:30
  • @confused There's a --display option (e.g. lowriter --display :1) but I cannot make it work. If it works for you then please write your own answer and I will upvote it. – Kamil Maciorowski Jul 17 '18 at 20:25
  • How can I tell which display my VNC server is using? I think it's the same, actually, based on the results of uname -n, that's the same whether I'm in VNC or not. So maybe if I could simply start VNC running in a different $DISPLAY environment that would at least solve part of it? Then I could try swriter --display :1 or something? – confused Jul 18 '18 at 0:27
  • I've figured out my VNC $DISPLAY is :3.0 and my localhost is :0.0. Can I tell a window to open in one versus the other? – confused Jul 18 '18 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.