new WSL2 and new Docker at win10 - Linux

By Yuri
at 2020-05-23T19:31
at 2020-05-23T19:31
Table of Contents
https://is.gd/JjgLXs
首先win10 要是2004以上 19041build以上
請去windows update 更新win10 2004
安裝有linux kernel的WSL2
https://docs.microsoft.com/en-us/windows/wsl/install-win10
Powershell 以系統管理員執行
打開WSL功能
$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linu
打開virtualmachine platform功能
$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /nor
或者透過控制台打開
https://i.imgur.com/qEcPPCq.png
重開機
下載WSL2 linux kernel 安裝
https://aka.ms/wsl2kernel
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
直接點擊wsl_update_x64.msi安裝
powershell 將WSL預設版本調成WSL2
$ wsl --set-default-version 2
點開microsoft store安裝 你要的WSL版本 https://aka.ms/wslstore
https://docs.microsoft.com/en-us/windows/wsl/media/store.png

設帳號密碼
https://docs.microsoft.com/en-us/windows/wsl/media/ubuntuinstall.png

再來就可以用WSL2了
C槽會mount在 WSL的路徑
/mnt/c
所以檔案系統是互通的
-------------------------------------
安裝win10 docker desktop
https://docs.docker.com/docker-for-windows/wsl/
一定要安裝最新版
https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe
安裝時勾選WSL2 Intergration 就不需要開啟hyperV就能用
win10家用版也可使用
安裝完點開Docker Desktop 設定確認一下 WSL2功能開啟
https://docs.docker.com/docker-for-windows/images/wsl2-enable.png


打開WSL2的terminal (WSL2不需要另外安裝linux版docker-ce)
$ docker version
$ docker pull hello-world
再來就可以開始使用WSL2 linux kernel的docker
再也不需要用win10 hyperV docker
然後目前vscode有支援WSL開發
https://code.visualstudio.com/blogs/2020/03/02/docker-in-wsl2
記得裝外掛
https://is.gd/pk0DaX
win10可以很方便使用linux開發了
不需要用vm
--
Tags:
Linux
All Comments

By Joseph
at 2020-05-27T08:57
at 2020-05-27T08:57

By Sarah
at 2020-05-31T00:46
at 2020-05-31T00:46

By Lucy
at 2020-06-01T19:23
at 2020-06-01T19:23

By Emily
at 2020-06-05T17:24
at 2020-06-05T17:24

By Selena
at 2020-06-07T22:53
at 2020-06-07T22:53

By John
at 2020-06-12T16:12
at 2020-06-12T16:12

By Delia
at 2020-06-15T04:32
at 2020-06-15T04:32

By Edith
at 2020-06-18T05:23
at 2020-06-18T05:23

By Quintina
at 2020-06-20T08:17
at 2020-06-20T08:17

By Valerie
at 2020-06-21T00:16
at 2020-06-21T00:16

By Margaret
at 2020-06-22T08:44
at 2020-06-22T08:44

By Lily
at 2020-06-24T01:59
at 2020-06-24T01:59

By Andrew
at 2020-06-26T00:30
at 2020-06-26T00:30

By Kumar
at 2020-06-29T06:08
at 2020-06-29T06:08

By Leila
at 2020-07-02T10:54
at 2020-07-02T10:54

By Gary
at 2020-07-05T07:19
at 2020-07-05T07:19

By Elvira
at 2020-07-09T01:49
at 2020-07-09T01:49

By Noah
at 2020-07-09T23:38
at 2020-07-09T23:38

By Daniel
at 2020-07-13T01:36
at 2020-07-13T01:36

By Thomas
at 2020-07-14T23:50
at 2020-07-14T23:50

By Noah
at 2020-07-15T02:28
at 2020-07-15T02:28

By Kyle
at 2020-07-17T17:07
at 2020-07-17T17:07

By Robert
at 2020-07-22T13:35
at 2020-07-22T13:35

By Elma
at 2020-07-24T08:36
at 2020-07-24T08:36

By Quintina
at 2020-07-28T17:51
at 2020-07-28T17:51

By Elma
at 2020-07-30T01:38
at 2020-07-30T01:38

By Rebecca
at 2020-08-01T21:47
at 2020-08-01T21:47

By Hedy
at 2020-08-06T01:13
at 2020-08-06T01:13

By Agnes
at 2020-08-07T16:07
at 2020-08-07T16:07

By Doris
at 2020-08-12T15:44
at 2020-08-12T15:44

By Erin
at 2020-08-16T02:50
at 2020-08-16T02:50

By Doris
at 2020-08-16T10:26
at 2020-08-16T10:26

By Sarah
at 2020-08-21T04:38
at 2020-08-21T04:38

By Connor
at 2020-08-21T10:34
at 2020-08-21T10:34

By Enid
at 2020-08-21T14:26
at 2020-08-21T14:26

By Donna
at 2020-08-26T11:54
at 2020-08-26T11:54

By Leila
at 2020-08-27T00:45
at 2020-08-27T00:45

By William
at 2020-08-28T07:41
at 2020-08-28T07:41

By Poppy
at 2020-08-28T19:59
at 2020-08-28T19:59

By Zora
at 2020-08-31T14:30
at 2020-08-31T14:30

