Setting Up USB Mice

General Information

Assuming you have a supported usb interface, being uhci, ehci, or ohci, and a usb hid mouse with or without a scroll wheel, this guide may or may not help you.


Although most people report that their USB devices, including HID mice work out of the box on 5.x, I still recommend that you recompile your kernel to make sure everything works properly.

If you are still using a legacy release of FreeBSD you must recompile your kernel for USB mouse support.

Assuming you are using the x86 architecture, a standard chipset such as Sis, Via, or Intel, and have a USB 1.1-2 compliant host adapter, you first need to do the following:

# cd /usr/src/sys/i386/conf
# nano -w HOSTNAME

Make sure the following entries are present under the USB support portion of the configuration file:


# USB support
device          uhci          # UHCI PCI->USB interface
device          ohci          # OHCI PCI->USB interface
device          ehci          # EHCI PCI->USB interface (USB 2.0)
device          usb           # USB Bus (required)
device          ugen          # Generic
device          uhid          # "Human Interface Devices"
device          ukbd          # Keyboard
device          ums           # Mouse

Comment out the ehci entry if your motherboard doesn’t have a USB 2.0 compatible interface. Comment out the ukbd entry if you don’t want support for usb keyboards. Save the configuration file.

# /usr/sbin/config HOSTNAME
# cd ../compile/HOSTNAME
# make depend
# make
# make install
# reboot

Assuming you didn’t disable the mouse daemon, once the system has booted, you should see a mouse pointer on the console which should be movable.

In order to setup xorg/x11 with your usb mouse, you should disable and kill the mouse daemon. Edit /etc/rc.conf and add the following lines to the bottom:


In the /etc/X11/xorg.conf or /etc/X11/XF86Config file, under the InputDevice section, the following should be used if you have a usb mouse with a wheel.

    Identifier  "Mouse1"
    Driver      "mouse"
    Option "Protocol"    "Auto"
    Option "Device"      "/dev/ums0"
    Option "ZAxisMapping"       "4 5"

You now have a working usb mouse on your FreeBSD workstation. Congratulations!

Speak Your Mind