It's been reported on ubuntuforums in a thread linked to here that the logitech software doesn't work under virtualbox+WinXP. I got it to run, but only seemed to be able to configure 1 mode, and the mode switch button cycles the mode light off-off-red (the mode I configured last was red)
You'll want another mouse plugged in as well for this:
- Set up a USB filter for the logitech mouse in virtualbox (you'll lose the mouse in your host OS when the VM is running)
- Install the logitech software under XP
- reboot the VM repeatedly until no more new hardware found
- using the other mouse you plugged in earlier, run the logitech software and configure (bizarrely the G300 has an effect in the logitech software but doesn't move the pointer)
- be sure that you are saving the config to the onboard memeory
- close the VM to test (you can leave it paused)
Edit: Once the mouse has been configured under windows it will behave the same under ubuntu (or indeed if you take it to another machine).
This script from the linked ubuntuforums thread may help to set to mode on boot:
#!/bin/sh
G300_XINPUT_ID=$(xinput list | egrep --color=never "G300.*keyboard" | sed -r 's/.*id=([0-9]+).*/\1/')
xinput set-mode ${G300_XINPUT_ID} RELATIVE
Edit 2: If you use the VM for other things, you'll probably want to disable the filter after setting up the mouse, otherwise your mouse won't work with your VM running