萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Linux 教學

VMware 虛擬機 Ubuntu 滑鼠中鍵失效解決:xorg.conf Protocol 與 vmmouse 驅動調整

VMware 安裝 Ubuntu 後滑鼠中鍵(滾輪按鍵)無法運作,嚴重影響操作效率。經測試,修改 X11 設定檔中的輸入裝置協定與驅動即可解決。

解決步驟

  1. 以管理員權限編輯 X 設定檔:sudo gedit /etc/X11/xorg.conf
  2. 找到 Section "InputDevice" 區塊,修改 Protocol 選項:
Option "Protocol" "ImPS/2"

原值通常為 "ps/2" 或 "auto"。若無此行則新增。

  1. 確認/新增以下關鍵選項:
Option "Emulate3Buttons" "yes"
Driver "vmmouse"  # 必須為 VMware 專用驅動,而非通用 "mouse"
  1. 完整 InputDevice 區塊參考:
Section "InputDevice"
    Identifier "Configured Mouse"
    Driver "vmmouse"
    Option "Protocol" "ImPS/2"
    Option "CorePointer"
    Option "Device" "/dev/input/mice"
    Option "ZAxisMapping" "4 5"
    Option "Emulate3Buttons" "yes"
EndSection
  1. 重啟 X 伺服器生效:Ctrl+Alt+Backspace 或重啟系統。

原理說明

  • ImPS/2 協定:支援滾輪(Z 軸)與第三按鍵事件,ps/2 僅支援兩鍵。
  • vmmouse 驅動:VMware Tools 提供的專用驅動,優化虛擬環境下的滑鼠事件傳遞與絕對/相對座標切換。
  • Emulate3Buttons:雙鍵同時點擊模擬中鍵,配合 ImPS/2 確保中鍵事件產生。

適用範圍

適用於 VMware Workstation / Fusion / Player 中運行的 Ubuntu、Debian、CentOS 等使用 Xorg 的發行版。Wayland 會話下請改用 libinput 設定或安裝 xserver-xorg-input-vmmouse 套件。

copyright © 萬盛學電腦網 all rights reserved