LyX under WSL2 using VcXsrv (sharing clipboard problems)

Cris Fuhrman fuhrmanator at
Mon Nov 30 16:28:01 UTC 2020

On Mon, Nov 30, 2020 at 10:03 AM Pavel Sanda <sanda at> wrote:

> On Fri, Nov 27, 2020 at 02:47:34PM -0500, Cris Fuhrman wrote:
> > Sadly, I can't get the clipboard to work consistently outside of X. For
> > example:
> >
> >
> >    1. In Windows, start the VcXsrv
> >    2. In WSL2, start LyX, create New file
> >    3. In Windows, copy some text (e.g., from Notepad++)
> >    4. In LyX paste (this works)
> >    5. In LyX, change the text, then Copy
> >    6. In Notepad++, paste (no effect). Windows-V (to show the clipboard
> >    history) shows no trace of the newly copied text from LyX.
> >    7. Try steps 2-4 again and it no longer works, implying something
> >    "breaks" the Xserver in those steps.
> >
> > I'm able to do copy/paste with other applications such as xfe (file
> > explorer) and gedit (text editor), so I know my XServer can work properly
> > (at least sometimes).
> It would be interesting to try different apps than xfe or gedit, some which
> use Qt framework as does LyX.

Any suggestions? I'm happy to try them, but I don't use X11 applications
much apart from LyX these days.

> Qt's handling of clipboard can be tricky and buggy at times, but if other
> Qt
> based apps do work we should have a look at it.

I actually found a work-around to make LyX work by turning off "primary"
clipboard in VcXsrv. I'm not sure if other X11 apps work properly, however.
So far it's OK with xterm. Here's how I'm starting VcXsrv in a batch file
that runs when I boot Windows 10:

REM Change E:\VcXsrv to your VcXsrv installation folder
START /D "E:\VcXsrv" /B vcxsrv.exe -multiwindow -clipboard -noprimary
-nowgl -ac -displayfd 720

Anyway, if LyX reasonably works under WSL2 it would be worth to create LyX
> wiki page
> with intructions how to set it up and then I can make direct link from our
> official
> Download pages.
> I am thinking for some while that WSL-based LyX could become in longterm
> the best
> way how to get LyX working under Windows -- all the LaTeX/python deps and
> security
> updates for ghostscript and imagemagick solved at one shot by the
> underlying
> distribution... In more than decade we lost so much energy in dicussions
> and
> fights about the windows installers and associated MikTeX bugs which could
> be
> avoided this way.

I think it's worth considering. WSL2 is fast-moving and requires some
configuring to make X11 work. I think it's better than running Linux in a
VirtualBox because of disk space (images are pretty huge, compared to
dumping a save of your distro in WSL). But all the tweaking I had to do on
linux seems to have lots of accidental complexity. For example, I still
can't type accents in LyX in WSL2 as I do in Windows when I have selected
an International keyboard. I know it's possible in WSL2, but I have to
Google it, set up the keyboard properly and that's a whole rabbit hole (WSL
isn't like a distro with a nice set of configuration tools for the GUI --
you have to hack to make X11 work). Also, there's still not an official
WSL2 for Ubuntu 20.04 LTS (you can make it work, but it's a tweak). LyX
isn't ready out of the box...

When you add up all the Googling, the 'sudo apt install ...' commands you
have to type, etc., I'm not sure those are overall less than the headaches
of configuring the python path, etc., in Windows. As you say, with a Wiki
it could be less painful. I know I didn't have to touch the texlive install
so far. But, I can definitely see how it would be better for LyX devs to
not have to support Windows 10.

Honestly, I've moved away from LyX to markdown/pandoc/latex for newer
content. It's not as much control as LyX, but it's good enough for me to
produce documentation useful in my courses. I've invested in LyX for one
set of course notes, so I will still maintain it. But the markdown/pandoc
solutions are easier to maintain on GitHub with the various collaborators I
work with.


> Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the lyx-users mailing list