Kali linux для windows 10 wsl2

Команда разработчиков Kali Linux представила графический интерфейс для подсистемы Windows для Linux (WSL). Решение называется Win-Kex (Windows + Kali Desktop E...

Команда разработчиков Kali Linux представила графический интерфейс для подсистемы Windows для Linux (WSL). Решение называется Win-Kex (Windows + Kali Desktop EXperience). Теперь можно запускать популярный дистрибутив для пентеста на ПК с Windows 10 в WSL2 с GUI.

Специалисты портала Bleeping Computer проверили, что это действительно работает. Они опубликовали свою инструкцию по установке и запуску Kali Linux с графическим интерфейсом для подсистемы Windows для Linux (WSL2).

Установка Kali Linux с GUI возможна только на ПК с ОС Windows 10 версии 2004.

На подготовительном этапе необходимо в ОС активировать подсистему Windows для Linux.

Открыть PowerShell (сейчас и далее под администратором) и запустить:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Перезагрузить ПК.

Открыть PowerShell и запустить:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Перезагрузить ПК.

Далее необходимо скачать и установить WSL2.

Потом нужно открыть PowerShell и запустить:

wsl --set-default-version 2

Далее нужно установить Kali Linux из магазина Microsoft Store.

Чтобы поменять тип установки kali-linux с WSL1 на WSL2 нужно в PowerShell запустить:

wsl --set-version kali-linux 2

Далее нужно выполнить установку и запустить Kali Linux.

Потом нужно установить пакет Win-KeX.

sudo apt update && sudo apt install kali-win-kex

или

sudo apt update
sudo apt dist-upgrade
sudo apt install -y kali-win-kex

Можно также установить расширенную сборку Kali Linux.

sudo apt install kali-linux-large

После окончание установки GUI для Kali Linux запускается командой «kex».

Видеоинструкция по установке Kali Linux на ПК с Windows 10 в WSL2 с GUI за 5 минут.

Kali Linux с GUI в Windows 10Уже некоторое время в Windows 10 присутствует возможность установить различные дистрибутивы Linux с помощью компонента «Подсистема Windows для Linux» или WSL, однако лишь в виде терминала без графического интерфейса. Начиная с Windows 10 2004 WSL обновился до версии 2.0, благодаря чему появились новые возможности и, в рамках этих возможностей появилась Kali Linux для WSL2 с поддержкой графического интерфейса или Win-Kex.

В этой инструкции подробно об установке графического интерфейса Kali Linux в Windows 10 версии 2004 или новее, а также дополнительная информация, например, о том, как включить русский язык интерфейса в установленной системе.

Установка Kali Linux с графическим интерфейсом в Windows 10

Порядок установки Kali Linux с графическим интерфейсом (GUI) для подсистемы Windows для Linux будет состоять из следующих шагов (напоминаю: необходима версия Windows 10 2004 или новее):

  1. Включите компонент «Подсистема Windows для Linux». Сделать это можно в Панель управления — Программы и компоненты — Включение или отключение компонентов Windows. После установки перезагрузите компьютер. Установка подсистемы Windows для Linux
  2. Этот шаг можно пропустить, если у вас включены компоненты Hyper-V, иначе запустите Windows PowerShell от имени администратора (можно сделать через правый клик по кнопке «Пуск» и выполните команду
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  3. Скачайте и установите обновление ядра Linux WSL2 со страницы https://docs.microsoft.com/ru-ru/windows/wsl/wsl2-kernel
  4. Перезагрузите компьютер, запустите PowerShell от имени администратора и выполните команду
    wsl --set-default-version 2
  5. Зайдите в магазин приложений Windows Store, используйте поиск чтобы найти и установить Kali Linux. Установка Kali Linux из Windows Store
  6. После завершения установки в PowerShell от имени администратора выполните команду:
    wsl --set-version kali-linux 2
  7. Запустите Kali Linux (пункт будет доступен в меню «Пуск»), выполните первоначальную настройку (имя пользователя и пароль), после чего по порядку выполните следующие команды (требуется подключение к Интернету, последний шаг может занять много времени.
    sudo apt update
    sudo apt dist-upgrade
    sudo apt install -y kali-win-kex
  8. В ходе выполнения последней команды вам будет предложено выбрать клавиатуру. Я оставил значения по умолчанию, но, возможно, стоило выбрать русскую, так как в дальнейшем при включении русского языка интерфейса в ряде случаев кириллица не отрисовывается (не знаю, есть ли связь, лишь предположение).
  9. По завершении установки введите команду kex для запуска Kali Linux с графическим интерфейсом. При первом запуске вам будет предложено создать отдельный пароль, можно от этого отказаться.

Kali Linux с графическим интерфейсом в Windows 10

В результате запустится Kali Linux с графическим интерфейсом в полноэкранном режиме. Для выхода из полноэкранного режима можете вызвать меню клавишей F8 и отключить опцию «Full Screen».

Если вам потребуется включить русский язык интерфейса для Kali Linux, у меня сработал следующий метод:

  1. В графическом интерфейсе Kali Linux запускаем терминал, вводим команду
    sudo dpkg-reconfigure locales
  2. Выбираем ru_RU UTF-8 на двух экранах (отметку ставим пробелом, переключаемся на кнопку Ok клавишей Tab).
  3. Закрываем окно терминала и окно графического интерфейса, в терминале из которого мы запускали графический интерфейс вводим kex stop (если приглашение ввода не отображается, попробуйте изменить размер окна — у меня встретился такой баг).
  4. Снова запускаем kex — в результате интерфейс будет на русском языке. Kali Linux WSL2 на русском языке

А в целом, хотя я еще и не придумал, для чего мне это использовать (возможно, попробую запускать пакеты от bitnami для экспериментов с сайтами), но на первый взгляд всё работает исправно и быстро: быстрее, чем в виртуальной машине.

Win-KeX — это графическая среда рабочего стола для Kali Linux, работающая в подсистеме Windows для Linux.

Когда Microsoft обновила WSL до версии 2, у разработчиков появились новые возможности. Одни из первых, кто использует тот факт, что настоящее ядро ​​Linux теперь виртуализировано в WLS, это команда Kali Linux. Они создали новый пакет Win-KeX, который позволяет запускать дистрибутив Kali Linux с новым окружением рабочего стола и новой темой GTK3.

Сегодня опыт снова улучшается с появлением Win-KeX (Windows + Kali Desktop EXperience). После его установки, ввода kex вам будет доступен графический интерфейс для постоянного сеанса.

Запустить Linux с графической оболочкой в Windows 10 легко; просто следуйте этой небольшой инструкции:

Как установить  Linux с рабочем столом используя WSL 2 в Windows 10

Шаг 1 —  установите WSL 2

Если вы не сделали это раньше — установите подсистему Windows для Linux (WSL 2) в Windows 10.

  1. Откройте PowerShell от имени Администратора и выполните следующую команду:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

установите подсистему Windows для Linux (WSL 2) в Windows 10

  1. После выполнения, нажмите Y чтобы перезагрузить компьютер, или нажмите N, чтобы перезагрузить его вручную, позже.
  1. Загрузите и установите пакет обновления ядра Linux2 на странице https://aka.ms/wsl2kernel.
  1. Снова откройте PowerShell, введите следующую команду и нажмите Enter:
wsl --set-default-version 2

После выполнения этих действий ваше устройство начнет использовать новую версию подсистемы Windows Subsystem for Linux 2 по умолчанию для уже установленных и новых дистрибутивов.

Шаг 2 — Загрузите и установите дистрибутив Linux из Магазина Microsoft.

  1. Перейдите в магазин Windows и установите дистрибутив Kali Linux

Подробнее в нашем руководстве:  Загрузить дистрибутив Linux из Microsoft Store

Загрузите и установите дистрибутив Linux из Магазина Microsoft.

Шаг 3 — Установка Win kex

  1. Откройте меню «Пуск» и запустите «Kali Linux», настройте дистрибутив введя новый логин и пароль администратора.

Откройте меню «Пуск» и запустите «Kali Linux»

  1. Далее выполните команду, которая установит пакеты Win kex:
sudo apt update && sudo apt install -y kali-win-kex

выполните команду, которая установит пакеты Win kex:

  1. В процессе вы увидите запрос для выбора раскладки клавиатуры, сделайте свой выбор (см. картинку ниже).

запрос для выбора раскладки клавиатуры,

  1. Дождитесь завершения установки пакетов.

Шаг 4 — Запуск Kali Linux с графической оболочкой рабочего стола используя WSL 2 

  1. Чтобы запустить Kali Linux с графическим интерфейсом рабочего стола, введите команду и нажмите Enter:
kex 

Чтобы запустить Kali Linux с графическим интерфейсом рабочего стола, введите команду kex

  1. В консоли введите новый пароль администратора и подтвердите действия для запроса: «Would you like to enter a view-only password (y/n)?» нажав клавиши Y или N.

введите новый пароль администратора и подтвердите действия

  1. Все, вы мгновенно загрузитесь на рабочий стол ОС Kali Linux; немного протестировав систему и могу сказать, что работает она отлично, быстрее чем на обычной виртуальной машине.

вы мгновенно загрузитесь на рабочий стол ОС Kali Linux;

wsl2 рабочий стол ОС Kali Linux;

Рабочий стол хорошо смотрится и достаточно функционален. Из интересного: доступен режим Kali Undercover — вы можете найти его в меню или с помощью команды:

kali-undercover

В результате Linux станет абсолютно похож на Windows. Чтобы вернуть классический вид выполните эту команду ещё раз.

доступен режим Kali Undercover

Дополнительные возможности и настройки

Как включить русский язык

Чтобы изменить язык интерфейса Kali Linux на русский или любой другой.

  1. Откройте терминал на рабочем столе кали и выполните команду и подтвердите установку нажав клавишу Y.:
sudo apt-get install locales

изменить язык интерфейса Kali Linux на русский

  1. Введите команду:
sudo dpkg-reconfigure locales

Выберите нужную вам локаль и нажмите «ОК»

Выберите нужную вам локаль RU

  1. Теперь выберите язык по умолчанию

выберите язык RU по умолчанию

  1. После чего, выполните эти команды по очереди:
sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade
  1. Завершите сеанс введя в окне WSL:
 kex kill

или,

kex stop
  1. Снова запустите linux командой: kex

Как включить Звук

Подробно в нашем руководстве: Windows 10 Как включить поддержку звука в wsl2.

Как переключиться на светлую или тёмную тему?

По умолчанию в системе для каждой темы есть два режима: тёмный и светлый. Для переключения на между ними, перейдите в «Настройки» → «Внешний вид» и на вкладке «Стиль» выберите нужный вам режим. 

Как переключиться на светлую или тёмную тему?

Возможные проблемы установки

Ошибка «Sub-process /usr/bin/dpkg returned an error code (1)»

  1. Если вы столкнулись с такой ошибкой, не беспокойтесь! Для решения проблемы выполните следующую команду для принудительной установки:
sudo apt-get install -f

Или,

sudo apt-get install --fix-broken

Здесь опция -f (или —fix-broken) попытается исправить систему с нарушенными зависимостями.

  1. Теперь выполните по очереди:
sudo apt update

sudo apt dist-upgrade
  1. Затем вы можете использовать следующую команду для установки Win-KeX:
sudo apt install -y kali-win-kex
  1. Снова запустите, kex чтобы запустить среду рабочего стола Linux в Windows 10.

Ошибка больше не повторится.

Рекомендуем: Вы всегда сможете сделать резервную копию дистрибутива и запускать ее на других ПК с Windows 10. Подробнее в нашей статье: Экспорт и импорт дистрибутива Linux WSL1 и WSL2 в Windows 10

Installing Kali Linux on Windows 10 doesn’t requires Virtual Machine or VMware software to install it as a virtual OS. Windows 10 updated version have WSL2 feature which is better then it’s previous version of WSL(Windows Subsystem for Linux). WSL2 have a full Linux kernel, that is awesome.

Although WSL utilize a very minimal HyperV virtualization technology to run the Linux kernel virtualization to run Linux on Windows. But we can tell this is better then traditional virtual technology.

Kali linux 2020.3 installation on windows using WSL2 & win-kex

Now we are going to install Kali Linux on our Windows 10 machine. This is going to be the easiest method.

First we need to be sure that we have an updated Windows 10. If not then we should update our Windows 10 PC. We also make sure that we have enabled hyperV on Windows features on/off.

First we need to install WSL2 on our Windows 10.

Installing WSL2 in Windows 10

To install WSL2 e need to search for PowerShell & run the PowerShell as administrator.

running powershell as administrator

Then we run the following command in PowerShell to enable the WSL:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Then we run following command to run Virtual Machine program:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

The screenshot is following:

powershell commands to enable wsl2 and virtual machine

Now we must need to restart our PC.

After a restart we have to install the kernel packages for WSL2. To do this we need to to to this link and download the packages for x64 machines or we can do it by directly clicking here.

After download we need to run the update package, and finish the installation wizard.

We have successfully setup WSL2 in our Windows 10. To make it default we need to again open PowerShell as administrator and run the following command:

wsl --set-default-version 2 

Install Kali Linux 2020.3

Now we are all set to install Kali Linux. To do this we just need to to the Microsoft store and search for Kali Linux app.

Install it as we do with other Microsoft store apps and it is quite small in size(185 MB).

kali linux on microsoft store

After installation finishes we «Lunch» it. It will take a little bit time on first running.

Then we need to type a username to login on our Kali Linux machine. As the following screenshot we entered our username. We can put whatever we want. Then hit enter.

Now it’s time to set a new password for our user. We type the password but it will be hidden even not showing as *. Hit enter

Then we need to confirm the password.

We got Kali Linux terminal on our Windows 10 machine. Isn’t it easy?

kali linux terminal

What ?? !!

Where is Graphical Interface? This is a terminal only. OK, we know that beginners are not comfortable with the terminal.

Kali Linux GUI using win-kex

Setting up the Graphical interface is also very easy. We just need to type following command on this Kali Linux terminal:

sudo apt update && sudo apt upgrade && sudo apt install kali-win-kex

It will ask the password of Kali. We need to type the password what we have set before and hit the enter button. It may asks for permission we can type «y» for yes and hit enter. Then the installation process will start, after finishing the installation we just need to type kex and hit enter.

kex

win kex

BINGO!

We got Kali Linux’s GUI in our Windows 10. This is easy to set up we can set this in some minutes. This way we can run Kali Linux on our Windows using HyperV virtual system using WSL. We also change the command line interface to GUI (Graphical User Interface) using win-kex. Win-kex released with the latest version of Kali Linux 2020.3.

Liked our tutorial ? Then follow us our blog and follow us on Twitter and Medium. For any query comment down below. We always reply.

Setup Kali Linux in Windows 10 WSL2

This article will explain how you can install Kali Linux directly inside your Windows 10 without having to run the Kali setup. This will save you a lot of time that is required to setup a Kali VM in Windows and you won’t have to go through fixing the errors which can encounter during Kali installation.

Install WSL2 in Windows 10

This article assumes you have already installed WSL2 in your Windows 10. The more information about WSL2 and its installation steps are covered in following article:

Windows Subsystem for Linux (WSL)

If you have not installed WSL2, please check this article first and then come back here to start setting up your Kali Linux environment.

Install Kali Linux

  1. To install Kali Linux (or any other GNU/Linux distribution), open Run dialog (Windows key + R), then type “ms-windows-store:” without quotes and hit enter. This will launch Microsoft Store app.
  2. Click on the search, type “Linux” and hit enter. You will see all the popular Linux apps.

ms-windows-store

    1. Select Kali Linux and click on Install (or Get) button. If it asks you to login with Microsoft account, just click on No, thanks. This will start downloading and installing the Kali Linux which could take a while.

download-kali

  1. To launch the Kali linux, click on start and type “Kali” to search.

launch-kali

Tip: The most recently installed app “Kali Linux” will probably be displayed on top of start menu.

  1. Click on “Kali Linux” and it will display a terminal window with a text “Installing, this may take a few minutes”. This will happen only for the first time.
    1. Once done, you will be asked to type a user name and then set a password. After typing password twice, you will be logged in to your Kali Linux environment. This is just a minimal installation of Kali linux. In the next step, we will convert the minimal installation to full including GUI and tools.

initialize-kali

    1. The good thing is that your Windows C: drive is automatically mounted to /mnt/c directory in Kali linux. So you can browse and seamlessly transfer the files across Windows and Kali. Take a look at the following image:

kali-terminal

  1. Now that we have a mimimal Kali install running in a terminal. We can run commands in terminal to convert it into full GUI. The sudo apt update && sudo apt install kali-desktop-xfce -y command will do that. But instead of installing XFCE desktop environment, we will install Kali Desktop Experience for Windows (aka Win-KeX).
  1. Now why would we install Win-KeX instead of XFCE which is default desktop environment for Kali Linux? Because “Win-KeX” offers a Kali Desktop Experience for WSL2 which is tightly integrated with Windows. It provides following features:
    • Window Mode: Starts a Kali Linux desktop in a dedicated window
    • Seamless Mode: Share the Windows desktop between Windows and Kali apps
    • Shared clipboard: Allows copy/paste between Windows and Kali Linux apps
    • Multi-session support: Supports Root and regular user sessions
    • Sound support

    Leave the terminal window open and proceed to the next step in order to install Win-KeX.

Amazon Music Disney Promo

Install Win-KeX in Kali Linux

  1. Type the following commands in terminal and hit enter. When prompted, enter the password you set in Step 5.
    sudo apt update -y && sudo apt install kali-win-kex -y

    It could take a while depending upon the speed of your computer and internet connection. Wait for installation to finish.

Run Win-KeX in Kali Linux

WSL2 allows you to run Win-KeX in three modes.

  • Window Mode: Window mode helps keeping the Windows and Kali environments visually apart. Kali linux will run in a dedicated window. To start Win-KeX in Window mode with sound support, type the following command in terminal and hit enter:
    win-kex --win -s
  • Enhanced Session Mode (ARM only): Enhanced Session Mode runs the Kali Linux desktop session in a separate window using protocols and clients native to Windows. This is supported on ARM devices only. To start Win-KeX in Enhanced Session Mode with sound support, type the following command and hit enter:
    win-kex --esm --ip -s
  • Seamless mode: Seamless Mode runs a Kali Linux panel on the screen top of the Windows desktop. It removes the visual segregation between linux and window apps which provides a great platform to run a penetration tests in Kali Linux and copy the results straight into a Windows app. To start Win-KeX in Seamless mode with sound support, type the following command and hit enter:
    win-kex --sl -s

Now you know How to run Kali Linux in WSL2 without having to install and maintain a VM in VirtualBox or Hyerp-V. But wait a minute; When you want to start Kali Linux, you will have to repeat following two steps every time:

  • Open cmd.exe (or PowerShell console) in Windows and then type wsl -d kali-linux command
  • And then type win-kex --sl -s command to run WinKex in seamless mode

If you don’t want to repeat these steps every time, proceed to the next step of this article.

Install Windows Terminal

  1. Open Run dialog (Windows key + R), then type “ms-windows-store:” without quotes and hit enter. This will launch Microsoft Store app.
  2. Click on the search, type “Windows Terminal” and hit enter.
    1. Click on Windows Terminal app from search results and click on Install (or Get) button. If it asks you to login with Microsoft account, just click on No, thanks. This will start downloading and installing the Windows Terminal app.

windows-terminal

  1. We will now create a shortcut in Windows Terminal which will help us start the Kali Linux automatically in just a single click.
    Now launch Windows Terminal app and press “Ctrl + ,” keys simultaneously to open terminal settings. It will open “settings.json” file in “Code Writer” app so don’t freak out.
    1. In settings.json file, look for the lines marked with Red box in image, copy the marked section and then paste it right below (as marked by the Green box)

adjust-terminal-settings

Look at the “commandline” argument’s value. This is the actual command which will run Kali Linux in seamless mode when you click on Windows Terminal shortcut. You can download the kali icon from here.

If you want to run Kali in Window mode, set the “commandline” value to wsl -d kali-linux kex --wtstart -s . You must slightly change the “guid” value marked with Blue underline otherwise you won’t see the new shortcut in Windows Terminal. You can also change other values if you like and then save the file.

    1. Now close the Windows Terminal and launch it again. Then click on the dropdown icon and choose the Kali Win-KeX option to launch it.

view-kali-shortcut.png

    1. This will launch Kali Win-KeX in seamless mode and you will see a new window running Kali desktop.

launch-kali-win-kex.png

That’s it. Now you’re running Kali Linux in Windows 10 in seamless mode where you can change through apps opened in Windows as well as Kali Linux by pressing “Alt + Tab ” or “ Windows logo + Tab ” keys.

If you want to close the Kali window, just close the Kali Win-KeX tab in Windows Terminal.

Tip: Closing the Kali Win-KeX tab in Windows Terminal doesn’t actually terminate the “kali-linux” WSL distribution. You can run wsl -l -v command in cmd.exe or PowerShell console and you will still see it Running.

To terminate the WSL instance, you need to run wsl -t kali-linux command manually as shown in image below.

terminate-kali-linux.png

Fixing Errors in Kali Linux

  1. If you see a message saying Started Win-KeX SL on Windows Terminal but don’t see any Window for Kali Linux, it is most likely that your Windows Firewall or Antivirus Firewall is blocking the application. You need to add the following application to trusted apps list in your Firewall.
    \wsl$kali-linuxusrlibwin-kexVcXsrvvcxsrv.exe
  2. If you see an error like Failed to execute child process “dbus-launch” (No such file or directory). You need to connect to Kali linux by running “wsl -d kali-linux” command in cmd.exe (or PowerShell console) and then execute the following commands:
    sudo service xrdp stop
    sudo apt-get install dbus-x11
    sudo service xrdp start
    

The Windows Subsystem for Linux lets developers run a GNU/Linux environment including most command-line tools, etc. direct on Windows, unmodified, without the overhead of an ordinary virtual machine or dual-boot system.

Uses of WSL: 

  • Pick your preferred GNU/Linux distributions from the Microsoft Store.
  • Run basic command-line tools, for example, grep, sed, awk, or other ELF-64 doubles.
  • Run Bash shell and GNU/Linux command-line applications like tmux, emacs, SSHD, MySQL, and also could use the language compilers.
  • Summon Windows applications utilizing a Unix-like command-line shell.
  • Summon GNU/Linux applications on Windows.

WSL 2

WSL 2 is another form of the Windows Subsystem for Linux engineering that controls the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. Its essential objectives are to build file system execution, just as including full framework call compatibility. This new design changes how these Linux binaries associate with Windows and your PC’s equipment, yet at the same time gives a similar client experience as in WSL 1 (the current broadly accessible version).

Requirements For WSL 2:

  • WSL 2 is only accessible in Windows 10, Version 1903, Build 18362, or higher.
  • On the off chance that you are on Windows 10 form 1903 or 1909 ensure your minor build number is 1049 or higher.
  • Running Windows 10, refreshed to version 2004 or higher, version 19041, for ARM64 systems.
  • WSL 2 will work with VMWare 15.5.5+ and VirtualBox 6+.

Verifying the System Compatibility:

Step 1: Hold on the Windows logo key (on the keyboard) + R to open the run dialogue, and then type in the following command and select OK.

winver

Step 2: If your OS builds version is not compatible, then we have to update the Windows.

Step 3: For updating, Click on the Windows logo in the bottom left corner of your screen and then type in the following command and press enter:

check for updates

Step 4: Now, select the “Check for updates” option from the menu listed, and then a dialog box will appear.

Step 5: Click on the “Check for Updates” button on the screen, and after successful completion of the update, “restart” your machine. But, if you don’t get any information regarding the update then, after doing a restart/s you will be prompted an update.

Setting up WSL:

Step 1: Click on the Windows logo in the bottom left corner of your screen and then type in the following command:

powershell

Now, when the list appears in the menu, Right-Click on the “Windows Power Shell” option and chooses “Run as administrator”.

Step 2: Now, once the Power Shell is opened and ready to use, type the following command and hit enter:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Step 3: Restart your machine.

Step 4: After the restart, again run the “Windows PowerShell” in the administrator mode, and then type in the following command:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 5: Now, type in the next command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 6: Now, again restart your machine.

Step 7: In order to update the kernel packages visit https://aka.ms/wsl2kernel, download the kernel package and install the same.

Step 8: In order to activate WSL 2 execute the following command in Windows Powershell running the same in administrator mode.

wsl --set-default-version 2

Installing and Setting up Kali Linux CLI:

Step 1: Hit the Windows logo button on your keyboard, and then type in the following command and then, choose the “Microsoft Store” option from the menu.

microsoft store

Step 2: Once the Microsoft store opens, search for “Kali Linux” in the search bar.

Step 3: On the Kali Linux page, click on the “Get” option in order to download the Kali Linux app.

Step 4: Once the Kali Linux app is downloaded, close the Microsoft-Store.

Step 5: Click on the Windows logo in the bottom left corner of your screen and then type in the following command and press enter:

Kali Linux

Step 6: After opening the Kali Linux app, the distribution will be installed in few seconds completely.

Step 7: Then, type in the credentials that you want to set in for the login purpose. Now, you will be able to use the Kali Linux easily in the command-line prompt and also execute the basic commands without an error.

Note: The base image does not contain any tool, or a graphical interface in order to keep the image small, however, it can be downloaded and installed via “apt” commands easily.

Setting Up Kali Linux(GUI):

Step 1: Open the Kali Linux app and login with your credentials.

Step 2: Type in the following command and hit enter:

sudo apt update && sudo apt upgrade -y

Step 3: After the successful completion of the above command, type the following command and hit Enter:

sudo apt upgrade && sudo apt install kali-win-kex -y

Step 4: Now, once the above command is completed installing, then type in the following:

kex

This will initiate the process to open up the GUI environment of the Kali Linux distribution installed.

Important: 

1. Now, whenever we have to close the GUI opened, then we will press the “fn” key with “f8” in order to select the “exit viewer” option. 

2. Then, after exiting the viewer type in the following command in order to completely close the running services: 

kex stop

3. Thereafter, whenever we want to start the GUI Kali Linux environment then we will firstly open the Kali Linux app, and then type in the following commands by sequence: [or else you will get an error.]

kex stop [In any case you forgot to stop the kex services running before.]
kex

Note: The above GUI setup will work on Kali Linux versions 2020.3 or later.

This brief tutorial shows students and new users how to install and run Kali Linux on Windows Subsystem for Linux 2 (WSL2).

Back in 2017, Windows released Windows Subsystem for Linux that lets developers run a GNU/Linux environment, including most command-line tools, utilities, and applications directly in Windows without setting up a virtual machine or dual-boot.

WSL2 has since been released, and it’s an improvement over version 1. The new and improved version comes with a performance boost, and full system call compatibility, and is built with a new architecture that delivers features that make WSL an amazing way to run a Linux environment in Windows.

To install WSL 2 on Windows 10, these two requirements must be met:

  • Windows 10 May 2020 (2004), Windows 10 May 2019 (1903), or Windows 10 November 2019 (1909) or later
  • A computer with Hyper-V Virtualization support

Since you can now install Linux systems, including Kali Linux directly in Windows, let’s go ahead and install Kali Linux. Before you can do that, you must first enable WSL or WSL2 in Windows.

When you’re ready to enable WSL 2 on Windows 10, follow the steps below:

Enable WSL in Windows

To enable WSL in Windows, you will want to open the PowerShell terminal as administrator. Click on Start then begin typing PowerShell.

Next, right-click the Windows PowerShell app and choose to run as administrator.

When the console opens, run the commands below:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

After installing, you should get a success message similar to the lines below:

Deployment Image Servicing and Management tool
Version: 10.0.19041.844

Image Version: 10.0.19042.844

Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

Enable Virtual Machine Platform

WSL 2 requires Windows 10 Virtual Machine Platform to be enabled. This is not Hyper-V. To enable the VM platform feature in Windows, run the commands below from the same PowerShell administrator’s console.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

If you’re using Windows 10 version lower than 2004, then use the commands below:

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart

When you’re done running the commands above, restart your computer for all the configuration changes to apply. If you don’t restart, the below command might not be recognized.

After restarting your computer, login back in and launch PowerShell as administrator. Then run the commands below to configure WSL 2 as the default version of WSL.

wsl --set-default-version 2

If you get an error about not having Linux kernel installed, get it from the link below and run it in Windows, then try the command above again.

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Install Kali Linux on Windows 10

Now that WSL 2 is installed and ready to be used, open the link below to download and install a copy of Kali Linux from the Windows store.

Get Kali Linux – Microsoft Store

Kali Linux on Windows allows you to use Kali Linux Terminal and run Kali Linux command line utilities including bash, ssh, git, apt, and many more.

Click the Get button and install. After installing Kali Linux, you’ll want the option to launch Kali Linux from the Windows WSL environment.

After downloading and installing, you will get a Launch button.

After launching Kali Linux, it should install and prompt you to create your account.

Installing, this may take a few minutes…
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: richard
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
┏━(Message from Kali developers)
┃
┃ This is a minimal installation of Kali Linux, you likely
┃ want to install supplementary tools. Learn how:
┃ ⇒ https://www.kali.org/docs/troubleshooting/common-minimum-setup/
┃ ┗━(Run: “touch ~/.hushlogin” to hide this message)
┌──(richard㉿DESKTOP-M1235UB)-[~]
└─$

That should do it!

Some troubleshooting commands to run when you run into issues.

wsl --set-default-version 1
bcdedit /set hypervisorlaunchtype auto start

Now simply launch Kali Linux from Windows and start by searching for it. You can also pin it to the taskbar and always have it launch from there.

That should do it!

Conclusion:

This post showed you how to install WSL 2 on Windows 10 and install Kali Linux. If you find any error above please use the comment form below to report.

Понравилась статья? Поделить с друзьями:
  • Kaspersky security cloud free для windows не запускается
  • Kaspersky security center windows server 2008 r2
  • Kaspersky security center 11 установка windows server
  • Kaspersky security 11 для windows server системные требования
  • Kaspersky security 11 для windows server сертификат фстэк 3840