WSL (Windows Subsystem for Linux)
Posted: Tue Aug 30, 2016 12:48 am
Hi all,
First off, Mods, if you feel there is a better place for this, feel free to move it.
For anyone who (like me) has Windows 10, you can now install the anniversary update for Windows 10 (if you haven't already), and therefore have access to WSL. WSL is the Windows Subsystem for Linux, very similar to SUA, or Cygwin/MinGW/DJGPP except its fully supported/maintained/"created" by M$. To install it (If you have all the appropriate updates) goto your control panel, (and make sure you aren't looking at categories) then select/click Programs and Features. In the left hand menu you can find "Turn Windows features on or off" and in that window you need to check "Windows Subsystem for Linux (Beta)". After it is installed, you MUST (Yes MUST) reboot. I know most updates/installs do not actually care if you reboot, this one does! After reboot, you can run Bash from your start menu, this will trigger a brief setup process and then you will have a "full" install of Ubuntu (14.04) running side-by-side with your normal Windows GUI.
Please realise, this is a side-by-side "install"! WSL can not directly interact with your desktop session, and vice verse. That being said, it is more integrated than any other option in the past. From inside of Bash, you can view, edit, create, and delete from your Windows files easily enough through "/mnt/[drive letter]/path/to/file" and you can view your "linux" files in "%APPDATA%\Local\lxss". The only thing to remember is that while any instance of Bash is running, any changes you make in Windows in "%APPDATA%\Local\lxss" will not be visible from within WSL/Linux due to caching. I work around this by sym-linking a folder or 2 that use frequently into my home dir.
Also, worth note is that from Windows, you can "run" a shell script (*.sh) and Windows will open a bash session, run the script and exit (Run to completion and exit). You can also run 'bash -e "path\to\script.sh"' to run a Bash script with a windows path, or "bash -c 'command -option option2'" to run a command. The first does not work correctly (as far as I'm concerned) where as the next 2 run fine in every instance I've tried. (The main difference being that the first does not produce output in a command prompt, where as the next 2 do).
All that being said, I am working on testing/"debugging" our current Bare Bone/instructions in WSL to determine what needs to be clarified. I have not start an actual tutorial yet, but I have started to list my notes on the Wiki at one of my User Pages.
Feel free to take a look at my notes, try and reproduce success (I used binutils 2.27 and gcc 6.2 for my cross compiler) in WSL, or add any additional notes you might have. I will try to combine what I find with what you guys add to create a Tutorial that can be added to Bare_Bones to help everyone.
- Monk
First off, Mods, if you feel there is a better place for this, feel free to move it.
For anyone who (like me) has Windows 10, you can now install the anniversary update for Windows 10 (if you haven't already), and therefore have access to WSL. WSL is the Windows Subsystem for Linux, very similar to SUA, or Cygwin/MinGW/DJGPP except its fully supported/maintained/"created" by M$. To install it (If you have all the appropriate updates) goto your control panel, (and make sure you aren't looking at categories) then select/click Programs and Features. In the left hand menu you can find "Turn Windows features on or off" and in that window you need to check "Windows Subsystem for Linux (Beta)". After it is installed, you MUST (Yes MUST) reboot. I know most updates/installs do not actually care if you reboot, this one does! After reboot, you can run Bash from your start menu, this will trigger a brief setup process and then you will have a "full" install of Ubuntu (14.04) running side-by-side with your normal Windows GUI.
Please realise, this is a side-by-side "install"! WSL can not directly interact with your desktop session, and vice verse. That being said, it is more integrated than any other option in the past. From inside of Bash, you can view, edit, create, and delete from your Windows files easily enough through "/mnt/[drive letter]/path/to/file" and you can view your "linux" files in "%APPDATA%\Local\lxss". The only thing to remember is that while any instance of Bash is running, any changes you make in Windows in "%APPDATA%\Local\lxss" will not be visible from within WSL/Linux due to caching. I work around this by sym-linking a folder or 2 that use frequently into my home dir.
Also, worth note is that from Windows, you can "run" a shell script (*.sh) and Windows will open a bash session, run the script and exit (Run to completion and exit). You can also run 'bash -e "path\to\script.sh"' to run a Bash script with a windows path, or "bash -c 'command -option option2'" to run a command. The first does not work correctly (as far as I'm concerned) where as the next 2 run fine in every instance I've tried. (The main difference being that the first does not produce output in a command prompt, where as the next 2 do).
All that being said, I am working on testing/"debugging" our current Bare Bone/instructions in WSL to determine what needs to be clarified. I have not start an actual tutorial yet, but I have started to list my notes on the Wiki at one of my User Pages.
Feel free to take a look at my notes, try and reproduce success (I used binutils 2.27 and gcc 6.2 for my cross compiler) in WSL, or add any additional notes you might have. I will try to combine what I find with what you guys add to create a Tutorial that can be added to Bare_Bones to help everyone.
- Monk