How to Fix the Invisible Mouse Cursor in a Linux Virtual Machine

How to Fix the Invisible Mouse Cursor in a Linux Virtual Machine

If you’re running a Linux distribution inside a virtual machine (VirtualBox, VMware, QEMU, etc.) and suddenly your mouse cursor disappears after an update, you’re not alone.

The good news? You can fix it easily by enabling software cursor rendering through the SWcursor option.

Step-by-Step Fix for Invisible Cursor in Linux VM

1. Open the Terminal in Your VM

Log in to your Linux desktop inside the VM.
Open the terminal using your distro’s shortcut or from the applications menu.

2. Ensure the Xorg Configuration Directory Exists

Check if the directory is already present:

ls /etc/X11/xorg.conf.d

If it says No such file or directory, create it:

sudo mkdir -p /etc/X11/xorg.conf.d

3. Create the Xorg Configuration File

Open the config file in Nano (as root):

sudo nano /etc/X11/xorg.conf.d/20-modesetting.conf

Paste the following configuration:

Section "Device"
    Identifier "Card0"
    Driver "modesetting"
    Option "SWcursor" "true"
EndSection

This forces Xorg to use the modesetting driver and enables software cursor rendering, which typically solves the invisible mouse problem in virtual machines.

4. Save and Close the File

  • Press Ctrl + O → save
  • Press Enter → confirm file name
  • Press Ctrl + X → exit Nano

5. Reboot the VM

Run:

sudo reboot

After rebooting and logging back in, your mouse cursor should now be fully visible and working as expected.

Thanks for reading 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *