VirtualBox & ข้อผิดพลาด kernel driver not installed
อัปเดต: 14 มกราคม 2026
Linux สิ่งต่างๆ ทำงานจนกว่าจะเสีย ไม่มีอะไรน่าหงุดหงิดกว่าการได้ error ร้ายแรงพอดีตอนที่คุณต้องทำงานจริงหรืองานสำคัญ กรณีศึกษา ตามที่รายงานใน Slimbook Executive report 12 VirtualBox ไม่สามารถเปิด guest ใดๆ ได้ ข้อผิดพลาดระบุ: Kernel driver not installed (rc=-1908) The VirtualBox Linux kernel driver is either not loaded or not setup correctly. Please try setting it by executing ... ใช่แล้ว ป๊อปอัพนี้ขึ้นตอนพยายามเปิด VM รบกวนและหงุดหงิด โดยเฉพาะที่ผมไม่ได้ทำการเปลี่ยนแปลง VirtualBox มานานแล้ว
ตามคำแนะนำ ผมรันคำสั่ง /sbin/vboxconfig ระบบแจ้งว่าไม่มี kernel headers ที่จำเป็นสำหรับคอมไพล์ไดรเวอร์สำหรับ kernel ที่กำลังทำงานอยู่ ผมจึงจำได้ว่าเพิ่งอัปเกรด kernel บนเครื่องนี้จาก 6.8 เป็น 6.14 แต่ VirtualBox ไม่ได้ถูก auto-configure ตามการเปลี่ยนแปลงนี้ ไป ไปดูปัญหา รายละเอียดน่าสนใจ และวิธีแก้ไขกันดีกว่า

ปัญหาในรายละเอียด
ข้อความข้อผิดพลาดในป๊อปอัพค่อนข้างยาว และค่อนข้าง misleading วิธีที่ง่ายและขлеганท์กว่าคือรันคำสั่ง /sbin/vboxconfig ในเทอร์มินัล และดูผลลัพธ์ ข้อความและรายละเอียดจริงจะต่างออกไป
sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-generic linux-headers-6.14.0-35-generic
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-generic linux-headers-6.14.0-35-generic
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
สิ่งที่เกิดขึ้นคือ: ผมมี kernel ใหม่ แต่ไม่มี kernel headers นี่หมายความว่าระบบไม่สามารถ recompile ไดรเวอร์สำหรับ kernel ใหม่ได้ ดังนั้น VirtualBox จึงไม่สามารถรันได้ คำถามคือ ทำไมโปรแกรมไม่ได้ถูก configure อย่างถูกต้องระหว่างการอัปเกรด kernel แต่เป็นปัญหาอีกประการหนึ่ง ในความเป็นจริงคือความไม่เหมาะสมของ Linux สำหรับการใช้งานบนเดสก์ท็อป ในกรณีนี้คือระบบ Kubuntu 24.04 หรือพูดง่ายๆ คือ Ubuntu
วิธีแก้ไข
การแก้ไขค่อนข้างง่าย ติดตั้งแพ็กเกจที่ขาดหายไป รายการจริงจะแตกต่างกันไปตาม distro และเวอร์ชันเฉพาะ และการใช้ command-line package manager อาจแตกต่างกัน สำหรับผมบน Kubuntu 24.04 (Ubuntu พื้นฐาน ใช้ apt) คำสั่งบรรทัดเดียวคือ:
sudo apt install linux-headers-generic linux-headers-6.14.0-35-generic
รัน /sbin/vboxconfig อีกครั้ง ไดรเวอร์ควร recompile และโหลด และคุณควรสามารถใช้ VirtualBox ต่อได้ปกติ และตอนนี้คุณสามารถทำงานสำคัญนั้นต่อได้
ข้อสรุป
สิ่งที่ผมพบขาดหายไปเสมอใน Linux desktop คือแนวคิด philosophical, product-driven ทุกเครื่องมือทำงานอย่างอิสระ โดยไม่สนใจสิ่งอื่นๆ นักพัฒนาพัฒนา แต่ไม่คิดถึง user experience จริง คุณติดตั้ง kernel ใหม่ ทำไมไม่ "แนะนำ" ให้ recompile ชุดต่างๆ? ทำไมไม่แนะนำ headers? หรืออย่างน้อยตรวจสอบว่าถูกใช้กับ kernel ก่อนหน้าหรือไม่? มีตัวเลือกเยอะมากที่จะทำให้ user experience สтриมไลน์มากขึ้น ไม่ให้บุคคลทั่วไปกลายเป็น system admin ทันทีเมื่อต้องการทำงานจริง สำคัญ
โชคดีที่การแก้ไขปัญหา driver loading ที่นี่ค่อนข้างง่าย แต่ตามที่ผมระบุในรายงานข้างต้น นี่เป็นเพียงหนึ่งในสองปัญหาที่ผมต้องจัดการ ในคู่มือต่อไป ผมจะแสดงอีกปัญหาหนึ่งที่หลีกเลี่ยงได้ และเป็น pure regression ที่ไม่ควรเกิดขึ้นเลย ตอนนี้ ขอให้ VM ของคุณทำงานได้จริง
ขอแสดงความนับถือ