It is easy to run and develop Nextflow workflows on Windows but there are some additional set up steps required. We have found the set up can be tricky so have outlined the steps required here with links to trouble shooting and further help.
This guide is similar to that presented at a guide from Nextflow which goes in to greater detail and has additional steps useful for developing workflows.
You will need Windows 10 and it is critical that you have Admin privileges for all the steps,
Check your windows version is sufficient
Enable Windows Subsystem for Linux (WSL).
If you have Windows 10 May 2020 (2004) update (or later) installed you can install WSL with a single command:
wsl.exe --install
If you have an earlier Windows version or the above has not worked continue following the steps -
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Update to WSL2
Download this WSL2 update file and run through the installation wizard: wsl_update.msi
A guide to WSL installation troubleshooting can be found here.
Set WSL2 as the default version.
wsl --set-default-version 2
Download WSL Ubuntu
Check WSL version for Ubuntu installation
WSL installations come in two versions, creatively name 1 and 2. We must ensure the Ubuntu installation is set to version 2.
In Powershell run:
wsl --list –v
The response should look something like:
H:\> wsl --list -v NAME STATE VERSION * Ubuntu Running 2 docker-desktop-data Running 2 docker-desktop Running 2 Ubuntu-18.04 Running 1
If a version is listed as 1 and not 2, change the version with
wsl --set-version <distribution name> <version>
For example to change the Ubuntu-18.04 installation above to version 2:
H:\> wsl --set-version Ubuntu 2
Set up Docker
wsl sudo groupadd docker sudo usermod -aG docker $(whoami)
Enable WSL2 in docker
These docker instructions can also be found here
wsl lsb_release -d
This will respond with something like:
Description: Ubuntu 20.04.3 LT0
Set WSL2 resource limits
It is important to configure docker resource limits so it does not use all available memory and cpu.
You will need to update a different file depending on if you want a global configurartion for all WSL distributions or a specific one for each distribution.
Global
C:/Users/<USERNAME>
.wslconfig
Specific Distribution
/etc
and open a file:cd /etc sudo vim wsl.conf
Copy and paste the following in to the respective file
[wsl2] memory=8GB processors=4 localhostForwarding=true
Adjust settings in the config based on your available resources. To find out total available on your device you can CTRL-ALT-DELETE to open task manager, click performance tab and look at details of CPU and memory. Total no. of processors will be ‘logical processors’. Remember to leave some resource available for other programmes on your computer.
Save the file (in vim press Esc and type :wq!
).
Shut down all running wsl instances via cmd line
wsl --shutdown
Now relaunch wsl and check resources are as expected using cmds
cat /proc/cpuinfo cat /proc/meminfo
For more advanced settings see here
Install Java
To install Java into the WSL2 Ubuntu installation run (after starting WSL
with the wsl
command):
sudo apt install openjdk-11-jre-headless
Download and install Nextflow
Nextflow can be installed following the instruction in their Getting started pages:
curl -s https://get.nextflow.io | bash chmod +x nextflow
./nextflow self-update
Test nextflow
To test Nextflow we can run a simple workflow template.
git clone https://github.com/epi2me-labs/wf-template.git
./nextflow run epi2me-labs/wf-template
OUTPUT=output ./nextflow run epi2me-labs/wf-template \ -w ${OUTPUT}/workspace \ --fastq wf-template/test_data --out_dir wf-template/${OUTPUT}
If you had any problems with this tutorial or think any additional information would be useful then please let us know so we can improve it for other users.