|
|
|
# Geant4 Installation on Windows 11 WSL2 running AlmaLinux 9
|
|
|
|
|
|
|
|
Hire we do not give the instructions for native Geant4 installation with the Visual Studio C++ compiler on Windows.
|
|
|
|
|
|
|
|
We expalin how install Geant4 in Windows Subsystem for Linux (WSL) machine.
|
|
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
## Installing WSL in Windows 11
|
|
|
|
|
|
|
|
WSL2 uses virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). Linux distributions run as isolated containers inside of the WSL2 managed VM.
|
|
|
|
|
|
|
|
We have chosen to install AlmaLinux 9 for our purpose.
|
|
|
|
|
|
|
|
The WSL intallation instruction can be found on [AlamLinux Wiki](https://wiki.almalinux.org/documentation/wsl.html)
|
|
|
|
|
|
|
|
1. Visit https://docs.microsoft.com/en-us/windows/wsl/install
|
|
|
|
for detailed instructions how to enable WSL or WSL 2.
|
|
|
|
|
|
|
|
2. Install your Linux distribution, we made the tests with _AlamaLinux 9_
|
|
|
|
|
|
|
|
* Open "Microsoft Store" and search AlamaLinux.
|
|
|
|
|
|
|
|
* Choose Ubuntu AlamaLinux 9 and install it on the Windows Machine.
|
|
|
|
|
|
|
|
* Launch newly installed Linux
|
|
|
|
|
|
|
|
* You will then need to create a user account and password for your new Linux distribution
|
|
|
|
|
|
|
|
### X11 server for Windows or building WSLg server
|
|
|
|
|
|
|
|
The latest version of Windows 10 and Windows 11 has WSLg code
|
|
|
|
fully integrated to WSL2. **No separate X11 server was necessary.**
|
|
|
|
|
|
|
|
See: _https://github.com/microsoft/wslg_ for more info
|
|
|
|
|
|
|
|
Follow the instruction from this link to use building WSLg server"
|
|
|
|
_https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps_
|
|
|
|
|
|
|
|
But you can configure and use external X11 server with WSL.
|
|
|
|
|
|
|
|
There are several servers like Xmind or Cygwin/X
|
|
|
|
http://www.straightrunning.com/XmingNotes/
|
|
|
|
https://x.cygwin.com/
|
|
|
|
|
|
|
|
We made tests with _XcXsrv_ and AlmaLinux 9 application window
|
|
|
|
|
|
|
|
https://sourceforge.net/projects/vcxsrv/
|
|
|
|
|
|
|
|
We also tested _Mobaterm MobaXterm_
|
|
|
|
https://mobaxterm.mobatek.net/
|
|
|
|
which provides both X11 server and terminal client with ssh.
|
|
|
|
|
|
|
|
*N.B. The corresponded driver which support OpenGL should be installed on Windows machine
|
|
|
|
or you will be not able to use Geant4 graphics.*
|
|
|
|
|
|
|
|
#### X11 DISPLAY settings.
|
|
|
|
|
|
|
|
After starting X11 server you can use
|
|
|
|
`export DISPLAY=localhost:0.0` in WSL1,
|
|
|
|
but in WSL2 microsoft has made a modification in the network which
|
|
|
|
prevent Windows <-> WSL routing.
|
|
|
|
The only way is to use the X11 server for Windows : Disable access control in X11 server and use the default router (local IP address of Windows machine) for display settings.
|
|
|
|
|
|
|
|
If you use *Xcxsrv* you will see the option Disable access control
|
|
|
|
when you launch the server using *Xlaunch*, then start *AlmaLinux 9* application
|
|
|
|
|
|
|
|
In *MobaXterm* go to Setting->X11->X11 remote access and choose "full",
|
|
|
|
then in Section choose WSL and choose "AlmaLinux 9" distribution.
|
|
|
|
|
|
|
|
On WSL2 use the command:
|
|
|
|
`export DISPLAY=`ip route | awk '/default/ {print $3; exit}'`:0.0`
|
|
|
|
to setup display.
|
|
|
|
|
|
|
|
You can do a quick test of *X11* by running `xev` and `glxgear` applications
|
|
|
|
|
|
|
|
|
|
|
|
### Installing Geant4 and Root on WSL
|
|
|
|
|
|
|
|
The big advantage of WSL installation, the WSL applications are binary compatible with application which you can run on the same Linux installed on physical computer. You can copy the applications/libraries between physical machines and
|
|
|
|
WSL machines running the same Linux distribution.
|
|
|
|
|
|
|
|
Make sure you has **"Server with GUI"** installed in you VM.
|
|
|
|
|
|
|
|
```
|
|
|
|
dnf clean all
|
|
|
|
dnf -y update
|
|
|
|
dnf -y groupinstall "Server with GUI"
|
|
|
|
```
|
|
|
|
|
|
|
|
Now you can follow the instructions in the [Install Geant4 on AlamaLinux](Linux Installation/AlmaLinux 9 Installation) section to install Geant4 and ROOT on WLS AlmaLinux 9.
|
|
|
|
|
|
|
|
### Test you installation. ###
|
|
|
|
|
|
|
|
To test you installation you can follow the procedure described in [Install Geant4 on AlamaLinux](Linux Installation/AlmaLinux 9 Installation).
|
|
|
|
|
|
|
|
## Tips ##
|
|
|
|
|
|
|
|
- WLS 2
|
|
|
|
- If you already running WSL do not forget updaet you Windows installation and update wsl via: `wsl --update`.
|
|
|
|
|
|
|
|
- Use the command
|
|
|
|
export DISPLAY=`ip route | awk '/default/ {print $3; exit}'`:0.0
|
|
|
|
to setup display. If you use **MobaXTerm** or other external X11 server
|
|
|
|
|
|
|
|
- All environment variables related to language
|
|
|
|
(LANGUAGE, LANG, LC_* ) are set to C.UTF-8 on wsl machine.
|
|
|
|
If you see the warnings when connect to another machine via ssh,
|
|
|
|
use f.e. : export LC_ALL=en_US.UTF-8
|
|
|
|
|
|
|
|
- WSL port forwarding
|
|
|
|
https://gist.github.com/estsaon/b27452c3ba105c369a5d7c9b1f10c6e7
|
|
|
|
|
|
|
|
- Geant4
|
|
|
|
- You check the Geant4 datasets installation using the command:
|
|
|
|
`geant4-config --check-datasets`
|
|
|
|
- `geant4-config --help` also shows the Geant4 features (configuration options)
|
|
|
|
|
|
|
|
Visit Geant4 installation Guide for more info:
|
|
|
|
http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/
|
|
|
|
|
|
|
|
- zsh on vm
|
|
|
|
- If you use zsh you need to use .zprofile instead of .bash_profile
|
|
|
|
- Use *source* not a *.* to source setup scripts
|
|
|
|
|
|
|
|
# Geant4 Installation on Windows 11 WSL2 running AlmaLinux 9
|
|
|
|
|
|
|
|
Hire we do not give the instructions for native Geant4 installation with the Visual Studio C++ compiler on Windows.
|
|
|
|
|
|
|
|
We expalin how install Geant4 in Windows Subsystem for Linux (WSL) machine.
|
|
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
## Installing WSL in Windows 11
|
|
|
|
|
|
|
|
WSL2 uses virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). Linux distributions run as isolated containers inside of the WSL2 managed VM.
|
|
|
|
|
|
|
|
We have chosen to install AlmaLinux 9 for our purpose.
|
|
|
|
|
|
|
|
The WSL intallation instruction can be found on [AlamLinux Wiki](https://wiki.almalinux.org/documentation/wsl.html)
|
|
|
|
|
|
|
|
1. Visit https://docs.microsoft.com/en-us/windows/wsl/install
|
|
|
|
for detailed instructions how to enable WSL or WSL 2.
|
|
|
|
|
|
|
|
2. Install your Linux distribution, we made the tests with _AlamaLinux 9_
|
|
|
|
|
|
|
|
* Open "Microsoft Store" and search AlamaLinux.
|
|
|
|
|
|
|
|
* Choose Ubuntu AlamaLinux 9 and install it on the Windows Machine.
|
|
|
|
|
|
|
|
* Launch newly installed Linux
|
|
|
|
|
|
|
|
* You will then need to create a user account and password for your new Linux distribution
|
|
|
|
|
|
|
|
### X11 server for Windows or building WSLg server
|
|
|
|
|
|
|
|
The latest version of Windows 10 and Windows 11 has WSLg code
|
|
|
|
fully integrated to WSL2. **No separate X11 server was necessary.**
|
|
|
|
|
|
|
|
See: _https://github.com/microsoft/wslg_ for more info
|
|
|
|
|
|
|
|
Follow the instruction from this link to use building WSLg server"
|
|
|
|
_https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps_
|
|
|
|
|
|
|
|
But you can configure and use external X11 server with WSL.
|
|
|
|
|
|
|
|
There are several servers like Xmind or Cygwin/X
|
|
|
|
http://www.straightrunning.com/XmingNotes/
|
|
|
|
https://x.cygwin.com/
|
|
|
|
|
|
|
|
We made tests with _XcXsrv_ and AlmaLinux 9 application window
|
|
|
|
|
|
|
|
https://sourceforge.net/projects/vcxsrv/
|
|
|
|
|
|
|
|
We also tested _Mobaterm MobaXterm_
|
|
|
|
https://mobaxterm.mobatek.net/
|
|
|
|
which provides both X11 server and terminal client with ssh.
|
|
|
|
|
|
|
|
*N.B. The corresponded driver which support OpenGL should be installed on Windows machine
|
|
|
|
or you will be not able to use Geant4 graphics.*
|
|
|
|
|
|
|
|
#### X11 DISPLAY settings.
|
|
|
|
|
|
|
|
After starting X11 server you can use
|
|
|
|
`export DISPLAY=localhost:0.0` in WSL1,
|
|
|
|
but in WSL2 microsoft has made a modification in the network which
|
|
|
|
prevent Windows <-> WSL routing.
|
|
|
|
The only way is to use the X11 server for Windows : Disable access control in X11 server and use the default router (local IP address of Windows machine) for display settings.
|
|
|
|
|
|
|
|
If you use *Xcxsrv* you will see the option Disable access control
|
|
|
|
when you launch the server using *Xlaunch*, then start *AlmaLinux 9* application
|
|
|
|
|
|
|
|
In *MobaXterm* go to Setting->X11->X11 remote access and choose "full",
|
|
|
|
then in Section choose WSL and choose "AlmaLinux 9" distribution.
|
|
|
|
|
|
|
|
On WSL2 use the command:
|
|
|
|
`export DISPLAY=`ip route | awk '/default/ {print $3; exit}'`:0.0`
|
|
|
|
to setup display.
|
|
|
|
|
|
|
|
You can do a quick test of *X11* by running `xev` and `glxgear` applications
|
|
|
|
|
|
|
|
|
|
|
|
### Installing Geant4 and Root on WSL
|
|
|
|
|
|
|
|
The big advantage of WSL installation, the WSL applications are binary compatible with application which you can run on the same Linux installed on physical computer. You can copy the applications/libraries between physical machines and
|
|
|
|
WSL machines running the same Linux distribution.
|
|
|
|
|
|
|
|
Make sure you has **"Server with GUI"** installed in you VM.
|
|
|
|
|
|
|
|
```
|
|
|
|
dnf clean all
|
|
|
|
dnf -y update
|
|
|
|
dnf -y groupinstall "Server with GUI"
|
|
|
|
```
|
|
|
|
|
|
|
|
Now you can follow the instructions in the [Install Geant4 on AlamaLinux](Linux Installation/AlmaLinux 9 Installation) section to install Geant4 and ROOT on WLS AlmaLinux 9.
|
|
|
|
|
|
|
|
### Test you installation. ###
|
|
|
|
|
|
|
|
To test you installation you can follow the procedure described in [Install Geant4 on AlamaLinux](Linux Installation/AlmaLinux 9 Installation).
|
|
|
|
|
|
|
|
## Tips ##
|
|
|
|
|
|
|
|
- WLS 2
|
|
|
|
- If you already running WSL do not forget updaet you Windows installation and update wsl via: `wsl --update`.
|
|
|
|
|
|
|
|
- Use the command
|
|
|
|
export DISPLAY=`ip route | awk '/default/ {print $3; exit}'`:0.0
|
|
|
|
to setup display. If you use **MobaXTerm** or other external X11 server
|
|
|
|
|
|
|
|
- All environment variables related to language
|
|
|
|
(LANGUAGE, LANG, LC_* ) are set to C.UTF-8 on wsl machine.
|
|
|
|
If you see the warnings when connect to another machine via ssh,
|
|
|
|
use f.e. : export LC_ALL=en_US.UTF-8
|
|
|
|
<!--
|
|
|
|
- WSL port forwarding
|
|
|
|
https://gist.github.com/estsaon/b27452c3ba105c369a5d7c9b1f10c6e7
|
|
|
|
-->
|
|
|
|
|
|
|
|
- Geant4
|
|
|
|
- You check the Geant4 datasets installation using the command:
|
|
|
|
`geant4-config --check-datasets`
|
|
|
|
- `geant4-config --help` also shows the Geant4 features (configuration options)
|
|
|
|
|
|
|
|
Visit Geant4 installation Guide for more info:
|
|
|
|
http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/
|
|
|
|
|
|
|
|
- zsh on vm
|
|
|
|
- If you use zsh you need to use .zprofile instead of .bash_profile
|
|
|
|
- Use *source* not a *.* to source setup scripts
|
|
|
|
|