FAYT / Filter Bar Activation: WSL Command

Considering the Windows Subsystem for Linux is out of Beta and even available in Windows Server would you consider adding a "WSL Command:" command line to complement the existing "DOS Command"?

1 Like

I'm not really sure what it would do. Don't you have to run some sort of environment (e.g. ubuntu) before you can run Linux commands?

Nope, you don't. That's why it's so cool... No waiting for a VM to boot up. It's even faster than an SSH connection on a fast local network. It's instant.

When you install the Windows Subsystem for Linux, your Windows Kernel replaces the jobs that the Linux Kernel was doing... and directly runs the Linux "ELF" binaries, without a delay.

Some day it may be common for users to have many Linux distributions running simultaneously. You can do it today with Ubuntu + SUSE + SUSE Enterprise... But Fedora is coming, and more should follow soon after.

WSL provides an interface to choose your "default" distribution, and this I think is what Opus would tie into.

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:\>wslconfig /list /all                                                                                                
Windows Subsystem for Linux Distributions:                                                                              
Ubuntu (Default)                                                                                                        
openSUSE-42

Win + R: wsl

$ # already at Linux shell prompt... instant

Win + R: cmd

> Or from cmd move to the Linux prompt with:

wsl<enter>

$ # now we're back at the Linux prompt

> Or from cmd use: Ubuntu.exe, like:

> Ubuntu.exe run dash

# Or

> openSUSE-42 run top

If a lot of people start using WSL with Opus, then it could make sense to allow commands to be run in whatever WSL distribution, but for now, just using the default distribution akin to the wsl.exe command seems like a big win!

So is it just a matter of prepending wsl.exe to any commands you type? E.g. in the hypothetical WSL mode, if you typed ls -l Opus would run wsl.exe ls -l behind the scenes?

Exactly!

C:\>wsl uptime
17:15:16 up  7:47,  0 users,  load average: 0.52, 0.58, 0.59  

Ok, thanks for the explanation :slight_smile: