Bash для windows 10 не работает

I am planning to compile and run code in a linux environment. Before moving to a linux environment I want to try it out, virtual box and dual boot will take my memory. So, after updating my windows...

I am planning to compile and run code in a linux environment. Before moving to a linux environment I want to try it out, virtual box and dual boot will take my memory. So, after updating my windows 10 anniversary updates, I was able to install bash (ubuntu) natively to my windows 10 through windows features. After installing bash when I try to run bash it’s popping and closing a windows immediately. how can I solve this. I tried this with two pc, no luck. How can I solve this issue. Which registry file should I change ?

asked Aug 7, 2016 at 3:59

saai's user avatar

saaisaai

1533 silver badges9 bronze badges

Turn your windows to developer mode, go to settings -> search for developer, then change to developer mode. Restart your pc. It should work now

answered Aug 7, 2016 at 4:08

Saahithyan Vigneswaran's user avatar

There seem to be some deleted comments, but for clarity, Microsoft calls bash.exe a «historic command» in that page you linked to. I don’t consider it «deprecated» (since, as you point out, they explicitly list deprecated commands). But «historic» is, IMHO, just one step before «deprecated.» Also, the WSL/Windows Interop documentation, says «bash.exe has been replaced with wsl.exe» (emphasis added).

Anyway, the recommended way of launching is (currently) certainly through the wsl.exe command, since it provides many more options and is more robust. It’s also possible for distributions such as Alpine to not even include a bash shell, so it’s a bit of a misnomer anyway.

Not that bash.exe itself is likely your problem. It’s just that you’ll probably need the features of wsl.exe to recover.

You note that you installed the Ubuntu and Debian after this problem started happening. Does this mean that you were only running the Docker Desktop prior to this? A typical installation for WSL is to:

  • Install the WSL feature itself (along with the WSL2 kernel)
  • Install a distribution
  • Then install Docker Desktop

However, if you only had the two docker-desktop* instances, it would seem that you never installed any other distribution. This isn’t really recommended. The docker-desktop instance is launchable, but I believe it is really designed for Docker Desktop’s internal use (e.g. setting up the Docker sockets). I could be wrong on this …

As to why bash.exe is no longer launching your default docker-desktop container, I’m not sure, but it’s likely something to do with your bash startup configuration. When WSL exits without any error message, that’s usually due to a problem inside the instance. WSL does not appear to redirect stderr back to the host, or perhaps it just needs some redirection to do so that I haven’t delved into yet.

To try to find out what’s going wrong inside, try launching with any of the following:

wsl -e bash --noprofile --norc # Launches without any startup profile
wsl -u root # Launches as root instead of the default user
wsl -e sh # Launches the dash shell instead of bash
wsl -u root -e sh # Same as above, but as root

If one or more of those work, then you can begin troubleshooting your startup configuration from there. If you are able to launch as root, then you can su yourusername to switch to your user. Since you are launching from inside the WSL instance, you should be able to see any error messages that could be suppressed when running from the Windows command prompt.

Ultimately, though, I’d recommend you set a different distribution as default, via:

wsl --set-default Ubuntu

You can still get back to the «docker-desktop» distribution to copy out any needed files via wsl -d docker-desktop (append any of the previously discussed options if those help you launch it without error).

There seem to be some deleted comments, but for clarity, Microsoft calls bash.exe a «historic command» in that page you linked to. I don’t consider it «deprecated» (since, as you point out, they explicitly list deprecated commands). But «historic» is, IMHO, just one step before «deprecated.» Also, the WSL/Windows Interop documentation, says «bash.exe has been replaced with wsl.exe» (emphasis added).

Anyway, the recommended way of launching is (currently) certainly through the wsl.exe command, since it provides many more options and is more robust. It’s also possible for distributions such as Alpine to not even include a bash shell, so it’s a bit of a misnomer anyway.

Not that bash.exe itself is likely your problem. It’s just that you’ll probably need the features of wsl.exe to recover.

You note that you installed the Ubuntu and Debian after this problem started happening. Does this mean that you were only running the Docker Desktop prior to this? A typical installation for WSL is to:

  • Install the WSL feature itself (along with the WSL2 kernel)
  • Install a distribution
  • Then install Docker Desktop

However, if you only had the two docker-desktop* instances, it would seem that you never installed any other distribution. This isn’t really recommended. The docker-desktop instance is launchable, but I believe it is really designed for Docker Desktop’s internal use (e.g. setting up the Docker sockets). I could be wrong on this …

As to why bash.exe is no longer launching your default docker-desktop container, I’m not sure, but it’s likely something to do with your bash startup configuration. When WSL exits without any error message, that’s usually due to a problem inside the instance. WSL does not appear to redirect stderr back to the host, or perhaps it just needs some redirection to do so that I haven’t delved into yet.

To try to find out what’s going wrong inside, try launching with any of the following:

wsl -e bash --noprofile --norc # Launches without any startup profile
wsl -u root # Launches as root instead of the default user
wsl -e sh # Launches the dash shell instead of bash
wsl -u root -e sh # Same as above, but as root

If one or more of those work, then you can begin troubleshooting your startup configuration from there. If you are able to launch as root, then you can su yourusername to switch to your user. Since you are launching from inside the WSL instance, you should be able to see any error messages that could be suppressed when running from the Windows command prompt.

