# How to install QEMU Guest Agent

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

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

### 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](https://docs-epc.gitbook.io/ncs-documents/compute/compute-instance/remote-desktop-to-windows-instance) โดยมีขั้นตอนดังนี้

### 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="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FD4F1lokBkkGOJGvOZTl6%2FScreen%20Shot%202565-02-21%20at%2015.30.58.png?alt=media&#x26;token=7ce2e5b2-0985-43c9-bebe-a0b2af43be7f" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FXiIn5AABsEB88hmcCwJR%2FScreen%20Shot%202565-02-21%20at%2015.35.17.png?alt=media&#x26;token=8fd1b6ed-dfe8-4ba4-958a-1e6910ddbf71" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FK2ChBcWkVQ3WmoCoSoyv%2FScreen%20Shot%202565-02-21%20at%2015.35.34.png?alt=media&#x26;token=d55c7f77-da57-4beb-8162-427cca3c8dfc" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FKld1cWwpFb6IsZ2iWmoL%2FScreen%20Shot%202565-02-21%20at%2015.36.30.png?alt=media&#x26;token=313db793-b482-46d7-86c7-1049b1669685" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2F1hNAMc9m0RvuBJiN9tWp%2FScreen%20Shot%202565-02-21%20at%2015.36.42.png?alt=media&#x26;token=93ef1149-afde-48bd-8229-8ae4573a69a1" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FmqHw1h8qRIgVklhUCl4S%2FScreen%20Shot%202565-02-21%20at%2015.36.55.png?alt=media&#x26;token=0a5cff0f-3d7c-47ec-aeeb-890834eacd09" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2Fyjv5u4UiTRZ7eWnrBVQC%2FScreen%20Shot%202565-02-21%20at%2015.37.09.png?alt=media&#x26;token=b568a9d4-0ba6-4e55-aa06-b26dbe955a16" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2F8yK4xCe5P0FX3YaTws25%2FScreen%20Shot%202565-02-21%20at%2015.38.43.png?alt=media&#x26;token=20518124-5d7a-47d5-b688-eab85d74cbee" alt=""><figcaption></figcaption></figure>
