3

Windows 10 Anniversary Update contains a Linux subsystem. I am in need of working in a Linux environment so I began looking into this subsystem. So far, I have been able to install all the needed applications. I successfully installed gnuplot and it runs just fine. However, I cannot set term to x11, and therefore I cannot plot anything to display. Following is the error:

Terminal type set to 'qt'
gnuplot> set term x11
Terminal type set to 'x11'
Options are ' nopersist enhanced'
gnuplot>
gnuplot: unable to open display ''
gnuplot: X11 aborted.

I tried installing Xming onto the same directory as the Bash program lies in Windows, but no luck. I really need gnuplot, and even though I can install it on Windows, it would be much more convenient to have it on the Linux subsystem.

How can I fix this display/x11(forwarding) issue?

3
1

(1) Install Xming. (2) execute export DISPLAY=:0 nameOfProgram (for example export DISPLAY=:0 gnuplot

0

Another (open source!) x server is VcXsrv. You can enable ANY graphical application (not only gnuplot) for WSL.

In summary:

  • install VcXsrv (https://sourceforge.net/projects/vcxsrv/)
  • launch xlaunch.exe (e.g. in "C:\Program Files\VcXsrv\xlaunch.exe"). You should pay extra attention to the following options during configuration:
    • set "Multiple Windows" (will make windows appear like you're used to)
    • add "-ac" to the "Additional parameters for VcXsrv" (will make the x server accessible for your WSL)
    • at the end, save the configuration file to your start-up applications (%appdata%\Microsoft\Windows\Start Menu\Programs\Startup)
  • add "export DISPLAY=localhost:0.0" to the end of your "~/.bashrc"

If you would further like to run e.g. 'gnuplot -p script', you should set the XDG_RUNTIME_DIR environment variable for the corresponding temporary storage. Add

export XDG_RUNTIME_DIR=/tmp/an/appropriate/dir
export RUNLEVEL=3

to your ~/.bashrc, where "an/appropriate/dir" can be something like "runtime-" + your user name.

Sources:

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.