1, first of all, you need to reboot the system, and then the power-on, direct hold down the shift button.
2, then, will go to the console page, the following figure.
3, wait a moment, into the Recovery menu page, through this page you can see that there are 9 options (the system version is 12.04 version)
4, then, select the root permission option. According to others, although it is read-only, but in fact, after the selection has been able to write. The next step is to change the password.
5, after the selection of root will be entered under the console. Modify the password under your own user (the default is passwd + username), after the modification is completed, because the page has been unable to use the mouse operation, this time, click "Ctrl+alt+del".
6, the last, that is, the console will exit. You can then re-enter the system with the new password. (because most of the Linux installed under the virtual machine, the reminder is that in the process of doing so, the mouse is completely prohibited, through the shortcut keys to release is not successful)
Note: The above steps are carried out under the Ubntu, the CentOS system is not necessarily able to support.