My colleague presented me with a poser: Lost password on Xen guest - What do you do? What I normally do is, of course, mount the file system, edit the /etc/passwd (shadow file) and restart without a root password - quickly resetting it once back in. Of course, with all the virtualization - what do you do? I tried just mounting the /var/lib/xen/vutil.img file - no luck. Then someone said try
# losetup -f /var/lib/xen/images/vutil.img
I did but still couldn't get /dev/loop0 to mount. So I tried another tip - this got me closer:
# kpartx -av /dev/loop0
This created /dev/mapper/loop0p1 and /dev/mapper/loop0p2. I really wanted to immediately mount the root partition so I tried the loop0p2 which was obviously larger. p1 was probably /boot, I thought - it was. Eventually, I realized p1 would be useful after all. Since I couldn't get p2 to mount, I mounted p1, edited the grub.conf to include a single user mode boot option and then ran:
# xm create -c vutil
The -c makes it go directly to the console where the grub menu was displayed. I picked my new single user mode boot option and "Ta-Dah!" Whew!