Ultimately, though, I’d recommend you set a different distribution as default, via:

wsl --set-default Ubuntu

You can still get back to the «docker-desktop» distribution to copy out any needed files via wsl -d docker-desktop (append any of the previously discussed options if those help you launch it without error).

Перейти к содержанию

На чтение 2 мин. Просмотров 129 Опубликовано 03.05.2021

Если вы пытаетесь запустить Bash на Ubuntu в Windows 10 и получаете следующее сообщение об ошибке:

Неподдерживаемые настройки консоли. Для использования этой функции устаревшая консоль должна быть отключена.

вот быстрое решение, которое поможет вам быстро решить эту проблему.
Если вы столкнулись с указанной проблемой, сообщение об ошибке появляется только в командной строке. Когда вы нажимаете ярлык меню «Пуск» в Bash, он мигает, а затем исчезает. Если вы попытаетесь запустить Bash, как показано в статье Запуск команд Linux из командной строки cmd.exe в Windows 10, он выдаст следующий результат:

Чтобы решить эту проблему, единственное, что вам нужно сделать, это отключить устаревший режим в свойствах командной строки.

В Windows 10 в командной строке появилось несколько улучшения. К ним относятся возможность свободно изменять его размер, новые горячие клавиши и новые возможности выбора текста. См. Следующую статью: Командная строка была дополнительно улучшена в Windows 10.

Благодаря этим изменениям командная строка в Windows 10 может быть закрыта с помощью Alt + F4, имеет прозрачный фон и может также можно открывать в полноэкранном режиме.

Все эти новые функции можно отключить с помощью параметра «Использовать устаревшую консоль» в свойствах, как показано ниже:

Если новые функции консоли отключены, это приведет к неправильной работе Bash на Ubuntu в Windows 10.

Решение очень простое. . Снимите отметку с указанной опции и снова откройте Bash в Ubuntu. Должно работать.

‘);

При попытке запустить Bash.exe (Bash на Ubuntu в Windows) в Windows 10 окно консоли может открываться и закрываться немедленно. Это происходит, если для командной строки включен устаревший режим.

Кроме того, если вы откроете окно командной строки и наберете bash.exe, появится следующая ошибка:

Неподдерживаемые настройки консоли. Для использования этой функции устаревшая консоль должна быть отключена.

Если у вас есть ярлык командной строки (cmd.exe), щелкните правой кнопкой мыши ярлык и выберите Свойства. На вкладке «Параметры» снимите флажок «Использовать устаревшую консоль» (требуется перезапуск).

Ошибка устаревшего режима командной строки bash

Если у вас нет ярлыка для командной строки, откройте окно командной строки (cmd.exe), щелкните правой кнопкой мыши строку заголовка и выберите Свойства. На вкладке «Параметры» вы можете отключить устаревший режим. Это будет применяться во всем мире.

Чтобы применить настройки для нескольких систем с использованием скрипта или пакетного файла, вот команда, необходимая для отключения устаревшего режима.

REG.EXE ADD HKCUConsole /v ForceV2 /t REG_DWORD /d 1 /f

После этого Bash теперь должен запускаться правильно.

RRS feed

  • Remove From My Forums
  • Общие обсуждения

  • Bash не работает, не реагирует на вводимую информацию. Windows 10 Pro 64 bit, Режим разработчика включил, поставил компонент
    системы. Bash в первый раз загрузился, принял мое разрешение и скачал пакеты, уведомил об успешной установке и завис.

    • Изменен тип
      Anton Sashev Ivanov
      16 августа 2016 г. 5:41
      обсуждение

Все ответы

  • Та же хрень, все установилось и в первый раз нормально запустилось, адекватно работали вводимые команды, после повторного запуска процесс наглухо зависает, пробывал запускать из ярлыка, из PowerShell, из CMD, также непосредственно C:WindowsSystem32bash.exe
    и все тоже самое но с админправами, в результате во всех случаях выдает «Ошибка: 0x80080005».

я следовал инструкциям, которые широко доступны для включения bash в Windows 10. Я обновил Windows, включил режим разработчика, включил «подсистему Windows для Linux (бета-версия)» в настройках программы и перезагрузил компьютер. Но когда вы ищете «bash» в меню «Пуск» и нажимаете на него, он делает что-то за долю секунды, а затем ничего не происходит; в основном ничего не делает и ничего не открывает.
Я попытался сделать это в системе, а также через подключение к удаленному рабочему столу с другого машина. Ни то, ни другое не сработало.

затем я попытался щелкнуть правой кнопкой мыши на » bash «и запустить его от имени администратора (мой пользователь уже является администратором в любом случае), но он выдает следующую ошибку:» устройство, подключенное к системе, не работает.»

Я открываю cmd и тип bash, и я получаю эту ошибку: «неподдерживаемые параметры консоли. Для использования этой функции устаревшая консоль должна быть отключена.»

любая помощь на что?

спасибо!

источник

Понравилась статья? Поделить с друзьями:
  • Bash wget command not found windows
  • Bash pip command not found windows что делать
  • Bash php command not found windows
  • Bash on ubuntu on windows install
  • Bash npm command not found windows