ขณะ import virtual machine บน Hyper-V หากเจอ error Hyper-V encountered an error while loading the virtual machine configuration นี่คือวิธีแก้ไขด้วยเคล็ดลับต่างๆ Error นี้เกิดหลักเมื่อ import virtual machine เดียวกันที่มีอยู่บนคอมพิวเตอร์แล้ว

ข้อความ error เต็มเป็นแบบนี้:
Hyper-V encountered an error while loading the virtual machine configuration from [a-location]
Failed to create virtual machine.
The operating failed because a virtual machine with the same identifier already exists. Select a new identifier and try the operating again.
Hyper-V ให้ export และ import virtual machines บนคอมพิวเตอร์ได้ การ import VM บน Hyper-V ไมยาก แต่ปัญหาเริ่มตอน import VM เดียวกันซ้ำเมื่อมี original อยู่แล้ว กล่าวคือ error เกิดเมื่อเลือก Register the virtual machine in-place หรือ Restore the virtual machine option ขณะ import
ทุกครั้งที่สร้าง VM Hyper-V จะสร้าง unique ID เรียกว่า identifier เมื่อ export VM มันจะพก identifier ไปด้วย ตอน import identifier ก็ติดตั้งบนคอมพิวเตอร์ด้วย หากคอมพิวเตอร์ detect identifier เดียวกันขณะ import จะโชว์ error แบบนี้
Hyper-V encountered an error while loading the virtual machine configuration
เพื่อแก้ไข error นี้ ทำตามขั้นตอน:
- Delete old virtual machine
- Create a new unique ID
อ่านต่อเพื่อรายละเอียด
1] Delete old virtual machine

หากลบ original virtual machine unique identifier จะถูกลบออกจากคอมพิวเตอร์ด้วย กล่าวคือ จะสร้างพื้นที่ให้ old identifier ติดตั้งได้ใหม่ เพื่อลบ Hyper-V virtual machine:
- เปิด Hyper-V Manager บนคอมพิวเตอร์
- คลิกขวา virtual machine
- เลือก Delete จาก context menu
- คลิก Delete บนหน้าต่างยืนยัน

จะลบไฟล์ทั้งหมดของ VM ที่เลือกภายในไม่กี่วินาที หลังจากนั้น import VM ได้โดยไม่มี error
2] Create a new unique ID

บางครั้งอาจไม่อยากลบ VM เพื่อ import อีกตัว ในกรณีนี้ สร้าง new unique ID หรือ identifier ได้ ขณะ import VM
เพื่อสร้าง new unique ID สำหรับ VM:
- เปิด Hyper-V Manager
- คลิก Import Virtual Machine option
- เลือก VM folder ด้วย Browse button
- เลือก Copy the virtual machine (create a new unique ID) option ใน Choose Import Type tab
- คลิก Next และรัน VM
การเลือก option นี้จะสร้าง new unique ID ให้ VM ที่ import จะมี settings เดิมทั้งหมด ยกเว้น identifier
How do I import a virtual machine in Hyper-V?
เพื่อ import VM ใน Hyper-V ต้องใช้ Import Virtual Machine option เลือก exported folder ของ VM เลือก Copy the virtual machine option เริ่มติดตั้ง อ่านคู่มือรายละเอียดได้ที่นี่
Where are Hyper V virtual machines stored?
By default Windows เก็บ Hyper-V files ทั้งหมดใน C:\ProgramData\Microsoft\Windows\Hyper-V folder แต่ virtual drives ทั้งหมดอยู่ใน C:\Users\Public\Documents\Hyper-V ไม่ว่าจะ Windows 10 หรือ 11 location เหมือนกัน
แค่นี้เสร็จ! หวังว่าบทความนี้ช่วยแก้ปัญหา Hyper-V import ได้
