Skip to content

Instantly share code, notes, and snippets.

@h3r
Last active March 7, 2024 17:55
Show Gist options
  • Star 68 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save h3r/2d5dcb2f64cf34b6f7fdad85c57c1a45 to your computer and use it in GitHub Desktop.
Save h3r/2d5dcb2f64cf34b6f7fdad85c57c1a45 to your computer and use it in GitHub Desktop.

Installing Cool-Retro-Term on Windows10

First of all, this document is just a recompilation of different resources that already existed on the web previously that I personally tested some ones did work and other not. I liked the idea to make a full guide from start to end so all of you could also enjoy playing with cool-retro-term on windows 10. Personally I installed it on a windows 10 pro version. Fingers crossed!

result

Briefly, we are going to:

1- enable linux subsystem on windows 10 2- clone and compile cool-retro-term git source 3- connect to windows 4- package all execution under a custom made exe file using windows internal tools 5- edit our fancy exe to have its own icon


STEP 1 - Enable Linux Subsystem WLS on Windows 10

The first thing you should do is enabling developer mode. To get there:

  • Press windows key > type "Windows update and settings" > hit Enter

  • Click on "For Developers" tab on the left panel

  • Choose "Developer mode"

  • Restart if prompted

  • Press windows key > type "Power Shell" > right click > click on "Run as Administrator"

  • Copy-paste this on powershell:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Install your distro of choice (I've only tested with ubuntu).

    View of Linux distros in the Windows store

After the whole installation finishes, go and press windows + r > type "bash" and hit enter. It will open a native full linux shell. The first time you open bash, the system will prompt a series of config parameters as user and password.


STEP 2 - Getting Cool-Retro-Term

If I remember properly, git was already installed, if not type:

sudo apt-get install git

Next, lets get to work. If you have any problem check the official repository guide

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install qtchooser qt5-default qml-module-qtquick-controls qml-module-qtquick-dialogs qml-module-qtquick-localstorage build-essential qtdeclarative5-dev

git clone --recursive https://github.com/Swordfish90/cool-retro-term.git

cd cool-retro-term
qmake && make
cd ..

sudo mv cool-retro-term /opt/cool-retro-term
sudo ln -s /opt/cool-retro-term/cool-retro-term /usr/sbin/cool-retro-term

If all did go as intended and no dependency failed to install you should have now cool-retro-term properly installed as a direct command.

export DISPLAY=localhost:0 cool-retro-term &


STEP 3 - Connecting seamlessly to Windows 10

The problem right now is that we installed a console version of ubuntu and it does not have a way to display graphical guis so we are going to bypass this to windows using Xming-server. Download it from here.

After installing, execute xming server and we just need the last step, to tell ubuntu to use Xming.

    export DISPLAY=localhost:0.0
    cool-retro-term &

If you are ok like this you could do win+r > bash > type "cool-retro-term" and will open the retro term on windows.

STEP 4 - Packaging

Personally I liked the idea of having all done within a single doubleclick,without console on the background and without having to manually open xming server every time.

We are going to open windows+r>bash create a script somewhere of your preference (I called it "crt.sh" and placed on a scripts folder on my home directory)

sudo nano crt.sh

Fill it with:

#!/bin/bash
export DISPLAY=localhost:0.0
cool-retro-term

This launches our retro term linking to xming window server. Now we are going to call this script from windows. Create a new notepad file, type the following text changing the path where you placed the sh script and save with extension ".bat" i.e.: "crt.bat"

@echo off
xming :0 -clipboard -multiwindow
start /B "" "C:\Windows\System32\bash.exe" -c "sh /home/h3r/scripts/crt.sh"

Now this launches xming silently and runs the terminal but still opens a console on the background. What I did found is, there is a windows application called iexpress that lets you package scripts, unpackage, run install scripts, etc... we are going to use this tool to execute our bat file every time we click on it.

press windows key > type "iexpress" > right click and "run as administrator"

this will pop a wizard to configure our executable. Follow as:

  • Create new Self Extraction Directive file
  • Extract files and run an installation command
  • Type some cool title like "cool-retro-term"
  • No promt
  • Do not display a license
  • Add > include our .bat file

  • THIS IS AN IMPORTANT STEP: on "Install Program" type cmd /c youtbatfilename.bat

  • Hidden

  • No Message

  • browse and type your executable final name , AND check the option "Hide File Extracting Progress Animation from the User"

  • No Restart

  • Choose or not to save SED file, its a configuration file if you don't want to repeat the whole process again in case you did type something wrong. AND THAT'S IT!


STEP 5 - Edit our fancy exe to have its own icon

Well, this is the first and the fastest solution I did found on the internet, it literally taken me about 30 seconds to have the new icons working.

  • Download Resource Hacker & Open. The webpage style really scares but the software is simple and functional.
  • File > Open : choose your recently created executable
  • Open the icon folder, just select one
  • Go to Action > Replace Icon > Open file with new icon : choose a new icon

Additional! Web Tool to convert .png to .ico

Some icon pngs from Xodetaetl


AND THATS ALL!

I personally had to restart to see the new icon. I hope you had no troubles going through this guide. If you like, you can share a beer with me using PayPal ;). Donate

