To be sure, just do a test.
Run the VM, boot the guest OS, then close the VM (Alt+F4 or reboot the host OS). Then run the VM again and see if the guest OS boots. If it does not, that is, if it just restores to where it was, then the state was saved and restored and you should be fine. If it does boot, then your VM is not set to save/restore states. In this case, you need to watch the boot to see if it shows any indication of a bad shutdown. (I’m not familiar with the ins and outs of Ubuntu, but I’m sure that it has some sort of notice or system/disk-check on the next boot after a bad shutdown.)
Also, make sure that the guest OS is set to handle power-down events (like pressing the power button on a physical system) because VMs generally shut down guest OSes by simulating that button being pressed, otherwise it ends up being “shut down” as it would if you just cut the power.