> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/compute/compute-instance/how-to-install-qemu-guest-agent.md).

# How to install QEMU Guest Agent

## **วิธีการติดตั้งบน Linux**

บน OS ในกลุ่ม Linux สามารถติดตั้งได้ผ่าน command line ผ่านการ [Secure Shell](/ncs-documents/compute/compute-instance/ssh-to-linux-compute-instance.md) โดยมีขั้นตอนดังนี้

### 1. ติดตั้ง QEMU Guest Agent

* บน OS ที่ใช้ Debian หรือ Ubuntu เป็น based systems (ติดตั้งด้วย apt-get) ใช้ command:

```
sudo apt-get install qemu-guest-agent
```

* บน OS ที่ใช้ Redhat เป็น based systems (ติดตั้งด้วย yum) ใช้ command:

```
sudo yum install qemu-guest-agent
```

### 2. start QEMU Guest Agent service

QEMU Guest Agent อาจจะ start ทันที จะต้องสั่ง start ด้วยตัวเอง ขึ้นอยู่กับ OS ที่ใช้งาน&#x20;

โดยสามารถสั่ง start ได้โดยใช้ command

<pre><code><strong>sudo systemctl start qemu-guest-agent
</strong></code></pre>

### 3. กำหนดให้ QEMU Guest Agent autostart ทันทีหลัง restart instance

เพื่อให้ QEMU Guest Agent service เริ่มต้นการทำงานทันทีหลังการ restart ให้ใช้ command

```
sudo systemctl enable qemu-guest-agent
```

##

## **วิธีการติดตั้งบน** Windows

บน Windows server สามารถติดตั้งได้ผ่าน [Remote Desktop Protocol](/ncs-documents/compute/compute-instance/remote-desktop-to-windows-instance.md) โดยมีขั้นตอนดังนี้

### 1. Download VirtIO ISO File

ดาวน์โหลด virtio driver ที่เป็น ISO file ที่ <https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso> และเชื่อมต่อ ISO file ไปยัง instance&#x20;

<figure><img src="/files/xcbUKiFwrLQQ5BOgqOXV" alt=""><figcaption></figcaption></figure>

### 2. เปิด File บน Instance

เมื่อเชื่อมต่อ virtio file มายัง instance แล้ว จะได้ไฟล์ DVD virtio-win-0.1.215 ดังภาพ ให้คลิกขวาแล้วเลือก Open in new window

<figure><img src="/files/vy8eGQBBbPnk99JJPFZR" alt=""><figcaption></figcaption></figure>

### 3. ติดตั้ง virtio-win-guest-tools

Double click ที่ virtio-win-guest-tools เพื่อติดตั้งทุกอย่างที่จำเป็นในการย้ายไปยัง OpenStack

<figure><img src="/files/Q69sAsMdpIU6hOSAVEuT" alt=""><figcaption></figcaption></figure>

เมื่อคลิกแล้วจะพบหน้าต่างติดตั้ง Virtio-win ให้ติดตั้งโดยคลิก Next >> I accept... >> Next >> Next (ไม่ต้องแก้ไขอะไร) >> Install&#x20;

<figure><img src="/files/xqhY9LVIj4WsTpt9aE40" alt=""><figcaption></figcaption></figure>

คลิก Install เพื่อติดตั้ง

<figure><img src="/files/v7Vx0XU5rgkBpjywfAcC" alt=""><figcaption></figcaption></figure>

เมื่อติดตั้งเสร็จแล้ว คลิก Finish

<figure><img src="/files/sUW9vXW8I1fi8rszGNe2" alt=""><figcaption></figcaption></figure>

เมื่อติดตั้งสำเร็จ จะปรากฏ Installation Successfully ดังภาพ

<figure><img src="/files/JVG5AQrIKYOZI949LtZz" alt=""><figcaption></figcaption></figure>

### 4. ตรวจสอบการทำงานของ QEMU Guest Agent

เข้าหน้าต่าง Services เพื่อตรวจสอบสถานะการทำงานของ QEMU Guest Agent โดยถ้าติดตั้งเสร็จสมบูรณ์จะต้องมี status เป็น "Running"

<figure><img src="/files/NQflIi4EmxMuGDa3ZX4g" alt=""><figcaption></figcaption></figure>
