If the virtual machine is not used for a period of time, it is easy to forget the root password. Fortunately, it can be retrieved. Boot into single-user mode for repair, and directly change the password.
1. The following display appears when booting, press "e" to enter grub
2. Select the kernel line and press "e" to enter parameter editing
3. Enter "1"
4. Press "b" to start the system