In WSL bash you can access Windows directories/files.
In Windows you cannot access WSL bash local directories/files (e.g.: ~/). Therefore all GBS directories/files must be placed at a location accessible by Windows.
e.g.: MyDocuments or D:\Work
Install GBS on Windows
Before starting GBS on WSL you need to install it under windows.
GBS will use the same physical installation for both Windows and WSL.
So you need to install Perl AND GBS under Windows.
For more info on installing Perl and GBS look below.
Open PowerShell as Administrator and run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
This may take a while...
Select an X server. E.g.:
XmingandXming fonts
GBS was tested with Xming.
Download & Install both
Add export DISPLAY=localhost:0.0 to your ~/.bashrc file
Use an editor (gedit/vim) or enter
echo 'export DISPLAY=localhost:0.0' >> ~/.bashrc
Mind the double >> !!!
Install commands using X server
gedit
Enter: sudo apt install gedit (takes a long time, especially at 10%)
On some Linux distributions some necessary bash commands are not installed.
xterm
Open a 'Terminal'
Note: A 'Terminal' is not always an xterm
To try: enter xterm -h
To install: enter sudo apt install xterm
at
Open a 'Terminal'
To try: enter at -h
To install: enter sudo apt install at
Make sure the atd daemon runs: enter sudo atd
Install Perl
GBS is based on Perl-scripts.
Perl must be installed and the perl command must be either in the PATH or
specified via an Environment-Variable (GBS_PERL_PATH). You need at least Perl version 5.16.3
If Perl (or the proper Perl version) is not in the PATH, define an environment
variable GBS_PERL_PATH
to point to the top-level directory where the proper Perl is installed.
e.g.: export GBS_PERL_PATH=/opt/ActivePerl-5.26
Note:
There is a bug in core Perl on Windows that doesn't set up @INC correctly if Perl is installed into a directory that starts
with the letter '5'.
Your problem should go away if you install into something like C:\MyPrograms\perl\v5.10 instead.
This bug is at least 10 years old and somewhat related to finding additional site_lib directories when you are using the
versioned directory layout scheme where multiple Perl versions share site_lib directories.
Found in Perl Monks
Install GBS
Pre-Installed
If GBS is pre-installed (local or on a network drive) your GBS Administrator
will be able to tell you where GBS is installed.
You will then only need to do the Setup as explained below.
Where to Install
Several versions of GBS can be installed in a GBS_SCRIPTS_ROOT directory.
They are installed using the Hard versioned directories method.
The latest build of a version is always installed under the plain directory. E.g: 2.02
This is called the Current Build of a version. It will be overwritten with every install of the same version.
Specific Builds are installed under version_build directory. E.g.:
GBS can be installed in two ways:
Single User:
GBS will be installed in your environment.
Setup (make this version current) is optional.
A Local Shortcut will be created to run the Setup.
Multi User:
GBS will be installed in a System area or on another global accessible location (E.g.: network drive).
A System Shortcut will be created for indvidual users to Setup this version.
Elevated privileges are required. (Linux: sudo -E, Windows: Run as Administrator).
If GBS is pre-installed (local or on a network drive) you will then only need to do the
Setup as explained below.
The Install scripts only installs GBS (possibly on a central location).
To be able to use GBS, each user must 'Setup' GBS as explained below.
This tells GBS which of the version to use.
During the Install you have the option to execute the setup immediately after the install.
Prerequisites:
Perl must be installed and the perl command must be either in the PATH or
specified via an Environment-Variable (GBS_PERL_PATH).
Decide where GBS will be installed (GBS_SCRIPTS_ROOT)
GBS will provide some nice defaults, but you can also specify you own location
Unzip the file to a new/empty temporary directory (NOT where you want to install GBS)
cd to this directory (In the Navigator - if available)
On Windows, from the Windows Explorer:
Run Install.bat (Single-User) or
Run Install.bat as Administrator (Multi-User)
On Linux:
If in the Navigator: Open a terminal in the current directory
Set the properties of Install.sh to executable: chmod u+x Install.sh
Enter: ./Install.sh (Single-User) or sudo -E ./Install.sh (Multi-User) Note the -E!
Answer the questions.
For most questions you can assume the default. (between [])
When done, do not forget to cleanup the temporary unzip directory
After the Install there wil be:
A 'Setup GBS [version]' shortcut on your Desktop and in System Programs
An 'unzipgbs.bat' or 'unzipgbs.sh' on your Desktop.
You can copy this file to your GBS Download parent directory and use it in the future to unzip and install GBS
Notes:
Subsequent installs can be run with -q flag (quiet).
This will run the script without human intervention assuming all defaults to be correct.
Setup
General
To setup GBS:
[ Inquire at your GBS Administrator where GBS is installed. ]
Open Windows Explorer (Windows) or XTerm (Linux)
Navigate to the directory where the wanted GBS-version is installed.
e.g.: Q:\Tools\gbs\2.02
Execute: _gbssetup.bat (Windows) (Mind the '_'!) or . _gbssetup.sh (Linux) (Mind the dot, the space and the '_'!)
Answer the questions.
- Possible values are between ( )
- Default value is between [ ]
- Enter ! to quit processing safely
What happens on Windows:
Some internal stuff is setup
A GBS Startup and a GBS Help shortcut are placed on your Desktop and in the 'All Programs' menu.
What happens on Linux:
Some internal stuff is setup
Your ENV-file(s) (~/.bashrc and/or ~/bash_aliases) are updated to contain some GBS Startup stuff
On systems with a GUI (e.g. GNOME or KDE) a GBS Startup and a GBS Help shortcut are placed on your Desktop
and in the 'All Programs' menu.