VMWareでの仮想環境構築で死亡した件

さて、最近、マニュアルを書くのもChatgptにお任せとなっております。:wink:
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1665829/b30ad226-66cc-456e-a992-c423ea318e2b.png)

こんな感じで、手元のMac PCから自宅サーバ（Oracle Linux９）KVM上に構築した仮想環境上で動く、Ubuntu24にリモートアクセスして、色々と作業しております。
当初はLinux KVMではなく、VMWare Workstation Pro上でUbuntuを動かしていたのですが、どうも不安定なので、KVM上に変換＆移行しました。

VMWare上では不安定の意味ですが、Kernel不適合で、SSHアクセスはできても、GUIでのRemoteアクセスが不可になる事例が頻発した為です。一方で、KVMでは今までエラーが起きたことがありません。

つまり、少なくとも私の環境では、KVMの方が仮想化環境として安定しております。
なぜか？
原因を分析しました。（とは言っても、Chatgptに作成させましたが。:sweat_smile:）

＝＝＝＝＝＝＝＝
# Virtualization & the Linux Kernel
**Why host-kernel compatibility is critical, and why KVM “just works” while VMware Workstation Pro can break**

---

## 1. What Is the Kernel?
The **kernel** is the core of an operating system, sitting between your hardware (CPU, memory, disks, network cards) and all your applications and services. Its responsibilities include:

- **Resource Management**
  - **Process scheduling:** Deciding which programs get CPU time and when.
  - **Memory management:** Allocating RAM, handling paging/swapping, and enforcing isolation.
  - **Device I/O:** Exposing hardware through uniform interfaces (device drivers).

- **Abstraction & Isolation**
  - Provides stable **system calls** (e.g. `open()`, `read()`, `fork()`) so applications needn’t know hardware details.
  - Enforces security boundaries so one process can’t corrupt another’s memory.

- **Modularity (in Linux)**
  - Core functionality lives in a small core; most drivers and features are in **loadable kernel modules** (e.g. filesystems, network stacks, virtualization modules like `kvm.ko`).

---

## 2. Why Kernel Issues Matter in Virtualization

> **Key Point:** Virtualization hooks deep into the kernel. Any mismatch between your host’s kernel version/configuration and the hypervisor’s modules can prevent VMs from powering on.

### KVM (in-tree) vs. VMware Workstation (out-of-tree)
| Aspect                     | KVM (Kernel-based VM)                | VMware Workstation Pro                     |
|----------------------------|--------------------------------------|--------------------------------------------|
| **Module Location**        | Part of mainline Linux tree          | Separate source package, rebuilt via DKMS  |
| **ABI Compatibility**      | Guaranteed within each kernel series | Subject to breakage whenever kABI changes  |
| **Update Cadence**         | Ships with every distro kernel build | Lags behind new kernels; needs vendor patch|
| **Feature Flag Support**   | Inherits distro’s tested config      | Must add support for each new kernel flag  |

---

## 3. Representative User Complaints

> These are real-world reports from forums, bug trackers, and Q&A sites.

3. Representative User Complaints

▪️Rocky Linux DKMS Build Failures
“After upgrading to kernel 6.x, DKMS can’t build vmmon.ko and vmnet.ko, leaving VMs unstartable.”
References:
- https://forums.rockylinux.org/t/kernel-modules-for-installing-vmware-workstation-17/14028
- https://bugs.rockylinux.org/view.php?id=6570

▪️Missing/Deprecated Symbols
“Compilation errors for symbols like dev_base_lock or netdev_lock on newer kernels, requiring manual source fixes.”
References:
- https://www.linuxquestions.org/questions/slackware-14/vmware-modules-build-broken-w-kernel-6-9-a-4175737459/

▪️Secure Boot Blocks Modules
“Unsigned VMware modules won’t load under Secure Boot—‘Could not open /dev/vmmon’ until manual signing.”
References:
- https://askubuntu.com/questions/1312288/vmware-workstation-pro-vmmon-not-found
- https://knowledge.broadcom.com/external/article/315309/cannot-open-devvmmon-no-such-file-or-dir.html

▪️Kernel Headers Mismatches
“Even with kernel-headers installed, VMware DKMS reports ‘C header files matching your running kernel were not found.’”
References:
- https://askubuntu.com/questions/1375827/ubuntu-20-04-c-header-files-matching-your-running-kernel-were-not-found
- https://bbs.archlinux.org/viewtopic.php?id=298992

▪️Delayed Vendor Support
“Workstation Pro 17.x doesn’t officially support kernels ≥ 6.1 until the next VMware patch—users must roll back or wait.”
References:
- https://www.reddit.com/r/vmware/comments/1dxmuwg/vmware_workstation_pro_on_linux_wont_compile_on/
- https://github.com/mkubecek/vmware-host-modules/issues/278

---

## 4. Conclusion & Recommendations

- **KVM’s Advantage:** Its virtualization modules are part of every Linux kernel release and benefit from your distro’s rigorous ABI-stability guarantees.
- **VMware’s Challenge:** Out-of-tree modules rebuilt via DKMS can—and often do—break when the host kernel’s internal ABI changes.

> **Recommendation:**
> - For rolling-release or frequently updated hosts, prefer **KVM** for rock-solid VM reliability.
> - If you require VMware Workstation Pro, pin your host to a **supported kernel version** or delay host upgrades until VMware issues a compatible patch.

---

*End of Report*