사용자 도구

사이트 도구


windows:wsl

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
windows:wsl [2018/05/21 16:49]
kwon37xi [설치]
windows:wsl [2021/12/31 17:29] (현재)
kwon37xi
줄 2: 줄 2:
   * [[https://docs.microsoft.com/ko-kr/windows/wsl/about|Learn about the Windows Subsystem for Linux | Microsoft Docs]]   * [[https://docs.microsoft.com/ko-kr/windows/wsl/about|Learn about the Windows Subsystem for Linux | Microsoft Docs]]
   * Windows 10 이상에서 Ubuntu 등의 리눅스를 Native 처럼 깔아서 사용 가능하다.   * Windows 10 이상에서 Ubuntu 등의 리눅스를 Native 처럼 깔아서 사용 가능하다.
 +  * [[https://docs.microsoft.com/ko-kr/windows/wsl/wsl2-install|WSL 2 install]]
 +  * https://github.com/microsoft/WSL
   * [[https://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/|How to Access Your Ubuntu Bash Files in Windows (and Your Windows System Drive in Bash)]]   * [[https://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/|How to Access Your Ubuntu Bash Files in Windows (and Your Windows System Drive in Bash)]]
   * [[https://gist.github.com/wsargent/072319c2100ac0aea4305d6f6eeacc08|Windows Development Environment for Scala]]   * [[https://gist.github.com/wsargent/072319c2100ac0aea4305d6f6eeacc08|Windows Development Environment for Scala]]
   * [[https://github.com/goreliu/wsl-terminal|goreliu/wsl-terminal: Terminal emulator for Windows Subsystem for Linux (WSL)]]   * [[https://github.com/goreliu/wsl-terminal|goreliu/wsl-terminal: Terminal emulator for Windows Subsystem for Linux (WSL)]]
   * [[https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/|Configuring a pretty and usable terminal emulator for WSL]]   * [[https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/|Configuring a pretty and usable terminal emulator for WSL]]
 +  * [[https://docs.microsoft.com/ko-kr/windows/wsl/install-win10|Windows 10에 WSL(Linux용 Windows 하위 시스템) 2 설치 | Microsoft Docs]]
 +  * [[https://wslhub.com/|W$L/hub>_]]
 +  * [[https://devblogs.microsoft.com/commandline/a-preview-of-wsl-in-the-microsoft-store-is-now-available/|A preview of WSL in the Microsoft Store is now available! - Windows Command Line]]
 +
 +===== 원하는 배포판 설치 =====
 +  * [[windows:wsl:wsldl|windows:wsl:wsldl]]
 +  * [[https://docs.microsoft.com/en-us/windows/wsl/use-custom-distro#use-a-custom-linux-distribution|Import any Linux distribution to use with WSL | Microsoft Docs]]
 +  * Windows Store 에 없더라도 원하는 배포판을 설치할 수 있다.
 +  * [[https://docs.rockylinux.org/guides/interoperability/import_rocky_to_wsl_howto/|Import to WSL2 with Docker - Documentation]]
 +  * [[https://docs.rockylinux.org/guides/interoperability/rocky_to_wsl_howto/|Import To WSL with WSL and rinse - Documentation]]
  
 ===== 설치 ===== ===== 설치 =====
-  * https://docs.microsoft.com/ko-kr/windows/wsl/install-win10 참조 +  * https://docs.microsoft.com/ko-kr/windows/wsl/install-win10 참조 
 +  * Unicode Locale 지정<code sh> 
 +sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 
 +</code> 
 + 
 +===== Upgrade ===== 
 +  * 16.04 -> 18.04 업그레이드가 가능하다. [[https://superuser.com/questions/1317619/can-i-upgrade-my-existing-ubuntu-installation-in-wsl-from-16-04-to-18-04|windows subsystem for linux - Can I upgrade my existing Ubuntu installation in WSL from 16.04 to 18.04? - Super User]] 
 +  * [[https://blogs.msdn.microsoft.com/commandline/2018/07/09/upgrading-ubuntu/|A Guide to Upgrading your Ubuntu App’s Release – Windows Command Line Tools For Developers]] 
 + 
 +<code sh> 
 +# 기본적으로는 아래 명령만으로 가능. 
 +sudo do-release-upgrade -d 
 + 
 +lsb_release -a # 버전 검사 
 +</code> 
 + 
 +===== 성능 ===== 
 +  * 성능이 매우 떨어진다. 
 +  * [[https://medium.com/@leandrw/speeding-up-wsl-i-o-up-than-5x-fast-saving-a-lot-of-battery-life-cpu-usage-c3537dd03c74|Speeding up WSL I/O up than 5x fast + saving a lot of battery life & CPU usage]] 
 +  * 바이러스 백신 혹은 Windows Defender 의 실시간 감시를 끄고, ''%USERPROFILE%\AppData\Local\Packages'' 폴더에서 '' CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc'' 처럼 생긴 폴더를 제외 처리해주면 약간 빨라진다. 
 +  * 위 외에도 ''Ahnlab Safe Transaction'', ''nProtect'' 등의 강제로 설치되는 보안툴 때문일 수도 있다. 
 +  * 그래도 느린 느낌이라 결국 ''oh-my-bash'' 같은 것은 사용하지 않고 기본 [[:git|git]] Git + Color prompt 를 사용하고 있음. 
 + 
 +===== .bashrc, .bash_profile ===== 
 +  * ''.bash_profile''을 만들것이라면, 무조건 아래 항목이 있어야 ''.bashrc''를 로딩한다. 
 + 
 +<code sh> 
 +if [[ -f ~/.bashrc ]] ; then 
 +        . ~/.bashrc 
 +fi 
 +</code> 
 + 
 +===== Console ===== 
 +  * [[https://github.com/rprichard/wslbridge|wslbridge]] linux bash 콘솔을 Windows 콘솔과 통합해주는 중계자.
   * [[https://conemu.github.io/en/BashOnWindows.html|ConEmu | Bash on Ubuntu on Windows in ConEmu (WSL)]] [[windows:console:conemu|ConEmu Windows Terminal Emulator]] 사용하기   * [[https://conemu.github.io/en/BashOnWindows.html|ConEmu | Bash on Ubuntu on Windows in ConEmu (WSL)]] [[windows:console:conemu|ConEmu Windows Terminal Emulator]] 사용하기
 +  * [[https://conemu.github.io/en/BashOnWindows.html|ConEmu | Bash on Ubuntu on Windows in ConEmu (WSL)]] WSL Linux bash의 콘솔 접근방법이 Windows 표준과 달라서 ''wslbridge'' 등의 중계 방식이 필요하다.
   * conemu, wslterminal 등에서는 WSL Bash CPU 점유율이 폭증하는 현상이 있으나 cmder 에서는 정상 작동했음. -> WSL 최신버전 업그레이드하면 conemu 등에서도 문제 없다고 함.   * conemu, wslterminal 등에서는 WSL Bash CPU 점유율이 폭증하는 현상이 있으나 cmder 에서는 정상 작동했음. -> WSL 최신버전 업그레이드하면 conemu 등에서도 문제 없다고 함.
  
 ===== ssh-agent 대체 ===== ===== ssh-agent 대체 =====
-  * [[https://github.com/vuori/weasel-pageant|vuori/weasel-pageant: An ssh-agent compatible helper for interacting with Pageant from processes running on the Windows Subsystem for Linux.]] +  * [[windows:wsl:weasel_pageant|Weasel Pageant WSL Linux ssh-ageant to putty pageant]]
-  * [[https://medium.com/@rkttu/wsl-ubuntu%EC%97%90%EC%84%9C-putty-pageant-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0-942660a32041|WSL Ubuntu에서 PuTTY Pageant 연동하기 – 남정현 – Medium]]+
  
 ===== Maven/Gradle 등 ===== ===== Maven/Gradle 등 =====
-  * wsl 설치 후 [[java:maven:settings|Maven 설정]] 'settings.xml''+  * 아래 하지 말 것. File Lock 문제로 실제로 사용하기 힘듬. 
 + 
 +  * wsl 설치 후 [[java:maven:settings|Maven 설정]] ''settings.xml''
   * [[:gradle|Gradle]]의 사용자 디렉토리(''GRADLE_USER_HOME'') Windows와 맞춰준다.   * [[:gradle|Gradle]]의 사용자 디렉토리(''GRADLE_USER_HOME'') Windows와 맞춰준다.
  
 +===== 상호 실행 =====
 +  * Windows 에서 linux 명령실행, Linux에서 Windows 명령 실행이 가능하다.
 +  * [[https://docs.microsoft.com/en-us/windows/wsl/interop|Windows interoperability with Linux | Microsoft Docs]]
 +
 +<code sh>
 +C:\> wsl ls -lah
 +</code>
  
 ===== 주의 ===== ===== 주의 =====
줄 30: 줄 84:
   * [[https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/|Windows 10 Creators Update: What’s new in Bash/WSL & Windows Console – Windows Command Line Tools For Developers]]   * [[https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/|Windows 10 Creators Update: What’s new in Bash/WSL & Windows Console – Windows Command Line Tools For Developers]]
  
 +===== 참조 ===== 
 +  * [[https://www.howtogeek.com/fyi/windows-10-will-finally-offer-easy-access-to-linux-files/|Windows 10 Will Finally Offer Easy Access to Linux Files]] 
 +  * [[https://cepa.io/2018/02/10/linuxizing-your-windows-pc-part1/|WSL1 기준 Linux'izing your Windows PC into a dev machine – Part 1 | cepa.io]] 
 +  * [[https://cepa.io/2018/02/20/linuxizing-your-windows-pc-part2/|WSL1 기준 Linux'izing your Windows PC into a dev machine – Part 2 | cepa.io]] 
 +  * [[https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10|How to Install WSL 2 on Windows 10 (Updated) - OMG! Ubuntu!]]
windows/wsl.1526888948.txt.gz · 마지막으로 수정됨: 2018/05/21 16:49 저자 kwon37xi