X meets Windows

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 (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:

  1. Aktivate Windows Subsystem for Linux. See here how to do it.
  2. Open a bash session (Windows-key + R –> bash + Enter  –   or type in a CMD-command line “bash”.
  3. install openbox and lxpanel
    $ apt install openbox lxpanel menu dbus-x11 lxterminal
    Note: google-chrome or chromium-browser don’t work with this realese of WSL yet. No need to try out this atm.
  4. Create the file Xstart.bat in 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 🙂

  5. 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).
  6. 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.
  7. 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

Leave a Reply

Your email address will not be published. Required fields are marked *