* This File : howto_WSL.txt * Rev : 2.2 * Date : 05/19/2022 * *************************************************************************** VERY VERY IMPORTANT NOTE - (this takes getting used to) To Copy text in a Debian Terminal : Highlight with Mouse, then hit the Enter Key To Paste text in a Debian Terminal : Right-Click Mouse * *************************************************************************** * *************************************************************************** 1. Install VcXsrv * *************************************************************************** https://sourceforge.net/projects/vcxsrv/ https://sourceforge.net/projects/vcxsrv/files/latest/download (42.9 MB) 64.1.20.14.0 When you run it, select : Multiple-Windows Start-No-Client Disable-access-control * *************************************************************************** * *************************************************************************** 2. Install WSL * *************************************************************************** 1. open a powershell as admin 2. wsl --list --online 3. wsl --install -d Debian (reboot if needed) (make sure connected to internet) 4. setup wsl2 user and passwd as prompted (if not prompted then : * open a power shell as admin * wsl --list --verbose * wsl --list --online * wsl --install -d Debian ) (to remove a distribution : * wsl --unregister Debian ) 5. In the debian window that pops up add user and passwd 6. Open a powershell (if you don't already have one from step 4) * wsl --list --verbose (you should see the version you installed now) 7. Open a new debian window sudo ls sudo apt-get update sudo apt-get install vim sudo apt-get install xterm sudo apt-get install gcc make perl sudo apt-get install xfstt xfonts-base xfonts-utils xfonts-100dpi xfonts-75dpi sudo apt-get install imagemagick sudo apt-get install gnuplot-x11 sudo apt-get install python-tk python3-tk python3-pip sudo apt-get install maxima xmaxima octave octave-signal sudo apt-get install rlwrap sudo apt-get install openssh-client sudo apt-get install x11-apps x11-utils xbitmaps sudo apt-get install fig2dev epstool sudo apt-get install git sudo apt-get install zip 8. Install python pip3 packages sudo pip3 install matplotlib sudo pip3 install scipy 9. Create bash settings file (make sure to replace "yourname" with your Windows USERNAME) nano .bash_aliases * 888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 #!/bin/bash export TBOX=/tbox export DD=/mnt/c/Users/yourname/DD export DD_DOS="C:/Users/yourname/DD" export HOST_IP=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}') PATH=.:$HOME/bin:$TBOX/bin:$DD/bin:$PATH alias lls='ls -alrt' alias ll='ls -l' alias llm='ls -l | more' alias lct='cut -c -120' alias mypath="echo \$PATH | sed -e 's/:/\n/g'" export DISPLAY=$HOST_IP:0 * 888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 8. Create .vimrc nano .vimrc * 888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 set viminfo= :highlight Visual cterm=reverse ctermbg=NONE * 888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 9. Create $DD/bin cd /mnt/c/Users/yourname mkdir DD cd DD mkdir bin 10. Create /tbox (make sure to replace "greg" with your WSL username) cd / sudo mkdir tbox sudo chown greg:greg tbox * *************************************************************************** ~$ nano hello.c ~$ gcc hello.c -lm -o hello.exe ~$ hello.exe * 888888888888888888888888888888888888 Begin hello.c 888888888888888888888888888888888888 #include #include int main(int argc, char **argv) { double yval; printf("\n"); printf("Hello World!\n"); printf("\n"); yval = 4.0 * atan(1.0); printf("\n"); printf("PI = %0.12f\n", yval); printf("\n"); } * 888888888888888888888888888888888888 End hello.c 888888888888888888888888888888888888 (make sure you have startied VcXsrv) ~$ nano convert3.py ~$ chmod ugo+x convert3.py ~$ convert3.py * 888888888888888888888888888888888888 Begin convert3.py 88888888888888888888888888888888 #!/usr/bin/env python3 import tkinter as tk def calculate(*args): try: value = float(feet.get()) meters.set((0.3048 * value * 10000.0 + 0.5)/10000.0) except ValueError: pass root = tk.Tk() root.title("Feet to Meters") mainframe = tk.Frame(root) mainframe.grid(column=0, row=0) mainframe.columnconfigure(0, weight=1) mainframe.rowconfigure(0, weight=1) feet = tk.StringVar() meters = tk.StringVar() feet_entry = tk.Entry(mainframe, width=7, textvariable=feet) feet_entry.grid(column=2, row=1) tk.Label(mainframe, textvariable=meters).grid(column=2, row=2) tk.Button(mainframe, text="Calculate", command=calculate).grid(column=3, row=3) tk.Label(mainframe, text="feet").grid(column=3, row=1) tk.Label(mainframe, text="is equivalent to").grid(column=1, row=2) tk.Label(mainframe, text="meters").grid(column=3, row=2) feet_entry.focus() root.bind('', calculate) root.mainloop() * 888888888888888888888888888888888888 End convert3.py 88888888888888888888888888888888