├── .gitignore ├── README.ko.md ├── README.md ├── README.wsl2.md └── pictures ├── bash.png ├── client_startup.png ├── developer.png ├── extra_settings.png ├── features.png ├── finish.png ├── os_build.png ├── system.png ├── vcxsrv.png ├── windows_features.png └── wsl.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Vim swap file 2 | *.swp 3 | *.swo 4 | *.swn 5 | -------------------------------------------------------------------------------- /README.ko.md: -------------------------------------------------------------------------------- 1 | # wsl-tutorial 2 | 3 | - :kr: Translated into Korean 4 | - Corrected mistakes 5 | 6 | 이 튜토리얼에서는 Linux 용 Windows 서브 시스템에서 데스크탑 환경을 실행하는 방법을 설명합니다. 더 이상 가상 시스템으로 개발 환경을 구축할 필요가 없습니다. :) 7 | 8 | ## 스크린샷 9 | 10 | ![wsl](pictures/wsl.png "wsl") 11 | 12 | ## 선행 요건 13 | 14 | 귀하의 PC는 **Windows 10 애니버서리 업데이트 빌드 14393 이상** 의 64 비트 버전을 실행하고 있어야합니다. 15 | 16 | PC의 CPU 아키텍처와 Windows 버전/빌드 번호를 확인하려면 **설정 > 시스템 > 정보** 를 엽니다. OS 빌드 및 시스템 유형 필드를 찾으십시오. 17 | 18 | ![system](pictures/system.png "system") 19 | 20 | ## 설치 21 | 22 | Windows에서 Bash를 실행하려면 다음과 같이 수동으로 해야 합니다: 23 | 24 | #### 1. 개발자 모드 켜기 25 | 26 | ![developer](pictures/developer.png "developer") 27 | 28 | #### 2. "Linux 용 Windows 서브 시스템 (베타)" 기능 사용 가능 29 | 30 | ![windwos_features](pictures/windows_features.png "windows_features") 31 | 32 | ## Linux 용 Windows 서브 시스템 활성화 후 33 | 34 | #### 1. 컴퓨터를 다시 시작하십시오. 35 | 36 | #### 2. bash를 실행합니다. 37 | 38 | ![bash](pictures/bash.png "bash") 39 | 40 | license를 수락하면 Ubuntu 사용자 모드 이미지가 다운로드되고 시작 메뉴에 "Bash on Windows on Bash" 바로 가기가 추가됩니다. 41 | 42 | ## VcXsrv 설치 43 | 44 | [VcXsrv](https://sourceforge.net/projects/vcxsrv/) 최신 버전을 설치하세요. 45 | 46 | ## Ubuntu 업그레이드 47 | 48 | ```bash 49 | sudo apt-get update 50 | sudo apt-get upgrade 51 | ``` 52 | 53 | ## xfce 데스크탑 설치 54 | 55 | ```bash 56 | sudo apt-get install xfce4-terminal 57 | sudo apt-get install xfce4 58 | ``` 59 | 60 | ## 디스플레이 서버 지정 61 | 62 | 귀하의 `~/.bashrc` 에 DISPLAY=:0.0 추가하세요, 그리고 `source ~/.bashrc` 를 실행하는 것을 잊지 마세요. :) 63 | 64 | ```bash 65 | export DISPLAY=:0.0 66 | export LIBGL_ALWAYS_INDIRECT=1 67 | ``` 68 | 69 | ## dbus 오류 수정 (Ubuntu 14.04 만 해당) 70 | 71 | 바꿔야 합니다. 72 | 73 | ```xml 74 | unix:tmpdir=/tmp 75 | ``` 76 | 77 | 다음도 함께, 78 | 79 | ```xml 80 | tcp:host=localhost,port=0 81 | ``` 82 | 83 | /etc/dbus-1/session.conf 입니다. 84 | 85 | ## 연결 거부 수정 (우분투 14.04 만 해당) 86 | 87 | 바꿔야 합니다. 88 | 89 | ```xml 90 | EXTERNAL 91 | ``` 92 | 93 | 다음도 함께, 94 | 95 | ```xml 96 | ANONYMOUS 97 | 98 | ``` 99 | 100 | /etc/dbus-1/session.conf 입니다. 101 | 102 | ## 디스플레이 서버 열기 103 | 104 | ([VcXsrv](https://sourceforge.net/projects/vcxsrv/) 의) **XLaunch** 를 열고 "One large window" 또는 "One large window without titlebar" 를 선택하고 "display number"를 0으로 설정하십시오. 105 | 106 | 다른 설정은 기본값으로 두고 구성을 완료합니다. 107 | 108 | ![VcXsrv](pictures/vcxsrv.png "vcxsrv") 109 | 110 | ## xfce 데스크탑 실행 111 | 112 | "Bash on Windows on Bash" 에서 다음 명령을 실행하십시오. 113 | 114 | ```bash 115 | startxfce4 116 | ``` 117 | 118 | - startxfce4 가 없는 경우 다음도 설치 119 | ``` 120 | sudo apt install xfce4-session 121 | ``` 122 | 123 | ## powerline 글꼴 렌더링 수정 124 | 125 | [Hack](https://github.com/source-foundry/Hack#linux) 폰트의 최신 버전을 설치하십시오. 126 | 127 | ## 유니코드 글꼴 렌더링 수정 128 | 129 | ```bash 130 | sudo apt-get install fonts-noto 131 | sudo apt-get install fonts-noto-hinted 132 | sudo apt-get install fonts-noto-mono 133 | sudo apt-get install fonts-noto-unhinted 134 | ``` 135 | 136 | ## 중국어 글꼴 렌더링 수정 137 | 138 | ```bash 139 | sudo apt-get install fonts-noto-cjk 140 | ``` 141 | 142 | ## mkdir 명령 권한 오류 수정 143 | 144 | bashrc 에 다음 쉘 코드를 추가하십시오. 145 | 146 | ```bash 147 | if grep -q Microsoft /proc/version; then 148 | if [ "$(umask)" == '0000' ]; then 149 | umask 0022 150 | fi 151 | fi 152 | ``` 153 | 154 | ## 중국어 입력 방법 설치 155 | 156 | #### 1. fcitx 설치 157 | 158 | ```bash 159 | sudo apt-get install fcitx 160 | sudo apt-get install fcitx-pinyin 161 | ``` 162 | 163 | - 참조: [[Ubuntu] fcitx 한글 키보드 입력 사용하기](https://m.blog.naver.com/opusk/220986268503) 164 | 165 | #### 2. bashrc 파일에 다음 명령을 추가하십시오 166 | 167 | ```bash 168 | export XMODIFIERS=@im=fcitx 169 | export GTK_IM_MODULE=fcitx 170 | export QT_IM_MODULE=fcitx 171 | ``` 172 | 173 | #### 3. 재 로그인 174 | 175 | ## 드롭-다운 터미널 설치 176 | 177 | ```bash 178 | sudo apt-get install guake 179 | ``` 180 | 181 | ## wsl 종료하는 방법 182 | 183 | #### 1. VcXsrv 닫기 184 | 185 | #### 2. “Bash on Ubuntu on Windows” 종료 186 | 187 | ## 즐기세요 188 | 189 | 개발 환경을 즐기십시오. :) 190 | 191 | ## 참조 192 | 193 | - [Microsoft wsl install guide](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) 194 | - [Run any Desktop Environment in WSL](https://github.com/Microsoft/BashOnWindows/issues/637) 195 | - [Bash on windows getting dbus and x server working](https://www.reddit.com/r/Windows10/comments/4rsmzp/bash_on_windows_getting_dbus_and_x_server_working/) 196 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wsl-tutorial 2 | 3 | The tutorial will tell you how to run desktop environment inside Windows Subsystem for Linux. And you don't need to build a developement environment with virtual machines any more. :) 4 | 5 | [wsl2-tutorial](README.wsl2.md) 6 | 7 | ## Screenshot 8 | 9 | ![wsl](pictures/wsl.png "wsl") 10 | 11 | ## Prerequisites 12 | 13 | Your PC must be running a 64-bit version of **Windows 10 Anniversary Update build 14393 or later**. 14 | 15 | To find your PC's CPU architecture and Windows version/build number, open **Settings>System>About**. Look for the OS Build and System Type fields. 16 | ![system](pictures/system.png "system") 17 | 18 | ## Installation 19 | 20 | In order to run Bash on Windows, you will need to manually: 21 | 22 | #### 1.Turn-on Developer Mode 23 | 24 | ![developer](pictures/developer.png "developer") 25 | 26 | #### 2.Enable the “Windows Subsystem for Linux (beta)” feature 27 | 28 | ![windwos_features](pictures/windows_features.png "windows_features") 29 | 30 | ## After enabling Windows Subsystem for Linux 31 | 32 | #### 1.Restart your computer 33 | 34 | #### 2.Run bash 35 | 36 | ![bash](pictures/bash.png "bash") 37 | 38 | After you have accepted the License, the Ubuntu user-mode image will be downloaded and a “Bash on Ubuntu on Windows” shortcut will be added to your start menu. 39 | 40 | ## Install VcXsrv 41 | 42 | Install the lastest version of [VcXsrv](https://sourceforge.net/projects/vcxsrv/). 43 | 44 | ## Upgrade ubuntu 45 | 46 | ```bash 47 | sudo apt-get update 48 | sudo apt-get upgrade 49 | ``` 50 | 51 | ## Install xfce desktop 52 | 53 | ```bash 54 | sudo apt-get install xfce4-terminal 55 | sudo apt-get install xfce4 56 | ``` 57 | 58 | ## Specify the display server 59 | 60 | Add DISPLAY=:0.0 to your `~/.bashrc`, and don't forget to run `source ~/.bashrc`. :) 61 | 62 | ```bash 63 | export DISPLAY=:0.0 64 | export LIBGL_ALWAYS_INDIRECT=1 65 | ``` 66 | 67 | ## Fix dbus error (Only Ubuntu 14.04) and only if your Windows version is older than 1803 68 | 69 | You need to replace 70 | 71 | ```xml 72 | unix:tmpdir=/tmp 73 | ``` 74 | 75 | with 76 | 77 | ```xml 78 | tcp:host=localhost,port=0 79 | ``` 80 | 81 | in /etc/dbus-1/session.conf. 82 | 83 | ## Fix connection refused (Only Ubuntu 14.04) and only if your Windows version is older than 1803 84 | 85 | You need to replace 86 | 87 | ```xml 88 | EXTERNAL 89 | ``` 90 | 91 | with 92 | 93 | ```xml 94 | ANONYMOUS 95 | 96 | ``` 97 | 98 | in /etc/dbus-1/session.conf. 99 | 100 | ## Open display server 101 | 102 | Open **XLaunch**, choose “One large window” or “One large window without titlebar” and set the “display number” to 0. 103 | Other settings leave as default and finish the configuration. 104 | 105 | ![VcXsrv](pictures/vcxsrv.png "vcxsrv") 106 | 107 | ## Run xfce desktop 108 | 109 | Execute the following command inside “Bash on Ubuntu on Windows”. 110 | 111 | ```bash 112 | startxfce4 113 | ``` 114 | 115 | ## Fix powerline fonts rendering 116 | 117 | Install the lastest version of [Hack](https://github.com/source-foundry/Hack#linux) fonts. 118 | 119 | ## Fix Unicode fonts rendering 120 | 121 | ```bash 122 | sudo apt-get install fonts-noto 123 | sudo apt-get install fonts-noto-hinted 124 | sudo apt-get install fonts-noto-mono 125 | sudo apt-get install fonts-noto-unhinted 126 | ``` 127 | 128 | ## Fix Chinese fonts rendering 129 | 130 | ```bash 131 | sudo apt-get install fonts-noto-cjk 132 | ``` 133 | 134 | ## Fix mkdir command has wrong permissions 135 | 136 | Add the following shell code to your bashrc 137 | 138 | ```bash 139 | if grep -q Microsoft /proc/version; then 140 | if [ "$(umask)" == '0000' ]; then 141 | umask 0022 142 | fi 143 | fi 144 | ``` 145 | 146 | ## Install Chinese input method 147 | 148 | #### 1.Install fcitx 149 | 150 | ```bash 151 | sudo apt-get install fcitx 152 | sudo apt-get install fcitx-pinyin 153 | ``` 154 | 155 | #### 2.Add the following command to your bashrc file 156 | 157 | ```bash 158 | export XMODIFIERS=@im=fcitx 159 | export GTK_IM_MODULE=fcitx 160 | export QT_IM_MODULE=fcitx 161 | ``` 162 | 163 | #### 3.Relogin 164 | 165 | ## Install drop-down terminal 166 | 167 | ```bash 168 | sudo apt-get install guake 169 | ``` 170 | 171 | ## How to shutdown wsl 172 | 173 | #### 1.Close VcXsrv 174 | 175 | #### 2.Exit “Bash on Ubuntu on Windows” 176 | 177 | ## Enjoy your self 178 | 179 | Please enjoy your development environment. :) 180 | 181 | ## References 182 | 183 | - [Microsoft wsl install guide](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) 184 | - [Run any Desktop Environment in WSL](https://github.com/Microsoft/BashOnWindows/issues/637) 185 | - [Bash on windows getting dbus and x server working](https://www.reddit.com/r/Windows10/comments/4rsmzp/bash_on_windows_getting_dbus_and_x_server_working/) 186 | -------------------------------------------------------------------------------- /README.wsl2.md: -------------------------------------------------------------------------------- 1 | # wsl2-tutorial 2 | 3 | The tutorial will tell you how to run desktop environment inside Windows Subsystem for Linux. And you don't need to build a developement environment with virtual machines any more. :) 4 | 5 | ## Screenshot 6 | 7 | ![wsl 2](pictures/wsl.png "wsl 2") 8 | 9 | ## Prerequisites 10 | 11 | Please note that you'll need to be running **Windows 10 build 18917 or higher**. 12 | 13 | To find your Windows version, open **Settings>System>About** and look for the "OS build" field. 14 | ![os_build](pictures/os_build.png "os_build") 15 | 16 | ## Enable windows features 17 | 18 | #### 1. Enable the "Virtual Machine Platform" and "Windows Subsystem for Linux" feature 19 | 20 | ![features](pictures/features.png "features") 21 | 22 | #### 2. Restart your computer 23 | 24 | ## Install Ubuntu 25 | 26 | #### Install "Ubuntu 16.04 LTS" or "Ubuntu 18.04 LTS" in Microsoft Store 27 | 28 | ## Set Ubuntu to be backed by WSL 2 29 | 30 | In PowerShell run: 31 | 32 | ``` 33 | wsl --set-version 2 34 | ``` 35 | 36 | Make sure to replace with the actual name of your distro. (You can find these with the command: wsl -l). 37 | 38 | Additionally, run the command below to make WSL 2 your default architecture: 39 | 40 | ``` 41 | wsl --set-default-version 2 42 | ``` 43 | 44 | ## Install VcXsrv 45 | 46 | Install the lastest version of [VcXsrv](https://sourceforge.net/projects/vcxsrv/). 47 | 48 | ## Upgrade Ubuntu 49 | 50 | ```bash 51 | sudo apt-get update 52 | sudo apt-get upgrade 53 | ``` 54 | 55 | ## Install xfce desktop 56 | 57 | ```bash 58 | sudo apt-get install xfce4-terminal 59 | sudo apt-get install xfce4 60 | ``` 61 | 62 | ## Specify the display server 63 | 64 | Add bellow code to your `~/.bashrc`, and don't forget to run `source ~/.bashrc`. :) 65 | 66 | ```bash 67 | export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 68 | export LIBGL_ALWAYS_INDIRECT=1 69 | ``` 70 | 71 | ## Launch display server 72 | 73 | Open **XLaunch**, choose "One large window" or "One large window without titlebar", set the "display number" to 0 and click "Next. 74 | 75 | ![vcxsrv](pictures/vcxsrv.png "vcxsrv") 76 | 77 | Check "Disable access control" and click "Next". 78 | 79 | ![extra_settings](pictures/extra_settings.png "extra_settings") 80 | 81 | Choose "Start no client" and click "Next". 82 | 83 | ![client_startup](pictures/client_startup.png "client_startup") 84 | 85 | Click "Finish" to launch display server. 86 | 87 | ![finish](pictures/finish.png "finish") 88 | 89 | ## Run xfce desktop 90 | 91 | Execute the following command inside Ubuntu. 92 | 93 | ```bash 94 | startxfce4 95 | ``` 96 | 97 | ## Fix powerline fonts rendering 98 | 99 | Install the lastest version of [Hack](https://github.com/source-foundry/Hack#linux) fonts. 100 | 101 | ## Fix Unicode fonts rendering 102 | 103 | ```bash 104 | sudo apt-get install fonts-noto 105 | sudo apt-get install fonts-noto-hinted 106 | sudo apt-get install fonts-noto-mono 107 | sudo apt-get install fonts-noto-unhinted 108 | ``` 109 | 110 | ## Fix Chinese fonts rendering 111 | 112 | ```bash 113 | sudo apt-get install fonts-noto-cjk 114 | ``` 115 | 116 | ## Fix mkdir command has wrong permissions 117 | 118 | Add the following shell code to your bashrc 119 | 120 | ```bash 121 | if grep -q microsoft /proc/version; then 122 | if [ "$(umask)" == '0000' ]; then 123 | umask 0022 124 | fi 125 | fi 126 | ``` 127 | 128 | ## Install Chinese input method 129 | 130 | #### 1. Install fcitx 131 | 132 | ```bash 133 | sudo apt-get install fcitx 134 | sudo apt-get install fcitx-pinyin 135 | ``` 136 | 137 | #### 2. Add the following command to your bashrc file 138 | 139 | ```bash 140 | export XMODIFIERS=@im=fcitx 141 | export GTK_IM_MODULE=fcitx 142 | export QT_IM_MODULE=fcitx 143 | ``` 144 | 145 | #### 3. Relogin 146 | 147 | ## Install drop-down terminal 148 | 149 | ```bash 150 | sudo apt-get install guake 151 | ``` 152 | 153 | ## How to shutdown wsl 154 | 155 | #### 1. Close VcXsrv 156 | 157 | #### 2. Exit Ubuntu 158 | 159 | ## Enjoy your self 160 | 161 | Please enjoy your development environment. :) 162 | 163 | ## References 164 | 165 | - [Installation Instructions for WSL 2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install) 166 | - [Can't use X-Server in WSL 2](https://github.com/microsoft/WSL/issues/4106) -------------------------------------------------------------------------------- /pictures/bash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/bash.png -------------------------------------------------------------------------------- /pictures/client_startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/client_startup.png -------------------------------------------------------------------------------- /pictures/developer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/developer.png -------------------------------------------------------------------------------- /pictures/extra_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/extra_settings.png -------------------------------------------------------------------------------- /pictures/features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/features.png -------------------------------------------------------------------------------- /pictures/finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/finish.png -------------------------------------------------------------------------------- /pictures/os_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/os_build.png -------------------------------------------------------------------------------- /pictures/system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/system.png -------------------------------------------------------------------------------- /pictures/vcxsrv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/vcxsrv.png -------------------------------------------------------------------------------- /pictures/windows_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/windows_features.png -------------------------------------------------------------------------------- /pictures/wsl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QMonkey/wsl-tutorial/6817967e4cdabdb9df6ebbcd4b522d579aadc235/pictures/wsl.png --------------------------------------------------------------------------------