This is a short HowTo about the new Windows Subsystem for Linux (WSL) and Xming, the X-server for Windows. This HowTo refers to Windows 10 (build: 1703) and Xming Version 126.96.36.199 (x64). You can download the Xming for free, just use your search engine.
I will describe how you can set up Xming in order to start it from “Start” menu. This HowTo won’t describe how to install WSL. This is already hone here very well. In short I will tell, how a simple Window Manager for X (openbox) is installed and how you can launch it, too.
Actually I’m writing this, because I wasn’t able to configure Xlaunch to start a single program. Honestly I haven’t got the slightest idea, what the “Start program” configuration window is good for, neither how to use it. No matter what I was providing as a command, it only said, it couldn’t be found. So finaly I gave up and was looking for a workaround. And – I found a very nice one! I figured out how to launch Xming from the command line, put that into a .bat file and pinned it to the Start menu. I also provided a nifty icon for it too – so I can see the difference between the Xming icons.
Ok, first things first:
- Aktivate Windows Subsystem for Linux. See here how to do it.
- Open a bash session (Windows-key + R –> bash + Enter – or type in a CMD-command line “bash”.
- install openbox and lxpanel
$ apt install openbox lxpanel menu dbus-x11 lxterminalNote: google-chrome or chromium-browser don’t work with this realese of WSL yet. No need to try out this atm.
- Create the file
Xstart.batin your user directory (or where you like).
and add the following content to it:
start C:\Program Files (x86)\Xming\Xming.exe -dpi 120 -nodecoration && start bash -c "DISPLAY=:0.0 lxpanel & DISPLAY=:0.0 dbus-launch --exit-with-session openbox-session"
If you’re on a full-HD monitor, then “-dpi 120” could be too much. Reduce it to meet your needs. And I’m also aware of the fact, dbus isn’t working at the moment. But hopefully in future it will – so I’m already prepared 🙂
In order to pin it to the Start menu, you need to rename “.bat” into “.exe” (no joke!). Else, you can’t pin it to the Start (bug?). After you pinned it to start, you can rename your batch-file again back to “.bat”. Please also adjust the “.bat” extention in the properties of the created link. You can find it by right click –> More –> “Open file location” (see screenshot).
- If you like to change the icon, you can download this one here (it’s the one at the very top left in this blog post). So your Start menu would look more or less like the screenshot on the right. I called my batch script “xs” btw.
- By starting the Xserver you will come up with lxpanel und a grey background. If you click the right mouse button and a menu appears – all went well.
This whole stuff is actually working that well, I quit using putty. Working on remote machines with X is also working very good. Just perform an “
xhost +” on your local system and on the remote one “
export DISPLAY=<your host here>:.0.0“