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.

  • Do you have control of the Dom0? – fukawi2 Apr 15 '13 at 4:21
  • Please post the DomU-configuration. What XEN-Server ist this, which CentOS-major version, how is the DomU disk configured? – Nils Apr 17 '13 at 10:42

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".

|improve this answer|||||

If you have access to the parent:

xm console $vm

Will drop you into the console (can be escaped out of like telnet).

|improve this answer|||||

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/

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.