By Frederic
at 2020-08-31T21:35
at 2020-08-31T21:35

By Dora
at 2020-09-01T04:34
at 2020-09-01T04:34

By Rosalind
at 2020-09-01T21:51
at 2020-09-01T21:51

By Vanessa
at 2020-09-03T01:35
at 2020-09-03T01:35

By Isla
at 2020-09-05T05:02
at 2020-09-05T05:02

By Robert
at 2020-09-07T17:01
at 2020-09-07T17:01

By Sandy
at 2020-09-07T22:19
at 2020-09-07T22:19

By Isabella
at 2020-09-11T15:45
at 2020-09-11T15:45

By Charlie
at 2020-09-16T00:40
at 2020-09-16T00:40

By Dorothy
at 2020-09-20T22:01
at 2020-09-20T22:01

By Callum
at 2020-09-24T08:58
at 2020-09-24T08:58

By Lauren
at 2020-09-25T03:42
at 2020-09-25T03:42

By Oliver
at 2020-09-28T15:09
at 2020-09-28T15:09

By Mia
at 2020-09-29T06:53
at 2020-09-29T06:53

By Mia
at 2020-10-03T22:19
at 2020-10-03T22:19

By Charlie
at 2020-10-05T02:30
at 2020-10-05T02:30

By Carol
at 2020-10-07T02:39
at 2020-10-07T02:39

By Carol
at 2020-10-12T00:12
at 2020-10-12T00:12

By Kristin
at 2020-10-13T07:09
at 2020-10-13T07:09

By William
at 2020-10-16T03:10
at 2020-10-16T03:10

By Lucy
at 2020-10-20T19:44
at 2020-10-20T19:44

By Jessica
at 2020-10-24T20:04
at 2020-10-24T20:04

By Jake
at 2020-10-25T10:40
at 2020-10-25T10:40

By Lydia
at 2020-10-29T23:28
at 2020-10-29T23:28

By Regina
at 2020-11-01T21:34
at 2020-11-01T21:34

By Irma
at 2020-11-06T11:06
at 2020-11-06T11:06

By Mary
at 2020-11-08T04:08
at 2020-11-08T04:08

By Dora
at 2020-11-12T06:15
at 2020-11-12T06:15

By Oscar
at 2020-11-13T21:57
at 2020-11-13T21:57

By Skylar Davis
at 2020-11-14T13:09
at 2020-11-14T13:09

By Poppy
at 2020-11-17T03:31
at 2020-11-17T03:31

By George
at 2020-11-21T13:33
at 2020-11-21T13:33

By Tracy
at 2020-11-22T20:53
at 2020-11-22T20:53

By Oscar
at 2020-11-23T14:31
at 2020-11-23T14:31

By Olga
at 2020-11-24T04:39
at 2020-11-24T04:39

By Edward Lewis
at 2020-11-27T13:37
at 2020-11-27T13:37

By Lucy
at 2020-11-30T17:30
at 2020-11-30T17:30

By Caitlin
at 2020-12-04T01:57
at 2020-12-04T01:57

By Jessica
at 2020-12-06T02:33
at 2020-12-06T02:33

By David
at 2020-12-08T17:02
at 2020-12-08T17:02

By Delia
at 2020-12-12T18:56
at 2020-12-12T18:56

By Ethan
at 2020-12-17T07:57
at 2020-12-17T07:57

By Zenobia
at 2020-12-20T07:04
at 2020-12-20T07:04

By Lauren
at 2020-12-21T17:31
at 2020-12-21T17:31

By Agnes
at 2020-12-22T17:21
at 2020-12-22T17:21

By Kyle
at 2020-12-27T02:36
at 2020-12-27T02:36

By Edward Lewis
at 2020-12-28T04:57
at 2020-12-28T04:57

By Zenobia
at 2020-12-28T19:36
at 2020-12-28T19:36

By Lily
at 2021-01-01T17:14
at 2021-01-01T17:14

By Connor
at 2021-01-04T22:09
at 2021-01-04T22:09

By Hamiltion
at 2021-01-07T15:07
at 2021-01-07T15:07

By Lucy
at 2021-01-11T06:28
at 2021-01-11T06:28

By Madame
at 2021-01-12T14:21
at 2021-01-12T14:21

By Edward Lewis
at 2021-01-13T09:34
at 2021-01-13T09:34

By Charlotte
at 2021-01-17T23:46
at 2021-01-17T23:46

By Genevieve
at 2021-01-20T22:39
at 2021-01-20T22:39

By Poppy
at 2021-01-23T05:06
at 2021-01-23T05:06

By Cara
at 2021-01-24T12:46
at 2021-01-24T12:46
Related Posts
grep 指令請益

By Leila
at 2020-05-22T12:28
at 2020-05-22T12:28
關於kernel driver changes

By Lydia
at 2020-05-21T18:54
at 2020-05-21T18:54
新手擷取comport output問題

By David
at 2020-05-21T10:23
at 2020-05-21T10:23
Gnome網路設定值內的註解錯誤

By Quintina
at 2020-05-16T00:08
at 2020-05-16T00:08
Ubuntu 20.04安裝記錄

By Andy
at 2020-05-15T21:59
at 2020-05-15T21:59