All Things Xen
General ramblings regarding Citrix XenServer & its open source counter part.
Resetting Lost Root Password in XenServer 6.2
Bad things can happen... badly. In this case the root password to manage a XenServer (version 6.2) was... lost.
Physical or remote login to the XenServer 6.2 host failed authentication, naturally, and XenCenter had been disconnected from the host: requiring an administrator to provide these precious credentials, but in vein.
An Alternate Situation
Had XenCenter been left open ( offering command line access to the XenServer host in question) the following command could have been used from the XenServer's command line as to initiate a root password reset:
Once the root user's password has been changed the connection to the host from XenCenter to the XenServer host will need to be reestablished: using the root username and "new" password.
Once connected the remainder of this article becomes irrelevant otherwise you may very well need to...
Boot into Linux Single User Mode
Be it forgetfulness, change of guard, another administrator changing the password, or simply a typo in company documentation, the core problem being address via this post is that one cannot connect to XenServer 6.2 as the root password is... lost or forgotten.
As a secondary problem, one has lost patience and has obtained physical or iLO/iDRAC access to the XenServer in question, but still the root password is not accepted:
The Shortest Solution: Breaking The Law of Physical Security
I am not encouraging hacking, but that physical interaction with the XenServer in question and altering the boot to "linux single user mode" is the last solution to this problem. To do this, one will need have/understand:
- Physical Access, iLO, iDRAC, etc
- A rebooted of the XenServer in question will be required
With disclaimers aside I now highly recommend reading and reviewing the steps outlined below before going through the motions.
Some steps are time sensitive, so being prepared is merely a part of the overall pla.
- After gaining physical or iLO/iDRAC access to the XenServer in question, reboot it! With iLO and iDRAC, there are options to hard or soft reset a system and either option is fine.
- Burn the following image into your mind for after the server reboots and runs through hardware BIOS/POST tests, you will see the following for 5 seconds (or so):
- Immediately grab the keyboard and enter the following:
menu.c32 (press enter)
- The menu.c32 boot prompt will appear and again, you will only have 5 or so seconds to select the "XE" entry and pressing tab to edit boot options:
- Now, at the bottom of the screen one will see the boot entry information. Don't worry, you have time so make sure it is similar to the following:
- Near the end of the, one should see "console=tty0 quiet vga=785 splash quiet": replace "quiet vga=785 splash" with "linux single". More specifically - without the quotes - such as:
- With that completed, simply press enter as to boot into Linux's single user mode. You should eventually be dropped into a command line prompt (as illustrated below):
- Finally, we can reset the root password to something one can remember by executing the Linux command:
- When prompted, enter the new root user password: you will be asked to verify it and upon success you should see the following:
- Now, enter the following command to reboot the XenServer in question:
- Obviously, this will reboot the XenServer as illustrated below:
- Let the system fully reboot and present the xsconsole. To verify that the new password has taken affect, select "Local Command Shell" from xsconsole. This will require you to authenticate as the root user:
- If successful you will be dropped to the local command shell and this also means you can reconnect and manage this XenServer via XenCenter with the new root password!