Install Xserver on Windows side:
I will use chocolatey to install it but you may also download X server from the sourceforge page
Run this command in an administrator powershell prompt to install
1
choco install vcxsrv
In WSL Ubuntu, install the cool-retro-term
package using apt
:
1
sudo apt install cool-retro-term
Add this to your .bashrc
file so WSL knows the address of the Xserver
I found this method to set DISPLAY
to be the most robust as it works even when your .wslconf
doesn’t have generateResolvConf=true
and when you are using a custom DNS server. The previous method I was using to set DISPLAY
would use the wrong address with my setup.
1
export DISPLAY=$(ip route list default | awk '{print $3}'):0
Now when you run cool-retro-term
you should get a window!
Making a shortcut to start cool-retro-term
is annoying since if you try to run it directly from a commandline in Windows, you will likely get this error (I also get this error when specifying the DISPLAY
parameter in the commandline):
1
2
3
4
5
6
7
C:\Users\Peter>bash -c cool-retro-term
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
This will work, I think because it opens a login shell.
1
bash -c "bash --rcfile <(echo '. ~/.bashrc; cool-retro-term; exit')"
Now wrap it in a vbs
script to hide the cmd.exe
window from appearing:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "%comspec% /c start /B """" bash -c ""bash --rcfile <(echo '. ~/.bashrc; cool-retro-term -p DEFAULT_PROFILE; exit')""", 0 'Hide
And call this from a shortcut’s target field:
1
C:\Windows\System32\wscript.exe "C:\YOUR_PATH_HERE\cool-retro-term.vbs"
Congratulations, when you click the shortcut you should get a cool-retro-term window without any other windows being spawned!