Need help on resetting root password of a CentOS which is a guess OS (domU) in XEN. I already tried to get to grub but it doesn't display or maybe using a different grub (pygrub). Thanks in advance.
3 Answers
Shut down the guest VM, mount its disk on another VM that you have access to, then manually change the guest's /etc/shadow, or do a chroot to the mounted disk followed by "passwd".

- 1,336
- 5
- 23
- 40
If you have access to the parent:
xm console $vm
Will drop you into the console (can be escaped out of like telnet).

- 176
- 5
1- Shut down your server using the Xencenter controls
2- Right click on machine and select Properties 3- Go under Boot options Change the OS Boot Parameters to rw init=/bin/bash
Some times for some OS especial CentOS you will need to write in the field the word single instead of rw init=/bin/bash so try both if first trick didn’t work. 4- Save and Start your virtual machine
Your system will boot up in single user mode. So to change your password, you need to type this command:
bash# passwd root
5- Type in your new password you will then be asked to confirm it
Your password has now been reset.
6- Shutdown your virtual machine. Now go back to the xencenter and startup options and remove rw init=/bin/bash and change it back to whatever was there before. Start up your server and you should be able to logon with your new root password.
Source : http://www.unixmen.com/reset-root-password-linux-vm-hosted-xenserver/

- 131
- 4