Q. TSE: Linux: Watcom: How to install Open WatCom version 2.x on Linux WSL Ubuntu?
Hello,
FYI:
Given: TSE for Linux itself is where applicable compiled (only) with Open WatCom 2.x.
Note: When facing selection choices they must be WatCom 2.x 32 bit compatible, because TSE for Linux is 32 bits
===
You can find the downloadable WatCom 2.x versions at this URL:
There choose a release
(Note: I chose the latest release from January 2026, because the older
version had some serious issues. Even with the latest WatCom
version very frequently 'segmentation fault' when compiling. It
showed that 'fflush()' in C was the culprit).
Use there such a file and download it.
ow-snapshot.tar.xz
===
Steps to install "Open Watcom C/C++ x86 32-bit Compile and Link Utility Version 2.0 beta"
1. -Run
cmd.exe
2. -Run
wsl
3. -Then inside Linux WSL Ubuntu
4. -Advice: Copy these steps #1, #2, #3, ... one after on the wsl
command prompt and await and view the result each time.
5. -Using these steps an installation takes typically a few minutes here
and the installation of WatCom 2.x was successful using these steps.
--- cut here: begin --------------------------------------------------
# 1) First set once your userid to sudo
sudo usermod -aG sudo $USER
# 2) Completely remove any previous Watcom installation: directories
sudo rm -rf /opt/watcom
sudo rm -rf /usr/watcom
sudo rm -rf /usr/local/watcom
sudo rm -rf ~/watcom
# 3) Completely remove any previous Watcom install: environment variables from the shell startup
sed -i '/WATCOM/d' ~/.bashrc ~/.profile ~/.bash_profile 2>/dev/null
# 4) Verify nothing Watcom-related remains:
which wcc wcc386 wcl wcl386 2>/dev/null
env | grep -i watcom
ls /opt | grep -i watcom
# 5) Go to a download folder
cd /tmp
# 6) First remove any existing ow-snapshot.tar.xz file, because otherwise they will be created with xz1, xz2, ... file extensions
rm /tmp/ow-snapshot.tar.*
# 7) Download the specific snapshot you want
#
# this is the Semware version from 2 August 2025
#
# Using the newest version from 11 January 2026
# 8) Install into /opt/watcom
sudo mkdir -p /opt/watcom
# 9) Extract it to /opt/watcom
sudo tar -xJf ow-snapshot.tar.xz -C /opt/watcom
# 10) Verify layout of /opt/watcom/ after the extraction
ls /opt/watcom
# 11) Add environment variables so you use 32-bit tools only
cat >> ~/.bashrc <<EOF
export WATCOM=/opt/watcom
export PATH="\$WATCOM/binl:\$PATH"
export INCLUDE="\$WATCOM/h"
export LIBPATH="\$WATCOM/lib386/linux:\$WATCOM/lib386"
EOF
# 12) Reload your shell config
# Also update current shell OR start new shell
exec bash
source ~/.bashrc
# 13) Install 32-bit libraries
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y libc6:i386 libstdc++6:i386
# 14) Verify correct binaries
which wcc wcl386
file $(which wcc)
file $(which wcl386)
# Expected result here = ELF 32-bit LSB executable, Intel 80386
# 15) Remove any old hello files
rm /tmp/hello.*
# 16) Build & run a real test (the important part)
cat > hello.c <<'EOF'
#include <stdio.h>
int main(void) {
char buf[10];
puts("Hello Open Watcom v2 (32-bit) on WSL");
printf("Type something: ");
if (fgets(buf, sizeof(buf), stdin)) {
printf("You typed: %s", buf);
}
return 0;
}
EOF
# compile it
wcl386 hello.c
# run it
./hello
# Expected output: # "Hello Open Watcom v2 (32-bit) on WSL"
--- cut here: end ----------------------------------------------------