create account

Cool things you can do with Windows Subsystem for Linux by themarkymark

View this thread on: hive.blogpeakd.comecency.com
· @themarkymark ·
$49.13
Cool things you can do with Windows Subsystem for Linux
![image.png](https://files.peakd.com/file/peakd-hive/themarkymark/MVHauj9F-image.png)

While Windows Subsystem for Linux (WSL) gives you a nearly full Linux experience while inside of Windows 10.  There are a few things you can do with it that will make you more productive.

# Explore from here

From the Linux shell, you can open an explorer window by typing in `explorer.exe .`

https://i.imgur.com/kr4IrAA.png

A second later you will see an explorer window open from your current directory.

https://i.imgur.com/ZM36Flc.png

This is really handy when trying to access the Linux part of the file system saving you a lot of time navigating for it.

---

# Run multiple distributions

You are not limited to one distribution.  You can run Ubuntu 18.04 and have 20.04 installed alongside it.  Want to play around with Kali Linux?  Go ahead and install that as well.

Each distribution is very small, for example Kali Linux is only 187Mb.

https://i.imgur.com/fgx4IQm.png

---

# Backup your distribution

Want to create backups of your Linux distribution? 
Want to move your distribution to another machine?

The --export option will allow you to export your distribution to a tar file.

`wsl --export kali-linux ./kali.tar`

**Super easy, barely an inconvenience.**

You can use --import to import a distribution you exported previously.

---

# Open current folder as project in Code

This is my favorite feature of WSL combined w/ VS Code.

You will need to first install the Remote-WSL Extension inside of VS Code.

https://i.imgur.com/ae8vnmF.png

Once installed, you can just type in `code .` in any folder and open it as a project in VS Code.

If this is the first time doing it, VS Code Server files will be installed on the remote.

https://i.imgur.com/o83gtDr.png

Once finished, VS Code will launch.

https://i.imgur.com/bNYHDjd.png

As you can see the folder is opened as a project right in VS Code.

In the bottom left you can see the Remote-WSL module activated.

https://i.imgur.com/Bal6cZR.png

Here is where the real magic happens.

If you go to the VS Code terminal, you are in a bash shell inside of your Linux distribution.

https://i.imgur.com/0vrFT4U.png

It will be as if you are running VS Code directly in your Linux distribution.  As you develop, debug, and run your code, it will all be done in the context of your WSL instance.

**How awesome is that?**

---

# Take advantage of the WSL shared folder

Did you know you can access your local drives from within WSL using `/mnt/c` and whatever other drive letters you have?

You can also access a shared folder specifically for WSL distributions by using `/mnt/wsl`

Got configuration files or scripts you want to share between your Linux distributions?  This is a great way to do it.

---

# Install Docker 

Docker is one of the biggest benefits of WSL 2.0.  It wasn't until WSL 2.0 that Docker became truly useful on Windows.

All you need to do is install [Docker Desktop For Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows/) to install Docker for Windows and WSL.

Inside the Dockers for Windows settings, you need to turn on WSL 2.0 engine if you want to have the improved support.

https://i.imgur.com/kvDaMEZ.png

---

# Forget your IP!

Previously with WSL you had to check what IP you were using and constantly have to update it on each reboot to connect to any services running on your WSL instance even SSH.

Not too long ago Microsoft added the support to use `localhost` on your Windows machine to connect to your WSL instance.  This short cut won't work if you have two WSL distributions running at once though.

It will allow you easy access to SSH and other services by just doing `ssh localhost`.  You may have problems running SSH on port 22 as Windows 10 now has SSH support as well.  If this is the case, go into your sshd_config file and change the port number.

---

# Pipe commands to WSL

This one is going to blow your mind.  Take a seat, and brace yourself.

By using `wsl` you can launch Linux commands from your Linux distribution right in Windows.

https://i.imgur.com/T6HPOeX.png

https://i.imgur.com/bBipD0U.png

How freaking cool is that?

---

# Access WSL file system from inside of Linux

If you were paying close attention during the first tip, you might have noticed there is now a UNC path for WSL.

`\\wsl$\Ubuntu-20.04\home\mal`

This opens my home folder on my Ubuntu-20.04 distribution from Windows Explorer.

---

<center>Securely chat with me on [Keybase](https://keybase.io/officialmarky)
<center>https://steemitimages.com/DQmcWxV1dpA1eAtw2ipwZiWZkydyVNU5LaLa2Ak1GUnbGmS/The-Marky-Mark.png </center>
# <center>  [Why you should vote me as witness](https://peakd.com/witness-category/@themarkymark/why-you-should-vote-for-themarkymark-as-witness)  </center> #







👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 270 others
👎  , , , , , , , , , , , , ,
properties (23)
authorthemarkymark
permlinkcool-things-you-can-do-with-windows-subsystem-for-linux
categorylinux
json_metadata{"app":"peakd/2020.05.5","format":"markdown","tags":["linux","wsl","tutorial","technology","palnet","neoxian"],"users":["themarkymark"],"links":["https://hub.docker.com/editions/community/docker-ce-desktop-windows/","https://keybase.io/officialmarky","/witness-category/@themarkymark/why-you-should-vote-for-themarkymark-as-witness"],"image":["https://files.peakd.com/file/peakd-hive/themarkymark/MVHauj9F-image.png","https://i.imgur.com/kr4IrAA.png","https://i.imgur.com/ZM36Flc.png","https://i.imgur.com/fgx4IQm.png","https://i.imgur.com/ae8vnmF.png","https://i.imgur.com/o83gtDr.png","https://i.imgur.com/bNYHDjd.png","https://i.imgur.com/Bal6cZR.png","https://i.imgur.com/0vrFT4U.png","https://i.imgur.com/kvDaMEZ.png","https://i.imgur.com/T6HPOeX.png","https://i.imgur.com/bBipD0U.png","https://steemitimages.com/DQmcWxV1dpA1eAtw2ipwZiWZkydyVNU5LaLa2Ak1GUnbGmS/The-Marky-Mark.png"]}
created2020-06-09 06:24:24
last_update2020-06-09 06:24:24
depth0
children4
last_payout2020-06-16 06:24:24
cashout_time1969-12-31 23:59:59
total_payout_value27.300 HBD
curator_payout_value21.831 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,819
author_reputation1,772,918,693,450,156
root_title"Cool things you can do with Windows Subsystem for Linux"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,858,086
net_rshares104,756,803,356,409
author_curate_reward""
vote details (348)
@geyzee ·
Wow. Thanks for taking time to explain this exhaustively 💯🙏. I'm so going to install this. I'd give you some highlights of how it goes
properties (22)
authorgeyzee
permlinkqbnlmu
categorylinux
json_metadata{"app":"hiveblog/0.1"}
created2020-06-09 10:12:12
last_update2020-06-09 10:12:12
depth1
children0
last_payout2020-06-16 10:12:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length134
author_reputation15,822,100,131,595
root_title"Cool things you can do with Windows Subsystem for Linux"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,860,744
net_rshares0
@j3dy ·
Yeah WSL's great, although I'm still taking my first steps in development. It took me a few days to install python, node, go, setup the variables and update the windows. I'm still getting used to writing commands in a cli ... and the whole abbreviations and shorthands is going to take a while, that and managing all the accounts, libraries and dependencies ... 

Development sure is fun, but at least I'm not programming and actually writing things from scratch.

Linux also always amazed me with how clean and simple everything is, if you know all the commands and the basics that is :) 

oh and, have you written anything in GO?
properties (22)
authorj3dy
permlinkqbo48i
categorylinux
json_metadata{"app":"hiveblog/0.1"}
created2020-06-09 16:53:09
last_update2020-06-09 16:53:09
depth1
children1
last_payout2020-06-16 16:53:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length631
author_reputation9,439,758,416,991
root_title"Cool things you can do with Windows Subsystem for Linux"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,866,630
net_rshares0
@themarkymark ·
I haven't played around with GO, but a lot of people talk good things about it.
If I needed something fairly high level that performance was a problem that JS or Python couldn't do efficiently, I'd look at GO.
👍  
properties (23)
authorthemarkymark
permlinkre-j3dy-qbo4av
categorylinux
json_metadata{"tags":["linux"],"app":"peakd/2020.05.5"}
created2020-06-09 16:54:30
last_update2020-06-09 16:54:30
depth2
children0
last_payout2020-06-16 16:54:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length209
author_reputation1,772,918,693,450,156
root_title"Cool things you can do with Windows Subsystem for Linux"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,866,660
net_rshares4,986,307,081
author_curate_reward""
vote details (1)
@oredebby ·
Amazing innovation, amazing technology and an amaxing tutorial. Thanks for this bruv. Linux all the way.
properties (22)
authororedebby
permlinkqbnblv
categorylinux
json_metadata{"app":"hiveblog/0.1"}
created2020-06-09 06:34:06
last_update2020-06-09 06:34:06
depth1
children0
last_payout2020-06-16 06:34:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length104
author_reputation148,270,038,921,665
root_title"Cool things you can do with Windows Subsystem for Linux"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,858,206
net_rshares0