Inside the guest (not on your machine, but inside the VM), you need to install "Guest Additions" for Virtualbox. From the Virtualbox manual here, see this snippet:
Mouse pointer integration
To overcome the limitations for mouse support that were described in Section 1.8.2, “Capturing and releasing keyboard and mouse”, this provides you with seamless mouse support. You will only have one mouse pointer and pressing the Host key is no longer required to "free" the mouse from being captured by the guest OS. To make this work, a special mouse driver is installed in the guest that communicates with the "real" mouse driver on your host and moves the guest mouse pointer accordingly.
You don't need to download the guest additions separately, they come with Virtualbox. See lower down in the same link above for detailed installation instructions for your guest operating system.