Open the terminal with ctrl+alt+t in the virtual machine,
enter the following commands one by one and execute them
, then restart the ubuntu system
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop