All Things Xen

General ramblings regarding Citrix XenServer & its open source counter part.

Resetting Lost Root Password in XenServer 7.0

XenServer 7.0, Grub2, and a Lost Root Password

In a previous article I detailed how one could reset a lost root password to XenServer 6.2.  While the article is not limited to 6.2 (it works just as well for 6.5, 6.1, and 6.0.2), this article is dedicated to XenServer 7.0 as grub2 has been brought in to replace extlinux.

As such, if the local root user's (LRU) password for a XenServer 7.0 is forgotten physical (or "lights out") access to the host and a reboot will be required.  The contrast comes with grub2, the methods to boot the XenServer 7.0 host into single user mode, and how to reset the root password to a known token.

The Grub Boot Screen

Once obtaining physical or "lights out" to the XenServer 7.0 host in question, on reboot the following screen will appear:

It is important to note that once this screen appears, you only have four seconds to take action before the host proceeds to boot the kernel.

As should be default, the XenServer kernel is highlighted.  One will want to immediately press the key (for edit).

This will then refresh the grub interface - stopping any count-down-to-boot timers - which will reveal the boot entry.  It is within this window (using up, down, left, and right) one will want to navigate to around line 4 or five and isolate "ro nolvm":

 

Next, one will want to remove (or backspace/delete) the "ro" characters and type in "rw init=/sysroot/bin/sh", or as illustrated:

 

Don't worry if the directive is not on one line!

 

With this change made, press both Control and X at the same time as this will boot the XenServer kernel into single user style mode, or better known as Emergency Mode:

How to Change Root's Password

From the Emergency Mode prompt, execute the following command:

chroot /sysroot

Now, once can execute the "passwd" command to change root's credentials:

Finally....

Now that root's credentials have been changed, utilize Control+Alt+Delete to reboot the XenServer 7.0 host and one will find via SSH, XenCenter, or directly that the root password has been changed: the host is ready to be managed again.

 

XenServer 7.0 performance improvements part 3: Par...
XenServer 7.0 performance improvements part 2: Par...

Related Posts

 

Comments 6

Tobias Kreidl on Friday, 24 June 2016 10:52

Many thanks for this update, Jesse! It should be turned into a KB article, as well, if not already.

0
Many thanks for this update, Jesse! It should be turned into a KB article, as well, if not already.
Guest - Jordan Kostov on Monday, 27 June 2016 07:21

Heya guys!

Great post again!

We managed to crash Xenserver 7 and we can simulate it step by step.
Where we can report the issue and give the logs?

Best regards,
Jordan

0
Heya guys! Great post again! We managed to crash Xenserver 7 and we can simulate it step by step. Where we can report the issue and give the logs? Best regards, Jordan
JK Benedict on Monday, 27 June 2016 10:11

Jordan --

Thanks for the compliments! However, it seems more apropos to say "Sorry to hear about your situation!"

So, the steps in reporting this issue would be:

1. Contact Citrix Support. If you don't have support with Citrix you can always visit http://xenserver.org/get-support.html.

2. If you don't have support, you can use the Incident Database (https://bugs.xenserver.org/). Here, you can state the issue, how/when it occurs, etc. Those who volunteer and also those who permanently field these incidents will respond as they are able.

3. Log data! You can leverage https://cis.citrix.com and upload a Server Status Report (generated from XenCenter). More information on this process can be found here:
https://cis.citrix.com/howitworks/

The last part is the most key, naturally. Also, if you need to see how one can use XenCenter to collect data from XenServer, store it as a ZIP file on your desktop, and subsequently upload that data to your secure/private workspace at https://cis.citrix.com, check out:
http://support.citrix.com/article/CTX125372#Proc1


Thanks!
-jkbs | @xenfomation

0
Jordan -- Thanks for the compliments! However, it seems more apropos to say "Sorry to hear about your situation!" So, the steps in reporting this issue would be: 1. Contact Citrix Support. If you [b]don't[/b] have support with Citrix you can always visit http://xenserver.org/get-support.html. 2. If you don't have support, you can use the Incident Database (https://bugs.xenserver.org/). Here, you can state the issue, how/when it occurs, etc. Those who volunteer and also those who permanently field these incidents will respond as they are able. 3. Log data! You can leverage https://cis.citrix.com and upload a Server Status Report (generated from XenCenter). More information on this process can be found here: https://cis.citrix.com/howitworks/ The last part is the most key, naturally. Also, if you need to see how one can use XenCenter to collect data from XenServer, store it as a ZIP file on your desktop, and subsequently upload that data to your secure/private workspace at https://cis.citrix.com, check out: http://support.citrix.com/article/CTX125372#Proc1 Thanks! -jkbs | @xenfomation
Guest - Jordan Kostov on Monday, 27 June 2016 11:45

We have support . The reason I was asking is that it is tested on a non licensed servers before moving to production.

Anyway case is already opened :).
Thanks!

1
We have support . The reason I was asking is that it is tested on a non licensed servers before moving to production. Anyway case is already opened :). Thanks!
Guest - Nicholas Lee Fagan on Wednesday, 20 July 2016 21:14

Thanks Benedict. We all are going to eventually need this guide xD

0
Thanks Benedict. We all are going to eventually need this guide xD
Guest - Shaw on Thursday, 11 August 2016 12:02

This solution to my problem,Thanks very much。

from china!!!

0
This solution to my problem,Thanks very much。 from china!!!

About XenServer

XenServer is the leading open source virtualization platform, powered by the Xen Project hypervisor and the XAPI toolstack. It is used in the world's largest clouds and enterprises.
 
Commercial support for XenServer is available from Citrix.