วิธีติดตั้ง Linux บน Hyper-V แบบละเอียด รองรับ Ubuntu, Debian, Rocky Linux และอีกหลายดิสโทร

Hyper-V บน Windows Server 2025 ไม่ได้รองรับแค่ Windows เท่านั้น แต่ยังรองรับ Linux ได้ดีมาก จนปัจจุบันหลายองค์กรใช้ Linux VM บน Hyper-V จริงในระบบ Production ทั้ง Web Server, Database, Docker, Kubernetes และระบบ Cloud ภายในองค์กร

ข้อดีของการติดตั้ง Linux บน Hyper-V คือ:

  • ใช้ Hardware ร่วมกันได้
  • สร้าง VM ได้เร็ว
  • Clone ได้
  • Backup ได้
  • Snapshot ได้
  • Scale ระบบง่าย

ปัจจุบัน Linux บน Hyper-V ทำงานเสถียรมาก โดยเฉพาะ Ubuntu, Debian, Rocky Linux, AlmaLinux และ Red Hat ที่ Microsoft รองรับอย่างจริงจัง

บทความนี้จะสอนวิธีติดตั้ง Linux บน Hyper-V แบบละเอียด ตั้งแต่สร้าง VM, ตั้งค่า Generation, เลือก ISO, ตั้งค่า Network ไปจนถึงแก้ปัญหาที่พบบ่อย


① Linux บน Hyper-V ใช้ทำอะไรได้บ้าง

นิยมใช้สำหรับ:

  • Web Server
  • Docker Host
  • Kubernetes
  • Database
  • Firewall
  • Monitoring
  • Dev Environment
  • Security Lab
  • AI Environment

หลายองค์กรใช้ Linux VM มากกว่า Windows VM ด้วยซ้ำ

comsiam พบว่า Ubuntu และ Rocky Linux เป็น 2 ระบบที่ถูกใช้บน Hyper-V มากที่สุดในสายองค์กรและ Homelab


② Linux อะไรที่ Hyper-V รองรับ

Hyper-V รองรับ Linux จำนวนมาก เช่น

🔹 Ubuntu

นิยมที่สุด

🔹 Debian

เสถียรและเบา

🔹 Rocky Linux

สาย Enterprise

🔹 AlmaLinux

แทน CentOS

🔹 Red Hat Enterprise Linux

องค์กรใหญ่ใช้เยอะ

🔹 Kali Linux

สาย Security

🔹 SUSE Linux

องค์กรระดับ Enterprise


③ สิ่งที่ต้องเตรียมก่อนติดตั้ง Linux

ก่อนเริ่ม ต้องมี:

🔹 Hyper-V ติดตั้งแล้ว

บน Windows Server 2025


🔹 Linux ISO

เช่น:

  • Ubuntu.iso
  • Debian.iso
  • Rocky.iso

🔹 RAM

ขั้นต่ำ:

  • 4GB

แนะนำ:

  • 8GB+

🔹 SSD/NVMe

Linux บน SSD จะเร็วมาก


④ วิธีสร้าง VM สำหรับ Linux

เปิด:

Hyper-V Manager

คลิก:

New → Virtual Machine

⑤ วิธีตั้งชื่อ VM

ตัวอย่าง:

  • Ubuntu-Server
  • Rocky-DB
  • Kali-Lab

ตั้งชื่อให้สื่อความหมาย


⑥ วิธีเลือก Generation ของ VM

แนะนำ:

Generation 2

เพราะ:

  • รองรับ UEFI
  • Performance ดีกว่า
  • รองรับ Modern Linux

Linux บางรุ่นเก่าอาจใช้ Gen 1

แต่ปัจจุบันส่วนใหญ่ใช้ Gen 2 ได้หมดแล้ว


⑦ วิธีตั้งค่า RAM

ตัวอย่าง:

Ubuntu Server:

  • 2GB–4GB

Docker/K8s:

  • 8GB+

Database:

  • 16GB+

เปิด Dynamic Memory ดีไหม

แนะนำ:

  • เปิด

ช่วยประหยัด RAM ได้มาก


⑧ วิธีตั้งค่า Network

เลือก:

External Virtual Switch

เพื่อให้ออกอินเทอร์เน็ตได้


⑨ วิธีสร้าง Virtual Hard Disk

แนะนำ:

  • 40GB+

Database:

  • 100GB+

ใช้:

  • VHDX

เท่านั้น


⑩ วิธีเลือก Linux ISO

เลือก:

Install an operating system from a bootable image file

จากนั้นเลือกไฟล์ ISO

เช่น:

ubuntu.iso

⑪ วิธีปิด Secure Boot สำหรับ Linux บางรุ่น

Linux บางตัวอาจ Boot ไม่ขึ้น

ไปที่:

Settings → Security

แล้ว:

  • ปิด Secure Boot

หรือเลือก Template:

Microsoft UEFI Certificate Authority

Ubuntu รุ่นใหม่รองรับ Secure Boot ได้ดีแล้ว


