-
Notifications
You must be signed in to change notification settings - Fork 124
/
WSL_Install.bat
59 lines (51 loc) · 1.35 KB
/
WSL_Install.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@echo off
set "wslService=LxssManager"
sc query %wslService% >nul 2>&1
if %errorlevel% == 0 (
echo WSL is installed
goto questionDocker
) else (
echo WSL is not installed
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux
goto questionDocker
)
:question
echo WSL is not installed. You want to install a distribution? (s/n)
set /p install=""
if /i "%install%"=="s" goto install
if /i "%install%"=="n" goto exit
:questionDocker
echo Select an option:
echo 1. Installing WSL
echo 2. Install Docker (WSL required)
echo 3. Exit
set /p installDocker=""
if /i "%installDocker%"=="1" goto install
if /i "%installDocker%"=="2" goto installDocker
if /i "%installDocker%"=="3" goto exit
:install
echo Choose a distribution to install:
echo 1. Ubuntu 20.04 LTS
echo 2. Debian 10
echo 3. Kali Linux
set /p distro=""
if /i "%distro%" == "1" goto ubuntu
if /i "%distro%" == "2" goto debian
if /i "%distro%" == "3" goto kali-linux
:ubuntu
powershell.exe -Command "wsl --install -d Ubuntu-20.04"
wsl --set-default Ubuntu-20.04
goto exit
:debian
powershell.exe -Command "wsl --install -d Debian"
wsl --set-default Debian
goto exit
:kali-linux
powershell.exe -Command "wsl --install -d kali-linux"
wsl --set-default kali-linux
goto exit
:installDocker
wsl curl -fsSL https://get.docker.com -o get-docker.sh
wsl sudo sh get-docker.sh
:exit
pause