經典問題:VMware Tools 安裝後仍無滾輪,或滾輪方向反轉、跳動。
vmmouse 驅動,而非通用 mouse。Protocol "PS/2" 或 "ImPS/2",但 vmmouse 需特定協議與選項組合。ZAxisMapping (滾輪軸映射) 與 Emulate3Buttons (模擬中鍵)。/etc/X11/xorg.confsudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
sudo vim /etc/X11/xorg.conf
Section "InputDevice"
Identifier "Configured Mouse"
Driver "vmmouse" # 關鍵:VMware 專用驅動
Option "Protocol" "ImPS/2" # 協議:ImPS/2 支援滾輪 (Z 軸)
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5" # 滾輪上/下映射為按鈕 4/5
Option "Emulate3Buttons" "yes" # 模擬中鍵 (雙鍵同時按下)
EndSection
| 選項 | 作用 | 常見錯誤值 |
|---|---|---|
| Driver | 必須為 vmmouse (VMware Tools 提供) | mouse (通用驅動,無法識別虛擬設備特性) |
| Protocol | ImPS/2 (IntelliMouse PS/2,支援 Z 軸) | PS/2 (無滾輪)、ExplorerPS/2 (舊) |
| ZAxisMapping | 將滾輪事件映射為按鈕 4/5 (X11 標準) | 缺失或寫錯 (如 "5 4" 導致反向) |
| Emulate3Buttons | 雙鍵同時按下模擬中鍵 (粘貼/滾動) | 缺失導致中鍵無效 |
# 重啟 X Server (任選一)
sudo systemctl restart display-manager # systemd 系統
# 或
sudo init 3 && sudo init 5 # SysVinit 系統
# 或 (最暴力)
Ctrl+Alt+Backspace (需啟用 DontZap 選項)
測試:瀏覽器/終端/文件管理器滾輪滾動、中鍵粘貼。
cp /etc/X11/xorg.conf{,.bak} — 配置錯誤會導致圖形界面無法啟動,需進單用戶模式恢復。InputClass 區分配置。open-vm-tools + open-vm-tools-desktop (發布版倉庫) 而非 VMware 官方安裝腳本 — 內核升級自動重編譯模塊、無內核模塊簽名問題。Driver "vmmouse" + Protocol "ImPS/2" + ZAxisMapping "4 5" + Emulate3Buttons "yes" — 這四項是 VMware 虛擬機 Xorg 會話下鼠標滾輪正常工作的鐵律。現代系統優先用 Wayland+libinput 免配置;必須用 Xorg 時,按此配置一勞永逸。