⑫ วิธีเปิด VM และเริ่มติดตั้ง Linux

คลิก:

Connect

แล้วกด:

Start

VM จะ Boot เข้า Linux Installer


⑬ วิธีติดตั้ง Ubuntu บน Hyper-V

ขั้นตอนทั่วไป:

  1. Install Ubuntu
  2. เลือกภาษา
  3. เลือก Keyboard
  4. ตั้ง Network
  5. Partition Disk
  6. ตั้ง User
  7. Install

ใช้งานง่ายมาก


⑭ วิธีติดตั้ง Rocky Linux บน Hyper-V

เหมาะกับ:

  • Server
  • Enterprise
  • Database

ขั้นตอน:

  • Install
  • ตั้ง Hostname
  • ตั้ง Root Password
  • เลือก Partition
  • Install

⑮ วิธีติดตั้ง Debian บน Hyper-V

Debian เบาและเสถียร

นิยมใช้:

  • Web Server
  • Docker
  • Lightweight VM

⑯ วิธีทำ Linux VM ให้เร็วขึ้น

🔹 ใช้ SSD/NVMe

ช่วยเยอะมาก

🔹 ใช้ Gen 2

Performance ดีกว่า

🔹 เพิ่ม vCPU

แนะนำ:

  • 2–4 Core

🔹 เปิด Dynamic Memory

ช่วยบริหาร RAM

🔹 ใช้ Linux Server Edition

เบากว่า Desktop


⑰ วิธีเพิ่ม CPU ให้ Linux VM

ปิด VM ก่อน

ไปที่:

Settings → Processor

เพิ่ม:

  • Virtual Processor

⑱ วิธีใช้ Linux กับ Docker บน Hyper-V

นิยมมากในองค์กร

ตัวอย่าง:

  • Ubuntu + Docker
  • Ubuntu + Kubernetes
  • Rocky Linux + Podman

เหมาะสำหรับ:

  • DevOps
  • AI
  • Cloud
  • CI/CD

⑲ วิธีใช้ Kali Linux บน Hyper-V

Kali Linux ใช้สำหรับ:

  • Security Testing
  • Penetration Test
  • Cybersecurity Lab

Hyper-V รองรับ Kali ได้ดีมาก


⑳ วิธี Backup Linux VM

นิยมใช้:

  • Export VM
  • Checkpoint
  • Veeam Backup

ช่วย Restore ระบบได้เร็ว


㉑ วิธี Clone Linux VM

นิยมใช้:

  • Export/Import
  • Copy VHDX

ช่วย Deploy VM จำนวนมากได้เร็ว


㉒ ปัญหาที่พบบ่อยตอนติดตั้ง Linux บน Hyper-V

❌ Linux Boot ไม่ขึ้น

สาเหตุ:

  • Secure Boot
  • ISO เสีย

❌ ไม่มี Network

สาเหตุ:

  • ไม่ได้เลือก Virtual Switch

❌ VM ช้า

สาเหตุ:

  • HDD ช้า
  • RAM ไม่พอ

❌ Mouse/Keyboard เพี้ยน

สาเหตุ:

  • Linux Kernel เก่า

㉓ Linux ไหนเหมาะกับ Hyper-V มากที่สุด

🔹 Ubuntu

ดีที่สุดสำหรับมือใหม่

🔹 Rocky Linux

เหมาะองค์กร

🔹 Debian

เบาและเสถียร

🔹 Kali Linux

สาย Security


㉔ Hyper-V กับ Linux ดีพอใช้จริงไหม

ปัจจุบัน “ดีมาก”

Microsoft พัฒนา Linux Integration มาหลายปีแล้ว

ตอนนี้:

  • Performance ดี
  • Network ดี
  • Storage ดี
  • รองรับ Cloud Workload

หลายองค์กรใช้งานจริงระดับ Production แล้ว


㉕ สรุป

การติดตั้ง Linux บน Hyper-V เป็นวิธีที่คุ้มค่ามากสำหรับองค์กรและสาย IT เพราะช่วยให้สามารถรัน Linux หลายเครื่องบน Hardware เดียวได้อย่างมีประสิทธิภาพ

Windows Server 2025 ทำให้ Hyper-V รองรับ Linux ได้ดีขึ้นมาก ทั้งด้าน Performance, Network, Storage และ Security ทำให้สามารถใช้งานจริงในระดับ Enterprise ได้อย่างมั่นใจ

สำหรับคนที่ต้องการเริ่มต้นสาย Server, DevOps, Docker, Kubernetes หรือ Cybersecurity การฝึกใช้งาน Linux บน Hyper-V ถือเป็นทักษะสำคัญมากในยุคปัจจุบัน

comsiam มองว่า Hyper-V + Linux คือหนึ่งในคู่ผสมที่คุ้มค่าที่สุดสำหรับองค์กรที่ต้องการลดต้นทุนแต่ยังได้ระบบ Virtualization ระดับ Enterprise