> For the complete documentation index, see [llms.txt](https://docs.aic-eec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aic-eec.com/computer-operation-systems/linuxos-preparation/wsl-2.md).

# ติดตั้ง WSL 2

1. ตรวจสอบเวอร์ชั่น windows ที่รองรับ WSL2

   1.1 กดปุ่ม `windows logo key + R` แล้วพิมพ์ว่า winver  วิธีการเช็คเวอร์ชั่นของ Windows ที่ติดตั้ง

   System requirement

   * * For x64 systems: **Version 1903** or higher, with **Build 18362** or higher.
     * For ARM64 systems: **Version 2004** or higher, with **Build 19041** or higher.

![](/files/-MNYZ9iVkzVeMA8AOkWy)

&#x20;       1.3 ไปที่ Search พิมพ์ค้นหา windows powershell คลิ๊กขวาเลือก Run as administrator

![](/files/-MNY_Q84Ep9qTBPOq23K)

&#x20;       1.4. พิมพ์คำสั่งดังนี้

```
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```

&#x20;      1.5. พิมพ์คำสั่งดังนี้

```
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```

&#x20;     1.6. Restart เครื่อง

2\. ดาวน์โหลด [Linux kernel update](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) แล้วทำการติดตั้ง

![](https://paper-attachments.dropbox.com/s_9749D5A73F48B7159351521E9F40D4E63444EDB865F015B313407708D5057BD0_1606912048020_image.png)

3\. ติดตั้ง Ubuntu 18.04 &#x20;

&#x20;    3.1 ไปที่เมนู Search ของ windows ค้นหา Microsoft store

&#x20;    3.2 พิมพ์  Ubuntu 18.04 LTS ที่ช่องค้นหา

&#x20;    3.3 คลิ๊ก get เพื่อ ติดตั้ง

&#x20;    3.4 หลังติดตั้งเสร็จ คลิ๊ก Launch เพื่อเปิดโปรแกรม&#x20;

![](/files/-MNYcbIr6JgYbeMcOs4_)

4\. เปิด Windows Powershell อีกครั้ง

&#x20;   4.1 ตรวจสอบ version ของ WSL พิมพ์คำสั่งดังนี้

```
wsl --list --verbose
```

![](/files/-MNYee_a1Uv-dT5yrs-1)

&#x20;  4.2 ตั้งค่า wsl2 ให้เป็น default version ด้วยคำสั่ง

```
wsl --set-default-version 2
```

![ตัวอย่าง](/files/-MNYf2xBFniSKC9WU1Jn)

หลังจากเช็คเวอร์ชั่นว่าพร้อมใช้งานแล้วเราสามารถเปลี่ยนเวอร์ชั่น WSL เป็น 1 และ 2 ได้โดยใช้คำสั่งด้านล่าง

```
wsl --set-version Ubuntu-18.04 2
```

หรือ

```
wsl --set-version Ubuntu-18.04 1
```

ตามเวอร์ชั่น WSL ที่เราต้องการ (ในคลาสเรียนนี้ใช้เวอร์ชั่น2)

จากนั้นเปิด Ubuntu ที่ติดตั้งแล้วทำตาม ขั้นตอนนี้ (Debian) ได้เลย

&#x20;   &#x20;

แหล่งอ้างอิง

{% embed url="<https://docs.microsoft.com/en-us/windows/wsl/install-win10>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aic-eec.com/computer-operation-systems/linuxos-preparation/wsl-2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
