The virtual machine will lock the screen every once in a while, here is the solution
Find your Ubuntu settings, my version is 18.04, and I chose Chinese at the time, so first find the settings in the upper right corner (as shown below: click the lower triangle next to shutdown)