"rmdir C:\Users\Code /s /q" -> delete the windows side folder.Īll you're doing is just making a shortcut into the wsl distro, so you can see the project files from windows explorer. This is not a true solution, say you delete your wsl2 distro's ext4.vhdx, all of your project files are gone. With significantly faster I/O Operations and git. Now when we restart our computer the network drive will be available in "This PC" and Code directory symlink to WSL will be in your User Directory. Next click on Actions add New and Select the. This will look fairly simple, Just make sure it's like this, and click OK. Next click on Triggers tab and add new trigger. Also make sure you'll change Configure for: To Windows10 Now make sure you'll give a name to your task, then write a little description and Check "Run with highest privileges". Click on it and on the right sidebar click on Create Task. On the left sidebar you will see Task Scheduler Library. So go ahead and search for Task Scheduler. We also need to do that with the highest privileges because you need to be an admin to make a symlink from network drive to your base drive. Now when we have our script we need to run it every time we boot into our machine. Create a schedules task with highest privileges ⏱ When we have our script done go to File > Save as, and then choose a location where you know that your script will be safe, so you don't accidentally delete it, and name it mount_wsl.bat.Ģ. Unlike the WSL symlinks which work only in WSL. What this script does?īasically it will just mount your WSL as a network drive, and then it will create Windows Symlink, which will work in both Windows and WSL. The part that we need is that Ubuntu-20.04 in my case but that could be fedora or alpine or Ubuntu in your case. Now click on the adress bar again and you should see something like this This will open WSL Filesystem in Windows explorer. Just open up your WSL, type cd $HOME and then explorer.exe. Make sure you'll change you usernamesĮnter fullscreen mode Exit fullscreen mode But how should I get my WSL version? Open up notepad and paste the following lines in here. So you can start up CMD/PowerShell/Bash/WSL and cd right into code directory. Create a symlink from $HOME/Code to your User Directory. Unfortunately, you can't do a symlink from WSL to windows, which is my plan. You need to create a batch script that will take care of the symlink. Now, this took me a great 6 hours, to figure out all the things you need to do, so if you're stuck on the same issue, I hope my guide will help. But I knew I want something more pleasing. Sadly the only workaround I found was to move your projects into the WSL filesystem. So I started searching around web and I discovered this issue and it seems like this issue in only appearing in the /mnt directory. With all the excitement I downloaded it, and when I did cd into my project I quickly realized that something is wrong. Because it brings WSL2 as a production-ready product to our daily drivers. So Windows 2004 update is here, and I was really excited about this update.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |