You can follow the solution described there:
edit /usr/share/X11/xorg.conf.d/50-vmmouse.conf
and add this:
Section "InputClass"
Identifier "vmmouse"
MatchIsPointer "on"
MatchTag "vmmouse"
Driver "vmmouse"
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
EndSection