Tool

shared-folder-in-windows-subsystem-for-linux

BaeMinCheon 2019. 2. 16. 15:47

shared-folder-in-windows-subsystem-for-linux

  • this post covers how to share a folder(including files) in WSL
  • environment
    • Windows 10 / Home
    • WSL / Ubuntu 18.04 LTS
    • Visual Studio Code

pre-task

  • install WSL in your Windows 10
    • open the Microsoft Store
    • search for Ubuntu
    • click Ubuntu 18.04 LTS
    • get and install it
  • prepare the environment
    • initialize your WSL


  • make a folder in some directory on Windows
    • ex) D:\Code\LinuxShare

  • make a link in some directory on WSL
    • format) ln -s /mnt/[partition]/[folder...] [link-name]
    • ex) ln -s /mnt/d/Code/LinuxShare share-with-windows

make-file

  • make a text file on Windows side
    • ex) D:\Code\LinuxShare\test.txt

  • check out the text file on WSL side
    • ex) ~/share-with-windows/test.txt


  • edit the text file and save it on WSL side
    • ex) hello WSL ! → hello Windows !

  • check out the text file on Windows side

typing-and-compiling


  • make a c file and edit it on Windows side
    • ex) D:\Code\LinuxShare\test.c

  • compile the c file and execute it
    • ex) ~/share-with-windows/test.c
  • you can now type texts on Windows and compile that on WSL

  • also output file, a.out will be seen on Windows side