Using "Jetbrains Toolbox" from within "WSL" under the "Fedora" distribution.
Once installed, you may use "Jetbrains Toolbox" from within "WSL" under the "Fedora" distribution.
This image contains minimal Fedora with pre-installed packages: X11 packages, git, gnome-terminal, gedit, and the JDK Adoptium repository configured with dnf package manager.
In addition, "systemctl" is enabled by default, and an unprivileged user named "wsl" exists, with password "wsl".
-
Windows 11 or Windows 10 20h2 (10.0.19042.2604)
Check your Windows version on PowerShell:[System.Environment]::OSVersion.Version
-
PowerShell version 5.1 and above
Check your PowerShell version:$PSVersionTable.PSVersion
-
Ensure you are running the right version of WSL: Version 1.1.3.0 and above
Check your WSL version:wsl --version
You can run 'wsl --update' to check for any WSL updates.
Open a PowerShell terminal and run
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time
iex "& {$(irm https://raw.githubusercontent.com/rozidan/jetbrains-toolbox-on-wsl/main/install.ps1)}"
If you decided to install Intellij with the Toolbox, you may make a shortcut to it by executing the following commands:
jbtwsl.ps1 -ShortcutName 'WSL Intellij' -WslCommand 'idea'
The output you should see when done
Initializing...
Downloading Jbtwsl...
Installing Jbtwsl...
Updating Jbtwsl (it will take some time)...
Creating 'WSL Jetbrains Toolbox' shortcut...
Installing Jbtwsl tool...
Adding ~\jbtwsl to your path...
Now you can start Jetbrains-Toolbox from your desktop!
Get more help by exec `jbtwsl.ps1 -Help`
Done!
-
Clone to some directory (let say 'mydir') on your Windows machine, and cd to this folder
mkdir mydir git clone https://github.com/rozidan/jetbrains-toolbox-on-wsl.git cd mydir
-
Download the Jbtwsl image from here, or build the image with the given Dockerfile and export it with '.tar' file type (let say mytar.tar), then move it into 'mydir' directory.
For example, you can do that by clone to linux machine and execute the 'build.sh' script
-
Execute the jbtwsl.ps1 script
./install.ps1 -InstallTarPath .\jbtwsl.tar
-
Enter the WSL shell and run 'jentbrains-toolbox'
wsl -d jbtwsl
within WSL session:
$ jetbrains-toolbox
-
In addition, you can create a shortcut on your desktop, that will open the 'Jetbrains Toolbox' from the WSL you just installed
jbtwsl.ps1 -ShortcutName 'WSL Jetbrains Toolbox' -WslCommand 'jetbrains-toolbox'
You can create a shortcut to the 'gnome terminal':
jbtwsl.ps1 -ShortcutName 'WSL Terminal' -WslCommand 'gnome-terminal'
You can create a shortcut to the 'Intellij', after install it with the Jetbrains-Toolbox:
jbtwsl.ps1 -ShortcutName 'WSL Intellij' -WslCommand 'idea'
Within your WSL terminal, execute to following:
$ sudo dnf install temurin-17-jdk
- The following adoptium-temurin JAVA packages are available:
- temurin-8-jdk
- temurin-11-jdk
- temurin-17-jdk
- temurin-19-jdk
The installed JDK's directory is '/usr/lib/jvm/'
Ofcourse you do not have to use those particular JDK builds
Within your WSL console, execute to following:
$ sudo cp <ca.crt file path> /etc/pki/ca-trust/source/anchors
$ sudo update-ca-trust
Within your WSL console, execute to following:
$ sudo keytool -importcert -alias <alias> -keystore <jdk path>/jre/lib/security/cacerts -storepass changeit -file <ca.crt file path>
Within your WSL console, execute to following:
# Set up the repository
$ sudo dnf -y install dnf-plugins-core
$ sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
# Install the latest version of Docker Engine, containerd, and Docker Compose
$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# enable and start the docker daemoon
$ sudo systemctl enable --now docker
# check it works
$ sudo docker ps
In case you what the user 'wsl' to be able to use 'docker' command, just add 'docker' as a user group, then logout and login again
$ sudo usermod -a -G docker wsl
You can browse the Windows file system within the WSL by entering the '/mnt/c/' folder
- Script code inspired by get.scoop.sh
- How to? dev.to/bowmanjd