# Mouse only works as root



## jardows (May 14, 2012)

I installed X and KDE from an updated ports tree on a clean FreeBSD 9.0 installation.  I installed and configured everything according to the handbook, but when I startx, the mouse does not respond unless I am logged in as root.  Here is the mouse section from my X log:


```
(II) config/hal: Adding input device Microsoft 3-Button Mouse with IntelliEyeTM
(II) LoadModule: "mouse"
(II) Loading /usr/local/lib/xorg/modules/input/mouse_drv.so
(II) Module mouse: vendor="X.Org Foundation"
        compiled for 1.7.7, module version = 1.7.1
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 7.0
(WW) Microsoft 3-Button Mouse with IntelliEyeTM: No Device specified, looking for one...
(II) Microsoft 3-Button Mouse with IntelliEyeTM: Setting Device option to "/dev/ums0"
(--) Microsoft 3-Button Mouse with IntelliEyeTM: Device: "/dev/ums0"
(==) Microsoft 3-Button Mouse with IntelliEyeTM: Protocol: "Auto"
(**) Microsoft 3-Button Mouse with IntelliEyeTM: always reports core events
(**) Option "Device" "/dev/ums0"
(EE) xf86OpenSerial: Cannot open device /dev/ums0
        Device busy.
(EE) Microsoft 3-Button Mouse with IntelliEyeTM: cannot open input device
(II) UnloadModule: "mouse"
(EE) PreInit returned NULL for "Microsoft 3-Button Mouse with IntelliEyeTM"
(EE) config/hal: NewInputDeviceRequest failed (8)
```

I do not know where to look next to resolve this issue, so any suggestions would be appreciated!


----------



## SirDice (May 15, 2012)

Use /dev/sysmouse, not /dev/ums0.


----------



## dove (Jun 9, 2012)

jardows said:
			
		

> (EE) xf86OpenSerial: Cannot open device /dev/ums0
> Device busy.



In my case (8.3-stable 20120509, up to date ports), it had nothing to do with being root or not. Restarting X (hald, no xorg.conf at all) would in some cases find /dev/ums0 as the mouse device and sometimes /dev/sysmouse.


```
/var/log/Xorg.0.log-(WW) USB-PS2 Optical Mouse: No Device specified, looking for one...
/var/log/Xorg.0.log:(II) USB-PS2 Optical Mouse: Setting Device option to "/dev/sysmouse"
```

or


```
/var/log/Xorg.0.log-(WW) USB-PS2 Optical Mouse: No Device specified, looking for one...
/var/log/Xorg.0.log:(II) USB-PS2 Optical Mouse: Setting Device option to "/dev/ums0"
```

HAL always seems to have the right idea.

```
hal-find-by-capability --capability input.mouse | xargs hal-device | grep input.device
  input.device = '/dev/sysmouse'  (string)
```

See also http://markmail.org/message/xyh3vjqmcddyiaez
 - suggests fixing xf86-input-mouse to not just randomly probe

And http://markmail.org/message/7fwzba5vqacyytpx
 - refers to psm0 vs sysmouse, but the issue is similar for ums0 vs sysmouse
 - suggests configuring HAL policy as a possible solution


----------



## ChalkBored (Jun 14, 2012)

I had the same problem, the ownership of /dev/sysmouse was root:wheel, while /dev/ums0 was owned by rootperator.

Changing the ownership of /dev/sysmouse to rootperator fixed the problem, but I'm not sure if the permissions were wrong, or if /dev/sysmouse is supposed to be root:wheel for a reason.


----------



## SirDice (Jun 14, 2012)

ChalkBored said:
			
		

> Changing the ownership of /dev/sysmouse to rootperator fixed the problem, but I'm not sure if the permissions were wrong, or if /dev/sysmouse is supposed to be root:wheel for a reason.


The permissions should be correct. They are on my system and I don't have any problems with sysmouse:

```
dice@williscorto:~>ll /dev/sysmouse 
crw-------  1 root  wheel    0,  22 May  5 20:29 /dev/sysmouse
```


----------



## wblock@ (Jun 14, 2012)

On the mailing lists, the solution that has worked a couple of times was to enable moused(8) in /etc/rc.conf:

```
moused_enable="YES"
```

And disable HAL in xorg.conf by adding

```
Option "AutoAddDevices" "Off"
```
to ServerLayout.

To me, the problem looks like a race condition to see whether HAL gets the mouse first.  moused(8) starts before HAL, so then there's no problem.

Another way would be to disable or remove HAL entirely if it's not required by your desktop.

xfce does not require HAL.  A couple of port options may need to be changed to be able to uninstall it.

KDE does need HAL, although it should still be possible to disable it for X input device detection as above.

Not sure about Gnome, but I'd guess it's the same situation as KDE.


----------

