Forgot root password on ubuntu and ubuntu 9 running on Citrix Xenserver

By | December 10, 2009

If you have forgotten the password for your ubuntu server, the following steps may help you recover it
On a traditional Pc
BOOT PC

Press ESC at the grub prompt.
Press e to edit the kernel parameters.
Select line that starts kernel ………, press e
Go to the end of line, and add the following:  rw init=/bin/bash
press enter, then press b to boot your system.

Your system will boot up in a single user shell.

Now its time to change your password
Type in passwd username Ex passwd root

Type in your password then confirm it
Once done
Type in reboot

On a Citrix Xenserver

From Xencenter Select the vm you want to boot in single user mode,
then right click and press properites
In Startup Options find the OS Boot parameters, and type in rw init=/bin/bash
(NOTE If you already have something in the OS Boot Parameters pls take note of this as you will have to put it back once the password reset is complete)

Save and close this window and reboot your vm

Your system will now boot up in single user mode.

Now its time to change your password
Type in passwd username Ex passwd root

Type in your password then confirm it

Now go Back to the Xencenter Application and Startup options and

remove the entry you added before, if you replaced the entry with something else before, now paste back what was there,
Now you can save and close the xencenter properties
Once done
Type in reboot

And your vm should be back to normal, only with your new root password

3 thoughts on “Forgot root password on ubuntu and ubuntu 9 running on Citrix Xenserver

  1. Marcelo Matos

    Hi Issac! I have some problems and maybe you can help me. I have some VM’s severs RHEL 5.3 x64 on Xen 5.5 (Citrix), it was instaled without paravirtualized option. When the VM was created, I selected a “Custom template” and now i can’t install xen-server-tools. The network performance on the VM, sounds slower than it must be. The network adapter that RHEL suggest is a 100mb, when the fisic adapter is 3x1Gb. Do you know how a fixt this problems? Thanks!

  2. Marcelo Matos

    Hi Issac!
    I have some problems and mabe you can help me.
    I have some servers (VM) RHEL 5.3 x64 instaled on Xen 5.5 (citrix). When then are installed, i use “Custom Template” option, but now i can’t istall the xen-server-tools on it. Also the network seens to bee slower that it be. The network adapter that RHEL shows is a 100Mb, but the real its 3x1Gb. Do you know how can i fixt this problems?
    Thanks and regards!

  3. TeePOG

    Tip: Instead of putting “rw init=/bin/bash” in the kernel parameters / XenCenter startup options, just put “single” instead. In pretty much any Ubuntu since 8.04.3, this will present you with a menu from which you can change the root password, obtain a root console, repair files, etc… (The precise options depend on which edition you’re using).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.