@uberfrosty
Copy link

I know this is a basic question, but how do I revert system state or redo the compile of coolretroterm so that I can compile again under different conditions?
Ok running into problem launching last step when running export command
I get this output;

qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abrecoil'
QQmlApplicationEngine failed to load component
qrc:/main.qml:137 Type TerminalContainer unavailable
qrc:/TerminalContainer.qml:23 Type PreprocessedTerminal unavailable
qrc:/PreprocessedTerminal.qml:24 module "QMLTermWidget" is not installed

Cannot load QML interface

I tried running both commands mentioned by ifatuus but this does not change the situation.
Running on Windows 10
Any hints?

Did you resolve this? Getting the same error

nope I've given up and moved on. If you find a solution let us know.

I was able to resolve this error with the aid of this article https://medium.com/javarevisited/using-wsl-2-with-x-server-linux-on-windows-a372263533c3, with a few tweaks:

Instead of running "Terminator" I run the Cool-Retro-Term AppImage. The command is: DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 ./Cool-Retro-Term-1.1.1-x86_64.AppImage
I could not get it to work with vcxsrv, but it does work with Xming.

So, these were the steps I followed:

  1. Install Xming https://sourceforge.net/projects/xming/
  2. Start XLaunch, Multiple windows, "Start no client," then check "No Access Control"
  3. Launch linux distro to get a basic command line.
  4. Get a copy of Cool Retro Term and set permissions: wget https://github.com/Swordfish90/cool-retro-term/releases/download/1.1.1/Cool-Retro-Term-1.1.1-x86_64.AppImage
    chmod a+x Cool-Retro-Term-1.1.1-x86_64.AppImage
  5. Run this command: DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 ./Cool-Retro-Term-1.1.1-x86_64.AppImage

For me, this gets CRT working in an XServer window. I'm going to try downloading the source and building it to see if this command still works.

Hope this helps!

@Telamonic
Copy link

I know this is a basic question, but how do I revert system state or redo the compile of coolretroterm so that I can compile again under different conditions?
Ok running into problem launching last step when running export command
I get this output;

qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abrecoil'
QQmlApplicationEngine failed to load component
qrc:/main.qml:137 Type TerminalContainer unavailable
qrc:/TerminalContainer.qml:23 Type PreprocessedTerminal unavailable
qrc:/PreprocessedTerminal.qml:24 module "QMLTermWidget" is not installed

Cannot load QML interface

I tried running both commands mentioned by ifatuus but this does not change the situation.
Running on Windows 10
Any hints?

Did you resolve this? Getting the same error

nope I've given up and moved on. If you find a solution let us know.

I was able to resolve this error with the aid of this article https://medium.com/javarevisited/using-wsl-2-with-x-server-linux-on-windows-a372263533c3, with a few tweaks:

Instead of running "Terminator" I run the Cool-Retro-Term AppImage. The command is: DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 ./Cool-Retro-Term-1.1.1-x86_64.AppImage
I could not get it to work with vcxsrv, but it does work with Xming.

So, these were the steps I followed:

  1. Install Xming https://sourceforge.net/projects/xming/
  2. Start XLaunch, Multiple windows, "Start no client," then check "No Access Control"
  3. Launch linux distro to get a basic command line.
  4. Get a copy of Cool Retro Term and set permissions: wget https://github.com/Swordfish90/cool-retro-term/releases/download/1.1.1/Cool-Retro-Term-1.1.1-x86_64.AppImage
    chmod a+x Cool-Retro-Term-1.1.1-x86_64.AppImage
  5. Run this command: DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 ./Cool-Retro-Term-1.1.1-x86_64.AppImage

For me, this gets CRT working in an XServer window. I'm going to try downloading the source and building it to see if this command still works.

Hope this helps!

I kept getting a 'Cannot load QML interface' error when I tried your fix.
I've tried adding on the clause: '--appimage-extract-and-run' to the end of the display command, which ran the command, but I encountered an error: 'qxcbconnection: could not connect to display 192.168.1.254.0'

Any idea what could be causing this?

