Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Google+ Youtube

Github Stackoverflow Pinterest

It’s less like Power Rangers clicking rings, more like living in a foreign country

Overview

As of this writing (June 2017), this was as its first “beta” release.

### Enable Windows Subsystem for Linux feature (GUI)

  1. From Start, type in the search box

    Turn Windows features on or off
    

    and select it when it appears.

    Please wait a while for all items to appear.

  2. Select “Windows Subsystem for Linux (beta)”, then click OK to exit dialog, then Restart your computer.

    This option was added since the “Anniversary” and “Creators Update” of Windows 10.

    Skip to next topic if you see it.

    Don’t see it?

    Verify your PC’s CPU architecture and Windows version/build number:

  3. Start: Click the Windows icon or keyboard key to open Settings, System, About.

    If your OS Build is not above 14393, update. You need the Windows 10 Anniversary Update. Creators Update is recommended.

    If your System type is not “64-bit”, get another computer.

    Turn on Developer Mode

  4. Open Settings -> Update and Security -> For developers
  5. Check the Developer Mode radio button to “install any signed app”.

    First time Bash

  6. Open a command prompt (click Start and type Command, then select it from the list that arises)

    QUESTION: Run as Administrator/elevated?

  7. Type:

    bash
    

    During Beta period, this message appears:

    -- Beta feature --
    This will install Ubuntu on Windows, distributed by Canonical
    and licensed under its terms available here:
    https://aka.ms/uowterms
    
  8. Type y and press Enter to continue. The response:

    Downloading from the Windows Store... 100%
    Extracting filesystem, this will take a few minutes...
    Installation successful~
    Please enter a UNIX user name: _
    

    QUESTION: What is downloaded and can it be deleted?

    The image downloaded is a Ubuntu user-mode image.

  9. Type a user name

    Enter new UNIX password: _
    

    This username and password can be different from, and has no relationship to Windows username and password.

    PROTIP: The user is not root.

    https://msdn.microsoft.com/en-us/commandline/wsl/user_support

  10. Type a password.

    A shortcut is added to your start menu named:

    Bash on Ubuntu on Windows

  11. Click it so you don’t have to type “bash”.

    By default, the prompt is your Linux user name @ your machine name:/mnt/c/Users/%USERNAME%$

    Folders and variables

  12. See where Ubuntu is installed using a Windows system variable referenced using Windows % wrapper rather than Bash $ prefix.

    %localappdata%\lxss\
    

    The directory is marked as a hidden system folder. Creating and/or modifying files in this location using Windows tools and apps corrupts because it gets read-locked. An explanation is this.

    Edit files

  13. Create a project folder under a Linux mount for use by both Windows and Linux tools:

    cd /mnt/c/dev/
    mkdir project
    
  14. Access files from both Windows and from Bash as:

    /mnt/c/path
    
  15. Utilities:

    du -sh
    

Architecture

bash-windows-wsl file-system-graphic-1024x547

Lxcore.sys is the driver that recognizes Bash commands and other Linux utilities such as chmod to change permissions.

VFS is the Virtual File System.

From inside Bash, DrvFS gets to Windows.

From inside Windows, VolFS gets to Linux symbolic files and its case sensitivity.

NTFS is the NT File System controlling hard drives.

References

Links and issues for this are on:
https://github.com/Microsoft/BashOnWindows

https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

https://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support/ published 15 June 2016 by Jack Hammons, who writes:
https://blogs.msdn.microsoft.com/wsl, the home page of WSL.