Перейти к содержимому

Enter new unix username что вводить

  • автор:

Sorry, you have been blocked

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: 7a28bb06fd0f77b5 • Your IP: Click to reveal 88.135.219.175 • Performance & security by Cloudflare

Windows Subsystem for Linux

William (Will) Lohan

Windows Subsystem for Linux (WSL) lets you run software designed for Linux. This gives Windows users access to tools and web developers environments closer resembling that of their peers or the webservers hosting their code.

First make sure Windows is updated, WSL required additional setup steps prior to version 2004. Then run open PowerShell (as Admin) and run wsl —list —online . This will list all the available OS’s for WSL.

Pick your favorite flavor, mine is Ubuntu or Debian if I think I might need any older tools. Then run wsl —install -d <Distro> .

After a while you will see this prompt. Enter a user name that you want to use for the Linux environment and password twice.

If all goes well you should land in a Linux prompt like this.

Run sudo apt update to refresh all your apt-get repos.

Then all your favorite tools.

Note: If you are looking to get into C or C++ development build-essential is a good package to remember to get compilers

Visual Studio Code Integration

You can use your regular Windows installation of Visual Studio Code to interact directly with the Linux environment. Install the Remote Development extension pack or just Remote — WSL. Then you can use the Remote Explorer to browse WSL Targets (WSL OS’s you’ve installed). All the projects and files are in and commands run in the Linux environment.

Visual Studio Code showing a side panel with a list of "WSL Targets". There are two targets: Debian and Ubuntu with a project called "my-project" active in Ubuntu

Note: The Remote Development extension pack also includes Remote — SSH which allows you to interact with remote Linux environments exactly the same way

Как работать с Linux используя Windows

Как работать с Linux используя Windows

Если вы только начали свой путь разработчика и до сих используете операционную систему семейства Microsoft Windows, то уже наверняка столкнулись с ситуацией, когда ваш инструментарий отличается от того, что установлено у большинства людей из этой профессии. Чаще всего проблемы начинаются при работе в командной строке. Дело в том, что Windows не является POSIX-совместимой операционной системой, поэтому в ней отсутствует базовый набор прикладных программ, который необходим для разработки.

Несмотря на все написанное дальше, наша основная рекомендация — ставить полноценный Linux-дистрибутив, например, Ubuntu и полностью погружаться в него. Подавляющее большинство веб-проектов работает под управлением Linux-систем. А постоянное использование такой системы на домашнем и рабочем компьютере равносильно погружению в языковую среду при изучении иностранных языков.

Для новичков есть способ проще и быстрее — технологии виртуализации. Об этом и поговорим.

Ubuntu из Microsoft Store

Если вы работаете на Windows версии не ниже 10 с архитектурой x64, то можно можно воспользоваться встроенным решением и установить слой совместимости (Windows Subsystem for Linux), а затем дистрибутив на основе Ubuntu Linux через магазин приложений Microsoft Store.

Подсистема WSL поставляется вместе с Windows, но не включена по-умолчанию. Чтобы её активировать, необходимо открыть PowerShell и ввести команду:

Также эта команда скачивает и устанавливает дистрибутив Ubuntu Linux. Скорее всего после завершения установки потребуется перезагрузить компьютер.

После перезагрузки найдите в меню Пуск приложение Ubuntu и запустите его.

Первый запуск может вызвать ошибку Error: 0x8007007e и предложение прочитать инструкцию по её решению https://aka.ms/wslinstall. Если хотите сэкономить время, то просто запустите PowerShell (не путать с cmd ) от имени администратора и выполните следующую команду:

После этого компьютер попросит перегрузиться, а потом нужно снова запустить приложение Ubuntu. В случае удачной установки откроется интерпретатор командной строки с предложением ввести имя пользователя и пароль. Выглядеть это будет вот так:

Данные логин и пароль никак не связаны с вашим пользователем в Windows, придумайте новые и не забывайте их. Чтобы изменить пароль Ubuntu в будущем, вам пригодится команда passwd

