Tip: VM won’t boot, troubleshoot with guestfish | Richard WM Jones#
https://rwmj.wordpress.com/2010/02/09/tip-vm-wont-boot-troubleshoot-with-guestfish/
Unbootable virtual machine? Here are three useful guestfish commands to help. (You can also consider using virt-rescue).
1. Edit /boot/grub/grub.conf#
1$ guestfish -i Rawhide
2
3Welcome to guestfish, the libguestfs filesystem interactive shell for
4editing virtual machine filesystems.
5
6Type: 'help' for help with commands
7 'quit' to quit the shell
8
9><fs> ls /boot/
10System.map-2.6.32.1-9.fc13.x86_64
11System.map-2.6.32.3-21.fc13.x86_64
12System.map-2.6.33-0.40.rc7.git0.fc13.x86_64
13config-2.6.32.1-9.fc13.x86_64
14config-2.6.32.3-21.fc13.x86_64
15config-2.6.33-0.40.rc7.git0.fc13.x86_64
16[...]Use the “edit”, “emacs” or “vi” commands to edit grub.conf:
1><fs> vi /boot/grub/grub.confFrom here you can change the boot kernel, change it to boot in single user mode, enable the grub menu, remove the “rhgb quiet” option so you can see boot messages, and much more.
2. Look at the /init script#
When the kernel panics because it cannot mount root, it’s often because the initrd or initramfs is broken in some way. Two commands help here:
1><fs> initrd-list /boot/initramfs-2.6.33-0.40.rc7.git0.fc13.x86_64.img | less
2><fs> initrd-cat /boot/initramfs-2.6.33-0.40.rc7.git0.fc13.x86_64.img init | lessThe first command lists all the files in the initrd, which lets you see if the right drivers got included for the (virtual) hardware. The second command lists out the init script — which is the shell script that runs first before the OS proper starts to boot.