These are the steps I used to add two cursors on Ubuntu 24.04 (I used the documentation from Arch Linux web site, see below)
Add an “Auxiliary” pointer/keyboard to your xinput:
$ sudo xinput create-master "Auxiliary"
Run “xinput list” and you will see something like this at the end:
⎡ Auxiliary pointer id=17 [master pointer (18)]
⎜ ↳ Auxiliary XTEST pointer id=19 [slave pointer (17)]
⎣ Auxiliary keyboard id=18 [master keyboard (17)]
↳ Auxiliary XTEST keyboard id=20 [slave keyboard (18)]
Now plug your external mouse and run “xinput list” again, you will see that a new device appeared in your list, example:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ...
⎜ ↳ Logitech M510 id=21 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
Now re-attach this device to your auxiliary pointer:
$ sudo xinput reattach 21 "Auxiliary"
You will see that a new mouse appeared in your screen and you can move it independently of you initial mouse cursors.