Обратите внимание на данные официальные инструкции от Microsoft, где рассмотрены не только установка и настройка WSL и Ubuntu, но так же рассказано о настройке окружения для разработки (VSCode, Git)

Другие способы

Если у вас нет возможности установить WSL, то можно использовать другие способы виртуализации для установки Linux. Смотрите другие наши гайды:

Ubuntu on Windows (WSL)

At work I often need to use software or CLI only available on Linux, while keeping contact with my co-workers require access to Microsoft Office and other Windows products.
Back in the days, the only solution was to have two machines and transfer data across. Later came the idea of dual boot, installing both OS on one machine. But we needed to reboot the machine everytime we wanted to change OS. Then I came across VirtualBox, a software running on Windows, that allows to install a Linux OS. The limitation was that CPUs, disk space and RAM were divided between the two OS running concurrently, reducing significantly the compute power of the machine.

Today, a new solution exists: Windows Subsystem for Linux (WSL). It allows to install Linux OS, as a software running on Windows. the Linux core has full access to the resources of the machine, and is fully integrated.

WSL Installation

  • Prerequisites: Windows 10 Build 19041 and higher.
  • Search for Windows PowerShell and click on «Run as administrator»
  • In the terminal, type:

Exit fullscreen mode

  • Reboot the machine

Ubuntu Installation

wslfetch

  • Ensure that you are connected to internet.
  • Launch the newly installed application «Ubuntu»
  • Wait for the installation process
  • Enter new UNIX username
  • Enter new password
  • Retype new password
  • Check Linux version

Exit fullscreen mode

Access files

Note that Windows «do not know about» linux file system, but Linux can access all the files in Windows. By default Windows file system is mounted in Linux at /mnt/c/ . I recommand to create a symlink (shortcut) of Documents and Downloads , the most used Windows folders, in Linux home directory. That way, the access to data is simplified.

Exit fullscreen mode

Fonts

We will change the default font of the terminal in preparation for the theme we will install later.

  • Open the web browser
  • Visit powerlevel10K — Fonts
  • Install the recommended fonts (MenloLGS)
    • Download the font files from the github links
    • Open the .ttf file
    • Click on «Install»

    Color theme

    Default terminal colors can be inappropriate. They do not play well with the theme we will install later. To address this issue we will follow tomorrow color theme. Note tomorrow do not provide a theme file dedicated to windows default terminal, but we can define the colors manually.

    • Open Ubuntu
    • Right-click on the logo at the top left corner
    • Select «Properties»
    • Select «Colors»
    • Update the «Color Values» for each color as per the list below

    from base16-tomorrow-night
    first column is the original value, third column is the tomorrow theme value

    Exit fullscreen mode

    • Select the first color
    • Click «OK»

    colors

    Oh My Zsh

    WSL come with a minimal terminal. In this section, we will configure the terminal to add some features and style using Oh My ZSH and the theme Powerlevel10k.

    • Open «Ubuntu»

    Exit fullscreen mode

    • Open «Ubuntu»
    • Setup Zsh, type 0
    • Install Oh My Zsh

    Exit fullscreen mode

    OMZ

    Powerlevel10K

    Theme that add useful infomation right in the prompt.

    • Open the web browser Visite powerlevel10k
    • Follow Powerlevel install instructions.

    Exit fullscreen mode

    • Install zsh-autosuggestions plugin that provides autocompletion based on our previous commands

    Exit fullscreen mode

    • Install exa a modern replacement for ls.

    Exit fullscreen mode

    • Edit .zshrc to enable powerlevel theme

    Exit fullscreen mode

    • Press ‘insert’ to enter insert mode
    • Uncomment options and edit file as follow.

    Exit fullscreen mode

    • Press ‘esc’ to exit insert mode
    • Press ‘:’ and ‘x’ end ‘return’ to save and quit the file
    • Update Terminal

    Exit fullscreen mode

    • Follow instructions to customise the prompt

    powerlevel

    Top comments (0)

    For further actions, you may consider blocking this person and/or reporting abuse

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *