|
|
# Geant4 Installation on Windows 10 WSL2
|
|
|
# running Ubuntu 20.04 TLS
|
|
|
# Geant4 Installation on Windows 11 WSL2
|
|
|
# running AlmaLinux 9
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
... | ... | @@ -9,6 +9,8 @@ For this tutorial we install Geant4 in Windows Subsystem for Linux (WSL) machin |
|
|
|
|
|
## 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.
|
|
|
|
|
|
1. Visit https://docs.microsoft.com/en-us/windows/wsl/install-win10
|
... | ... | @@ -77,97 +79,26 @@ or you will be not able to use Geant4 graphics.* |
|
|
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
|
|
|
https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v
|
|
|
|
|
|
### Create Ubuntu 20.04 VM
|
|
|
Make sure you has "Server with GUI" installed in you VM.
|
|
|
|
|
|
* 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
|
|
|
dnf clean all
|
|
|
dnf -y update
|
|
|
dnf -y groupinstall "Server with GUI"
|
|
|
```
|
|
|
You will also need curl
|
|
|
|
|
|
`$ apt install -y curl`
|
|
|
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. ###
|
|
|
|
|
|
* 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`
|
|
|
to download installation the scripts.
|
|
|
To test you installation you can follow the procedure described in [Install Geant4 on AlamaLinux](Linux Installation/AlmaLinux 9 Installation).
|
|
|
|
|
|
## Tips ##
|
|
|
|
|
|
- WLS 2
|
|
|
- Use the command
|
|
|
export DISPLAY=`ip route | awk '/default/ {print $3; exit}'`:0.0
|
|
|
to setup display.
|
|
|
to setup display. If you use **MobaXTerm** or other external X11 server
|
|
|
|
|
|
- All environment variables related to laguage
|
|
|
(LANGUAGE, LANG, LC_* ) are set to C.UTF-8 in ubuntu wls.
|
... | ... | @@ -186,16 +117,3 @@ to download installation the scripts. |
|
|
- If you use zsh you need to use .zprofile instead of .bash_profile
|
|
|
- Use *source* not a *.* to source setup scripts
|
|
|
|
|
|
- Ubuntu Desktop in HyperV run full screen.
|
|
|
|
|
|
Start terminal
|
|
|
|
|
|
- sudo vi /etc/default/grub
|
|
|
|
|
|
- Change the GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” line to GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash video=hyperv_fb:1920x1080”
|
|
|
|
|
|
- sudo update-grub
|
|
|
|
|
|
- Restart your VM
|
|
|
|
|
|
VM will run full screen mode. |