Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIAi2 WildChat-4.8M (AI2)

I have a windows 11 Pro edition which is the host of a Ubuntu Virtual machin on…

  1. User

    I have a windows 11 Pro edition which is the host of a Ubuntu Virtual machin on VirtualBox, I have 2 mice and need that one of them be exclusive to the VM. I probably also need the VM Tools for this to work. Guide me thought the steps

  2. Assistant

    To assign one of your two mice exclusively to your Ubuntu VM running in VirtualBox on a Windows 11 Pro host, you’ll need to use USB passthrough for the mouse device. This will effectively "detach" the mouse from the host and connect it directly to the VM. Here's a step-by-step guide to achieve this:


    Prerequisites:

    1. VirtualBox Extension Pack installed (needed for USB 2.0/3.0 support).
    2. Your Ubuntu VM is already created in VirtualBox.
    3. Both mice are USB devices (not PS/2).
    4. Guest Additions installed in the Ubuntu VM (helps with integration but not strictly needed for USB passthrough).

    Step 1: Install VirtualBox Extension Pack

    • Go to VirtualBox Downloads.
    • Download the VirtualBox Extension Pack matching your VirtualBox version.
    • Open VirtualBox > File > Preferences > Extensions.
    • Click the + icon and select the downloaded extension pack to install it.

    Step 2: Identify the USB Device (the mouse you want to pass through)

    • Plug in both mice.
    • On your Windows host, open Device Manager > find your USB mice under "Human Interface Devices" or "Mice and other pointing devices".
    • Alternatively, open Command Prompt and type:
    usbdeview
    

    (using a USB device viewer tool like USBDeview from NirSoft) can help you identify the exact mouse by Vendor ID (VID) and Product ID (PID).


    Step 3: Add USB Device Filter in VirtualBox

    1. Shut down your Ubuntu VM.
    2. Select your Ubuntu VM > Settings > USB.
    3. Enable USB 2.0 (EHCI) Controller or USB 3.0 (xHCI) Controller depending on your mouse.
    4. Click the + icon on the right to add a new USB filter.
    5. Select your mouse device from the list that pops up — this will create a filter matching that specific mouse.
    6. Click OK to save.

    Step 4: Install Guest Additions (Optional but recommended)

    • Start your Ubuntu VM.
    • Update Ubuntu:
    sudo apt update && sudo apt upgrade -y
    
    • Install required packages:
    sudo apt install build-essential dkms linux-headers-$(uname -r)
    
    • Insert Guest Additions CD:
      • In VM window menu: Devices > Insert Guest Additions CD Image…
    • Mount and run the installer:
    sudo mount /dev/cdrom /mnt
    cd /mnt
    sudo ./VBoxLinuxAdditions.run
    
    • Reboot the VM after installation.

    Step 5: Run the VM and verify exclusive mouse assignment

    • Start the Ubuntu VM.
    • After the VM boots, the mouse you selected should be "captured" by the VM and unavailable to the Windows host.
    • The other mouse remains working in Windows.
    • Test mouse input in Ubuntu to ensure it works.

    Alternative: Using VM Input Capture without USB Passthrough

    VirtualBox has an input capture function where capturing keyboard and mouse input exclusively to the VM works only when the VirtualBox window has focus, but this doesn't allow two mice to be used independently simultaneously.

    USB passthrough as above is the way to truly assign a physical mouse exclusively.


    Troubleshooting tips:

    • If the USB device does not attach, check that no other program on the host is using the mouse.
    • Run VirtualBox as Administrator.
    • Make sure your Windows user is part of the vboxusers group if on Linux hosts (not applicable here).
    • You can also try plugging the mouse in after the VM starts, then from the VM menu: Devices > USB > select the mouse.

    Let me know if you want detailed help on any step!