Ubuntu now in the Windows Store: Updates to Linux on Windows 10 and Important Tips
I noticed this blog post about Ubuntu over at the Microsoft Command Line blog. Ubuntu is now available from the Windows Store for builds of Windows over 16215.
You can run "Winver" to see your build number of Windows. If you run Windows 10 you can certainly sign up for the Windows Insiders builds, or you can wait a few months until these features make their way to the mainstream. I've been running Windows 10 Insiders "Fast ring" for a while with a few issues but nothing blocking.
The addition of Ubuntu to the Windows Store may initially seem confusing or even a little bizarre. However, given a minute to understand the larger architecture it make a lot of sense. However, for those of us who have been beta-testing these features, the move to the Windows Store will require some manual steps in order for you to reap the benefits.
Here's how I see it.
- For the early betas of the Windows Subsystem for Linux you type bash from anywhere and it runs Ubuntu on Windows.
- Ubuntu on Windows hides its filesystem in C:\Users\scott\AppData\Local\somethingetcetc and you shouldn't go there or touch it.
- By moving the tar files and Linux distro installation into the store, that allows us users to use the Store's CDN (Content Distrubution Network) to get Distros quickly and easily.
- Just turn on the feature and REBOOT
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Just turn on the feature and REBOOT
then hit the store to get the binaries!
Ok, now this is where and why it gets interesting.
Soon (later this month I'm told) we will be able to have n number of native Linux distros on our Windows 10 machines at one time. You can install as many as you like from the store. No VMs, just fast Linux...on Windows!
There is a utility for the Windows Subsystem for Linux called "wslconfig" that Windows 10 has.
C:\>wslconfig
Performs administrative operations on Windows Subsystem for Linux
Usage:
/l, /list [/all] - Lists registered distributions.
/all - Optionally list all distributions, including distributions that
are currently being installed or uninstalled.
/s, /setdefault <DistributionName> - Sets the specified distribution as the default.
/u, /unregister <DistributionName> - Unregisters a distribution.
C:\WINDOWS\system32>wslconfig /l
Windows Subsystem for Linux Distributions:
Ubuntu (Default) Fedora
OpenSUSE
At this point when I type "bash" at the regular Windows command prompt or PowerShell I will be launching my default Linux. I can also just type "Ubuntu" or "Fedora," etc to get a specific one.
If I wanted to test my Linux code (.NET, node, go, ruby, whatever) I could script it from Windows and run my tests on n number of distros. Slick for developers.
TODOs if you have WSL and Bash from earlier betas
If you already have "bash" on your Windows 10 machine and want to move to the "many distros" you'll just install the Ubuntu distro from the store and then move your distro customizations out of the "legacy/beta bash" over to the "new train but beta although getting closer to release WSL." I copied my ~/ folder over to /mnt/c/Users/Scott/Desktop/WSLBackup, then opened Ubuntu and copied my .rc files and whatnot back in. Then I removed my original bash with lxrun /uninstall. Once I've done that, my distro are managed by the store and I can have as many as I like. Other than customizations, it's really easy (like, it's not a big deal and it's fast) to add or remove Linuxes on Windows 10 so fear not. Backup your stuff and this will be a 10 min operation, plus whatever apt-get installs you need to redo. Everything else is the same and you'll still want to continue storing and sharing files via /mnt/c.
NOTE: I did a YouTube video called Editing code and files on Windows Subsystem for Linux on Windows 10 that I'd love if you checked out and shared on social media!
Enjoy!
Sponsor: Seq is simple centralized logging, on your infrastructure, with great support for ASP.NET Core and Serilog. Version 4 adds integrated dashboards and alerts - check it out!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
code .I get
command not found: codeWhen I try to run
/mnt/c/Program\ Files\ \(x86\)/Microsoft\ VS\ Code/Code.exe .I get this error
exec format error: /mnt/c/Program Files (x86)/Microsoft VS Code/Code.exe
Unfortunately, I cannot install an Insider build as this is my work machine and I'd like to stay on Stable.
Thanks for the article!
Have a question, if I may. To use the Ubuntu app from VSCode, do we still use the:
"
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe",
"
or is there another way?
Thanks again!
Michael - Yes, bash will start the default linux, or you can use "Ubuntu" or "Fedora" for those.
Mark - The ability to run Windows exes happened in a later update then you have.
What’s new here is that it now has a proper Windows Store page.
http://nbviewer.jupyter.org/gist/denfromufa/1fdb51fc58663c2fb058f0860cb03768#demo-apps
Comments are closed.
Not Creators Update. Or at least it's not part of the %PATH% search variable, and "dir wslconfig.* /s" doesn't find it either.
I do have a very recent Insider release running in a VM, and I was going check on that, but it seems to be stuck "Working on updates 33%" right now - which is not good, as I had let it grab the latest update over 12 hours ago (as I'm writing this).