Accessing your guest from the rescue image

From PrgmrWiki

So, your guest doesn't boot. Perhaps the new xen upgrades broke things, and you need to upgrade your guest kernel to something more modern?

Shut down your machine if it is running. Then select

    6. set bootloader or rescue mode

This will bring up a menu:

Set Boot Options - nite

Configured to boot from disk.

1. Boot from disk
2. Linux-based Live Rescue
3. Linux netboot installers - install mode
4. Linux netboot installers - rescue mode
5. BSD installers

0. Return to main menu
R. refresh

enter selection>


    2. Linux-based Live Rescue

(note, any of the other "rescue" images should also work. many userlands (well, libC) require kernels that are within a certain range, so pick the one that looks right for you, and try others if it doesn't work)

Log in as root.

Now, mount your writable partition

mount /dev/xvda1 /mnt

If you have multiple partitions, you may need to try mounting each one and running 'ls /mnt' to find the root partition. Remember to run 'umount /mnt' before looking at the next one.

Once the main root partition has been mounted on /mnt, bind mount /proc /dev/ and /sys so they will be available in the chroot

for i in /proc /sys /dev /dev/pts /dev/shm ; do
    mount -o bind $i /mnt/$i

If you need to resolve DNS entries and you are using dhcp with your writeable image, check the output of

cat /mnt/etc/resolv.conf

and if it doesn't contain any nameserver entries, also do

cp /etc/resolv.conf /mnt/etc/resolv.conf 

From here, you can "change root" (chroot) to /mnt/ so you are now running with your main file system using the rescue kernel.

chroot /mnt/

apt-get, yum, or whatever you use to upgrade your kernel should work from here. You may get a problem if the rescue kernel is way too different from your userland kernel, in which case you should go back to step 1 and use a different rescue type.

To clean up, use

exit #if still in chroot
for i in /dev/pts /dev/shm /proc /sys /dev  ; do
    umount /mnt/$i
umount /mnt