2017-10-07

Using Xming for GUI apps in Ubuntu on Windows 10 Home Edition

To get Ubuntu GUI applications to work under Windows Subsystem for Linux (WSL) I installed the X server Xming in Windows 10. Assuming that I've actually installed some GUI apps, such as xterm or chromium-browser, I can then start them from the Ubuntu bash prompt.

First of all, Xming needs to be started in Windows, and you need to set the DISPLAY environment variable: export DISPLAY=:0

You can then run xterm & to start a separate terminal window. I got a warning about Xming not finding the font it looks for, but I can live with that. The more serious problem is that I don't get my Swedish keyboard settings. To fix that, I adjusted the Xming shortcut in Windows. To find the shortcut file, I went to XMing in Windows 10 start menu, right-clicked, selected "More" and "Open path" as shown below:



I then right-clicked on the Xming shortcut in the explorer windows that appeared, and changed the path to the following:
"C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -multiwindow -xkbmodel pc105 -xkblayout fi -xkboptions grp:ctrl_shift_toggle
I actually used Finnish keyboard settings, since I read that some Xming versions have problems with the (identical) Swedish keyboard settings. If you already had Xming running, you probably have to exit it before you restart it:


Having restarted Xming, and started an xterm again, the keyboard had all the keys in the right places! :-)