This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-users] resetting lost root password on a xen guest

To: Darren Jacobs <dhj@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] resetting lost root password on a xen guest
From: Nico Kadel-Garcia <nkadel@xxxxxxxxx>
Date: Tue, 30 Oct 2007 15:49:11 +0000
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 30 Oct 2007 08:48:41 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=WVfvwy6pBgNF3htFO+Do7D7Nwv9OdOKkgZFwJwRwKFY=; b=jHNrrHMA/48kXfhQMFUyuaAG/Wf5TVaFkiPInQMNUZkJJF+GEbWAN7/ejmzWMOfR6UAdmkeQIIZgsygoOKEMVX9zCYeMSlcbb2SradeWqBrBim8zlmRCsF1+1WkqOAR7x6IWb4clYpqwhjmbkWtaJDuPeB0SZ3rQdhRMWDfcz60=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=frRGwNn9HWneKjPfbm2+4st89cUqXY9uDznQpc6xsZ3ng/dnRn9Se+q9pZw7Etw1ejWRyCPYC702G0XwN2h3WZaVKrrYf4NuqEBTTWNLj9iFrNKGi7B5qdACvz+dkcV+1lgkVE2kP3xxkrobJDWkKjg1dIBa2wUwfrb38tqmihM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4C403314-E476-43CC-B679-AC1F6F799896@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4C403314-E476-43CC-B679-AC1F6F799896@xxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (Windows/20070809)
Darren Jacobs wrote:
Hi All,

I need to get into a xenguest running linux for which the root password has been lost. I'm running xen 3.0.3 under RH 5.

I'm trying to figure out how to get pygrub for this guest to load up the typical "init=/bin/sh" to get the console to come up at the command line prompt so I can reset the root password.
Why? Can't you shut down the DomU, mount the DomU's "/" partitin, do a chroot to it, and edit it from the Dom0?

If not, you should be able to use "xm create -c domain" to get the grub console and boot into single user mode, unless you've been very fascist about your grub configuration.

Trolling though google I've see suggestions to add args = 'init=/bin/sh' or opts = 'init=/bin/sh' to the guest configuration file. None of them appeared to have worked. If I do a 'xen create echo11 -n' after making any of the above file mods I see that the args were not modified:

    (name echo11)
    (memory 500)
    (on_reboot restart)
    (on_crash restart)
    (vcpus 1)
    (uuid cb855323-2867-b84a-d766-32a39d252bb7)
    (bootloader /usr/bin/pygrub)
            (ramdisk /var/lib/xen/initrd.kIQYUw)
            (kernel /var/lib/xen/vmlinuz.Xwl81-)
            (args 'ro root=/dev/VolGroup00/LogVol00')
(tap (uname tap:aio:/var/lib/xen/images/echo11) (dev xvda) (mode w))
    (device (vif (bridge xenbr0) (mac 00:16:3e:69:69:90)))

So I tried to bring the guest up manually from dom0 with " pygrub /var/lib/xen/images/echo11.dsk". When the menu comes up I edit the kernel line directly and insert "init=/bin/sh". You can see below that the init statement was indeed read:
See, this is where you should use "xm create -c 'DOMAIN'"

Xen-users mailing list