Начал изучать docker и захотел попробовать поставить его на вин10. Установил докер под виндовс и при запуске получаю вот такое сообщение
В microsoft store скачал дистрибутив debian и при запуске получаю вот такое сообщение
. При проверке версии wsl через команду wsl -l -v получаю следующее сообщение
Нет установленных дистрибутивов подсистемы Windows для Linux.
Дистрибутивы можно установить из Microsoft Store:
https://aka.ms/wslstore
Следовал этой статье чтобы решить проблему https://docs.microsoft.com/ru-ru/windows/wsl/insta…. При выполнении команды wsl —set-default-version 2 вижу следующее сообщение
WSL 2 требуется обновление компонента ядра. Дополнительные сведения см. на странице https://aka.ms/wsl2kernel
Для получения сведений о ключевых различиях с WSL 2 перейдите на страницу https://aka.ms/wsl2
Версия Microsoft Windows [Version 10.0.19041.508], все обновления стоят
Windows Subsystem for Linux is a great environment for working with Linux tools, applications, utilities, bash command prompt shell, etc., from a Windows environment, as long as you don’t run into “Windows Subsystem for Linux has no installed distributions”. Windows Subsystem for Linux (WSL) is the de facto standard to run Linux distributions from Windows, without the need for a virtual machine platform, such as VirtualBox, Hyper-V, VMware Workstation, etc.
Working with Windows Subsystem for Linux is usually very straightforward but can be a bit quirky from time-to-time. Let’s look at an error you may receive when working with Windows Subsystem for Linux and how you can resolve it.
Table of contents
- What is Windows Subsystem for Linux?
- Linux distributions
- Installing Windows Subsystem for Linux
- Installing from Microsoft Store
- Legacy installation of Windows Subsystem for Linux, requiring the optional feature
- Installed WSL previously?
- Windows Subsystem for Linux has no installed distributions error
- Error description
- Windows Subsystem for Linux has no installed distributions Fix
- Installing Ubuntu distribution
- Windows Subsystem for Linux FAQs
- Wrapping Up
Windows Subsystem for Linux is a tool that lets developers, DevOps engineers, and home lab enthusiasts easily access Linux distribution environments from within their Windows host and use the Bash shell for an administrator.
Using WSL, you can run Bash command prompt, shell scripting, Linux applications, and native Linux tools. You can also use it to run internal or external command actions to control remote boxes.
WSL 2 is the newest iteration of Windows Subsystem for Linux that provides many performance and functionality improvements over WSL 1, as it uses an entirely new architecture.
Learn more about Windows Subsystem for Linux here: What is Windows Subsystem for Linux | Microsoft Learn
Linux distributions
You can install many different Linux distribution releases, including Ubuntu, Kali Linux, Debian, Arch Linux, and others, depending on which Linux distro you want to install. You can run your installed distributions at the same time in parallel.
Many Ubuntu distributions are found in the Microsoft Store, including the latest release Ubuntu 22.04.1 LTS and lower versions. It is controlled and run from the Windows service called LXSSManager service.
Administrators should make sure not to change the startup type for the service or manually configure it unless troubleshooting on a computer from personal experience.
Installing Windows Subsystem for Linux
The process of installing Windows Subsystem for Linux has changed over the course of the past few months as Windows Subsystem for Linux is now found on the Microsoft Store as a native Store app.
Installing from Microsoft Store
Previously, you had to enable Windows Subsystem for Linux as a Windows optional feature, and then download kernel updates for Linux for WSL 2 before you could use it. However, this has all been streamlined since WSL is now found on the Microsoft Store.
***Note*** you don’t have to have a user account to download the Windows Store app for WSL when visiting the Microsoft Store. Open Microsoft Store, search for “wsl” or “windows subsystem for linux” in the search bar on the Microsoft Store to find the Windows Subsystem for Linux Windows Store app.
Once you click install, it will run the downloading process and install the app.
Legacy installation of Windows Subsystem for Linux, requiring the optional feature
Previous versions of Windows Subsystem for Linux had to be enabled from the Windows optional features, requiring a reboot.
After enabling the Windows feature previously, you were prompted to restart.
Installed WSL previously?
What happens if you have installed the in-operating system version of Windows Subsystem for Linux and now want to install the Microsoft Store app? Actually, you just need to install again from the Microsoft Store app.
Once you install from the Microsoft Store, it will overwrite the in-operating system version of Windows Subsystem for Linux.
To check and make sure you have the Microsoft Store version, press the windows key +R, type cmd, then run the wsl –version command from the command prompt.
You should see something similar to the following:
Windows Subsystem for Linux has no installed distributions error
Many may experience an error of sorts when installing Windows Subsystem for Linux from the Microsoft Store. After launching the installation in the Microsoft Store, users may see the following error message displayed in the command prompt:
Error description
Below, you can see the following message. Windows subsystem for linux has no installed distributions error displayed in the command prompt window.
The error code given is wsl service createinstance getdefaultdistro wsl_e_default_distro_not_found. Press any key to continue. However, digging deeply into this is not the answer.
Windows Subsystem for Linux has no installed distributions Fix
Rather than being a showstopper error, if you have experienced the same issue, this message says we have no preferred Linux distribution or installed distributions error message, meaning we need to install Ubuntu or some other Linux distribution.
We need to use the WSL command and install a distribution. Installing Ubuntu is an easy distribution to get up and running with.
You can use the following command to begin the installation of the Ubuntu distribution.
Installing Ubuntu distribution
If you open a Windows Terminal, you can run the WSL command to see the options. However, to install Ubuntu, you can use the following command from the command line:
wsl –install ubuntu
Once you install Ubuntu, it will finish out the installation and then prompt to setup a new unix username in the UNIX shell.
Once you setup the new user account, you will see the Ubuntu prompt provide details of the environment, etc.
Windows Subsystem for Linux FAQs
What is Windows Subsystem for Linux? It is a way to have native access to Linux Bash shell prompt and other Linux tools without the overhead of a virtual machine platform.
How do you install WSL in Windows now? It is now a Windows Store app. Previously, you had to enable the optionalfeature.
How do you install Linux distributions in Windows Subsystem for Linux? Using the WSL command from the terminal or prompt, you can run the wsl –install <distribution> to install a new Linux distribution.
Wrapping Up
Hopefully, if you are experiencing the Windows subsystem for linux has no installed distributions error after installing WSL from the Windows Store, this little tip will help you to get around this perceived error message.
It is actually fairly intuitive as to the source of the error since it is noting you have yet to install Linux distributions in your WSL installation.
Windows Subsystem for Linux is a great tool that I find myself using more and more as the features and capabilities, and more importantly, the limitations, are becoming less and less. Without WSL, spinning up virtual machines when using Windows or SSH’ing into a remote VM is your only option.
Skip to content
Navigation Menu
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign up
Appearance settings
Description
-
Your Windows build number: 2004 (19041.26.4)
-
What you’re doing and what’s happening:
- installed WSL using directions at https://docs.microsoft.com/en-us/windows/wsl/install-win10
- restarted the computer
- installed Kali Linux from the Windows Store
- restarted the computer
- ran
bash.exe
at a Powershell command line (running as administrator).
- got the message:
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
log files.zip
Достаточно в командной строке прописать wsl.exe —install и нажать ввод
Как пишет источник, в последних сборках Windows Insider Preview появилась возможность установки подсистемы Linux для Windows (Windows Linux Subsystem) при помощи всего лишь одной команды из командной строки. А сейчас Microsoft подтвердила такую возможность для всех версий Windows 10 выше 2004 (и для Windows 11).
Чтобы установить подсистему Linux для Windows, теперь понадобится всего лишь запустить командную строку от имени администратора и выполнить команду wsl.exe —install. Если раньше этот процесс был продолжительным, нужно было открывать разные настройки и устанавливать различные пакеты ПО, то сейчас все осуществляется автоматически. После надо будет лишь перезагрузиться. По умолчанию устанавливается Ubuntu, но у пользователей (или администраторов) есть возможность выбрать другие дистрибутивы: чтобы просмотреть список доступных, нужно ввести команду wsl —list —online, а чтобы установить конкретный дистрибутив — выполнить команду wsl —install -d <Название дистрибутива>.
Есть еще несколько полезных команд. Например, wsl —update обновляет ядро WSL, а wsl —update rollback обеспечивает откат к прежней версии ядра WSL. Наконец, общую информацию по конфигурации WSL можно просмотреть при помощи команды wsl —status.
31 июля 2021 в 23:10
| Теги: Microsoft, Windows
| Источник: ITHome
В Windows 10 появилась новая возможность для разработчиков — оболочка Ubuntu Bash, позволяющая запускать, устанавливать приложения Linux, использовать скрипты bash прямо в Windows 10, все это называется «Подсистема Windows для Linux». В версии Windows 10 1709 Fall Creators Update доступны уже три дистрибутива Linux для установки. Во всех случаях требуется 64-разрядная система для установки.
В этой инструкции — о том, как установить Ubuntu, OpenSUSE или SUSE Linux Enterprise Server в Windows 10 и некоторые примеры использования в конце статьи. Следует также учитывать, что есть некоторые ограничения при использовании bash в Windows: например, нельзя запускать GUI приложения (правда, сообщают об обходных путях с помощью X server). Кроме этого, командами bash нельзя запустить Windows-программы, несмотря на наличие полного доступа к файловой системе ОС.
Установка Ubuntu, OpenSUSE или SUSE Linux Enterprise Server в Windows 10
Начиная с версии Windows 10 Fall Creators Update (версия 1709) установка подсистемы Linux для Windows несколько изменилась по сравнению с тем, что было в предыдущих версиях (для предыдущих версий, начиная с 1607, когда функция была представлена в бета-версии, инструкция — во второй части этой статьи). Также обратите внимание, что в Windows 10 2004 можно установить Kali Linux с графическим интерфейсом.
Теперь необходимые шаги выглядят следующим образом:
- Прежде всего, необходимо включить компонент «Подсистема Windows для Linux» в «Панель управления» — «Программы и компоненты» — «Включение и отключение компонентов Windows».
- После установки компонентов и перезагрузки компьютера, зайдите в Магазин приложений Windows 10 и загрузите оттуда Ubuntu, OpenSUSE или SUSE Linux ES (да, теперь доступно три дистрибутива). При загрузке возможны некоторые нюансы, о которых далее в примечаниях.
- Запустите загруженный дистрибутив как обычное приложение Windows 10 и выполните первоначальную настройку (имя пользователя и пароль).
Для включения компонента «Подсистема Windows для Linux» (первый шаг) можно использовать команду PowerShell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Теперь несколько примечаний, которые могут быть полезны при установке:
- Вы можете установить сразу несколько дистрибутивов Linux.
- При загрузке дистрибутивов Ubuntu, OpenSUSE и SUSE Linux Enterprise Server в русскоязычном магазине Windows 10 заметил следующий нюанс: если просто ввести название и нажать Enter, то нужных результатов в поиске не оказывается, но если начать вводить и затем нажать по появляющейся подсказке, автоматически попадаешь на нужную страницу. На всякий случай прямые ссылки на дистрибутивы в магазине: Ubuntu, OpenSUSE, SUSE LES.
- Запускать Linux можно и из командной строки (не только с плитки в меню Пуск): ubuntu, opensuse-42 или sles-12
Установка Bash в Windows 10 1607 и 1703
Для того, чтобы установить оболочку bash, выполните следующие простые действия.
- Зайдите в параметры Windows 10 — Обновление и безопасность — Для разработчиков. Включите режим разработчика (должен быть подключен Интернет для загрузки необходимых компонентов).
- Зайдите в панель управления — Программы и компоненты — Включение или отключение компонентов Windows, отметьте пункт «Подсистема Windows для Linux».
- После установки компонентов, введите в поиске Windows 10 «bash», запустите предлагаемый вариант приложения и выполните установку. Вы можете задать свое имя пользователя и пароль для bash, либо использовать пользователя root без пароля.
По завершении установки вы можете запускать Ubuntu Bash на Windows 10 через поиск, или создав ярлык для оболочки там, где вам требуется.
Примеры использования Ubuntu Shell в Windows
Для начала отмечу, что автор не является специалистом по bash, Linux и разработке, а примеры ниже — просто демонстрация того, что в Windows 10 bash работает с ожидаемыми результатами для тех, кто разбирается в этом.
Приложения Linux
Приложения в Windows 10 Bash можно устанавливать, удалять и обновлять с помощью apt-get (sudo apt-get) из репозитория Ubuntu.
Использование приложений с текстовым интерфейсом ничем не отличается от такового на Ubuntu, например, вы можете установить Git в Bash и использовать его привычным образом.
Скрипты bash
Вы можете запускать скрипты bash в Windows 10, создать их можно в имеющемся в оболочке текстовом редакторе Nano.
Скрипты bash не могут вызвать программы и команды Windows, но возможен запуск скриптов и команд bash из bat файлов и сценариев PowerShell:
bash -c "команда"
Также вы можете попробовать запускать приложения с графическим интерфейсом в Ubuntu Shell в Windows 10, на этот счет в Интернете уже имеется не одна инструкция и суть способа сводится к использованию Xming X Server для вывода GUI приложения. Хотя официально возможность работы с такими приложениями Майкрософт не заявлена.
Как было написано выше, я не тот человек, который может в полной степени оценить ценность и функциональность нововведения, но вижу как минимум одно применение для себя: различные курсы Udacity, edX и другие, связанные с разработкой проходить будет куда проще, работая с необходимыми инструментами прямо в bash (а в этих курсах обычно демонстрируется работа именно в терминале MacOS и Linux bash).