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 *AlamLinux 9* application
In *MobaXterm* go to Setting->X11->X11 remote access and choose "full",
then in Section choose WSL and coose "AlamLinux 9" distribution.
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
wls machines running the same Linux distribution.
You can follow the instructions in the [Install Geant4 on AlamaLinux](Linux Installation/AlmaLinux 9 Installation) section to install Geant4 and ROOT on WLS Ubuntu 20.04.
### Test you installation. ###
To test you installation you can use the procedure described in [Install Geant4 on Ubuntu](Ubuntu Installation).
## Installing and run Geant4 VM in Windows Machine
You can use VirtualBox WM if your Windows 10 version is older
than 1903 or if you do not use Windows Hyper-V or WSL2 on you Widows system.
After the introduction of WSL2 in Windows 10, Version 1903, Build 18362 or higher,
VirtualBox become unstable (memory corruptions, disk IO problems) with WSL (hyper-v)
enabled. In this case you need to use WSL or to create a virtual machine in Windows Hyper-V supervisor. See the next section.
If you choose the VirtualBox VM installation, please follow the instruction in the [VirtualBox VM](VBox Installation) section.
### Windows SSH Clients
To use the ssh connection to VM you need to install an ssh client capable of X11 forwarding like [PuTTY](http://www.putty.org) or to use Windows 10 ssh.
We use ssh from the Windows Git installation.
`ssh -X -p 2222 vagrant@localhost`
You can define the ssh session to localhost port 2222 in **MobaXterm**.
## Installing Geant4 VM on Windows Hyper-V ##
As the Hyper-V is not able to install the .ova machine, you need to convert the .ova disk file to the hyper-v .vhd format. We have tried this way but finished with VM without a network connection,
the network driver in hyper-v and VirtualBox were not the same.
Fortunately Hyper-V Quick Create allows us to create Ubuntu 20.04 VM.
It needs to download 2 Gb os installation image, but you will have a running VM
in a few minutes.
### Enable Hyper-V
Follow the Microsoft instructions to enable Hyper-V
* Start _Hyper-V Quick Create_ from _"Windows Administrative Tools"_ menu.
* Choose "Ubuntu 20.04 LTS" and click Create Machine.
* Choose "Edit Settings"
* Change name of machine if you want.
* You need disk size >= 20 Gb. You can extend root partition or create second disk and mount it on `/usr/local`
* Click ok to exit setting.
* Run machine with "Connect" and <start>
* Follow setup process
- language
- keyboard - use default or select what you have in Win machine
i use (US, euro on 5)
- Select Paris as timezone
- Crete account
### Install ROOT and Geant4 on Hyper-V VM
* run the machine and *connect* to it login to the machine
* First install sshd server and git on you machine.
```
$ apt update
$ apt upgrade -y
$ apt install -y openssh-server
$ apt install -y git git-man
```
You will also need curl
`$ apt install -y curl`
* When setup has finished, login to the machine and follow the instructions from the [Install Geant4 on Ubuntu](Ubuntu Installation) section to install Geant4 and ROOT.
Use `GIT_SSL_NO_VERIFY=true git clone https://llrgit.in2p3.fr/semenjuk/installg4`