(sorry I'm completely new to this.)
Thanks!

@AlexAegis
Copy link

I would like to point out that in the future (Or even today if you are willing to join the Insider Dev Channel and update your Windows) WSLg, fresh mesa drivers in your WSL instance, and fresh divers (470+ in the case of nvidia, everything is documented in the WSlg repository)
You can run graphical linux programs on windows with GPU acceleration, including CRT.
Proof: Swordfish90/cool-retro-term#40 (comment)

No separate X server or any kind of convoluted configuration is involved (I did try this method successfully before, but without GPU acceleration it does not worth it.)

image

A quick tip: Don't use the Windows shortcut, for some reason as soon CRT opens it opens another, creating an infinite loop. In this case you can just kill WSL from an elevated powershell instance wsl --terminate <distro>. I start it from a command line like cool-retro-term & (If you know why it does an infinite loop, let me know)

@OrShazam
Copy link

OrShazam commented Jun 16, 2021

This only lets me use the Terminal in the Linux System right? I cant access the Files in the Windows installation?

Obviously you can, go to /mnt/ ,it got all the files on your computer accessible through the linux system.

@OrShazam
Copy link

Regarding step 2, I get this error " Option -module-qtquick-localstorage: Configuration item specification must have an =."

@CoderCowMoo
Copy link

I would like to point out that in the future (Or even today if you are willing to join the Insider Dev Channel and update your Windows) WSLg, fresh mesa drivers in your WSL instance, and fresh divers (470+ in the case of nvidia, everything is documented in the WSlg repository)
You can run graphical linux programs on windows with GPU acceleration, including CRT.
Proof: Swordfish90/cool-retro-term#40 (comment)

No separate X server or any kind of convoluted configuration is involved (I did try this method successfully before, but without GPU acceleration it does not worth it.)

image

A quick tip: Don't use the Windows shortcut, for some reason as soon CRT opens it opens another, creating an infinite loop. In this case you can just kill WSL from an elevated powershell instance wsl --terminate <distro>. I start it from a command line like cool-retro-term & (If you know why it does an infinite loop, let me know)

So how do I do this? Do I just run the app image? Or is it something like GUI Kali where you use remote desktop connect?

@AlbinSjoegren
Copy link

Small note: qt5-default is no longer part of debian 11 stable so yeah, just sayin...

@AlbinSjoegren
Copy link

AlbinSjoegren commented Nov 12, 2021

Got this error when running the second command in part 3:

albin@DESKTOP-DFU0NBL:~$ cool-retro-term &                                                                                                                              
[1] 997                                                                                                                                                                 
albin@DESKTOP-DFU0NBL:~$ cool-retro-term: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory              
^C                                                                                                                                                                     
[1]+  Exit 127                
cool-retro-term                                                                                                                          
albin@DESKTOP-DFU0NBL:~$ 

And I checked so I do have libqt5core5a
https://packages.debian.org/search?suite=jessie&arch=any&mode=exactfilename&searchon=contents&keywords=libQt5Core.so.5.3.2&sort_by=file

@AlexAegis
Copy link

The wslg repo that I linked before (https://github.com/microsoft/wslg) still gives you everything that you need to make it work. But just to update you, WSLg (sadly) is now only available for Windows 11. This just wont work under Windows 10.

@paulera
Copy link

paulera commented May 13, 2022

Got this error when running the second command in part 3:

albin@DESKTOP-DFU0NBL:~$ cool-retro-term &                                                                                                                              
[1] 997                                                                                                                                                                 
albin@DESKTOP-DFU0NBL:~$ cool-retro-term: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory              
^C                                                                                                                                                                     
[1]+  Exit 127                
cool-retro-term                                                                                                                          
albin@DESKTOP-DFU0NBL:~$ 

And I checked so I do have libqt5core5a https://packages.debian.org/search?suite=jessie&arch=any&mode=exactfilename&searchon=contents&keywords=libQt5Core.so.5.3.2&sort_by=file

In WSL1, do:
sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

Source: https://stackoverflow.com/questions/63627955/cant-load-shared-library-libqt5core-so-5

@obriat
Copy link

obriat commented Jul 6, 2022

Hi,
I had to install libgles2-mesa-dev and qtquickcontrols2-5-dev on debian to build the binary.
And I had to do the following tasks to run it :

sudo apt install qml-module-qtquick-controls2 qml-module-qt-labs-platform qml-module-qmltermwidget
export LIBGL_ALWAYS_INDIRECT=
export XDG_RUNTIME_DIR=/tmp/xdg_runtime
export RUNLEVEL=3

Start vcxsrv without support for OpenGL indirection

@zyxbest
Copy link

zyxbest commented Aug 17, 2022

I know this is a basic question, but how do I revert system state or redo the compile of coolretroterm so that I can compile again under different conditions?
Ok running into problem launching last step when running export command
I get this output;

qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abrecoil'
QQmlApplicationEngine failed to load component
qrc:/main.qml:137 Type TerminalContainer unavailable
qrc:/TerminalContainer.qml:23 Type PreprocessedTerminal unavailable
qrc:/PreprocessedTerminal.qml:24 module "QMLTermWidget" is not installed

Cannot load QML interface

I tried running both commands mentioned by ifatuus but this does not change the situation.
Running on Windows 10
Any hints?

Did you resolve this? Getting the same error

nope I've given up and moved on. If you find a solution let us know.

I was able to resolve this error with the aid of this article https://medium.com/javarevisited/using-wsl-2-with-x-server-linux-on-windows-a372263533c3, with a few tweaks:

Instead of running "Terminator" I run the Cool-Retro-Term AppImage. The command is: DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 ./Cool-Retro-Term-1.1.1-x86_64.AppImage I could not get it to work with vcxsrv, but it does work with Xming.

So, these were the steps I followed:

  1. Install Xming https://sourceforge.net/projects/xming/
  2. Start XLaunch, Multiple windows, "Start no client," then check "No Access Control"
  3. Launch linux distro to get a basic command line.
  4. Get a copy of Cool Retro Term and set permissions: wget https://github.com/Swordfish90/cool-retro-term/releases/download/1.1.1/Cool-Retro-Term-1.1.1-x86_64.AppImage
    chmod a+x Cool-Retro-Term-1.1.1-x86_64.AppImage
  5. Run this command: DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 ./Cool-Retro-Term-1.1.1-x86_64.AppImage

For me, this gets CRT working in an XServer window. I'm going to try downloading the source and building it to see if this command still works.

Hope this helps!

This approach works for me, thank you so much!

@specifics
Copy link

specifics commented May 13, 2023

I got this working on Windows 10 (22H2). I built from source because it made more sense to me as someone who isn't a Linux user, but the package install is probably easier, and you can pick up from the OP instructions starting at the sudo ln command.

  1. Follow the OP instructions to initialize Windows to run Linux, then go to Microsoft Store, search "Ubuntu" and download the 'plain' one without version numbers. Run and follow the initial setup instructions.
  2. Use the following command to install dependencies. Basically it's the same as the official CRT instructions, but qt5-default is replaced with qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools because qt5-default has been obsoleted, which results in this error.
sudo apt install build-essential qmlscene qt5-qmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qml-module-qtquick-controls2 qml-module-qtgraphicaleffects qml-module-qtquick-dialogs qml-module-qtquick-localstorage qml-module-qtquick-window2 qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qtquickcontrols2-5-dev
  1. Run strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 to avoid this error.
  2. From here, follow the OP instructions to clone and build from source, and run on Windows via Xming. For what it's worth, the Windows command prompt gives me the Xinput2 error but it still works without any further troubleshooting.
  3. Add Xming to the Windows PATH environment variable. This will prevent a command prompt from appearing telling you Xming is an unknown command, and is required to make the batch file work correctly.
  4. Bonus: Download Mechvibes to get keyboard sounds while typing, but it only seems to work when CRT is run as an application.

@zDCVincent
Copy link

I made a tutorial on how to get this working in 2023 on Windows 10 (Should work with W11 too)
https://github.com/zDCVincent/Cool-Retro-Term-For-Windows-2023-/tree/main

@RelativisticMechanic
Copy link

RelativisticMechanic commented Jul 24, 2023

Apologies for the shameless plug but you guys might be interested, 2 weeks back I came here to try it out but Qt simply wouldn't start and it just seemed sad that I couldn't run native Win32 console apps, inspired by this I created a Win32 app in OpenGL that tries to mimic cool-retro-term. It's not ready for release yet, but it runs most of the commands just fine (it can push itself to GitHub :P), but has slight glitches with apps like vim and totally breaksdown with advanced stuff like vfim. A major reason is its implemented from scratch so my ANSI escape sequence parser is not perfect. Another thing to keep in mind is its truly retro and uses a 256 character ASCII font extracted from a transparent PNG image, although that was more of my laziness in not adding TrueType.

https://github.com/RelativisticMechanic/CRTerm

@TheSupremeMonkey
Copy link

https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

If you are running the latest version of WSL you can now basically just do "sudo apt install cool-retro-term" and it will install and even put an icon on your start menu. No X server needed. I'm running under Debian but a lot of distros have binaries for this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment