Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 1.72 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. THIS IS A WORK AROUND
  2. Installing Grub manually from within the Image:
  3.  
  4. Steps:
  5. 0) Comment out the grub --device-map=/dev/null (Until the end of EOF)
  6.  
  7. This is the part that is executed from host.
  8.  
  9. diff --git a/06-install-grub.bash b/06-install-grub.bash
  10. index f052c01..4f76aee 100755
  11. --- a/06-install-grub.bash
  12. +++ b/06-install-grub.bash
  13. @@ -50,12 +50,12 @@ EOF' || die "UBE060" "Failed to create /boot/grub/menu.lst"
  14.      fi
  15.  
  16.      linfo "Installing the MBR to: ${DISK_IMAGE}"
  17. -     grub --device-map=/dev/null <<EOF
  18. -device (hd0) ${DISK_IMAGE}
  19. -root (hd0,0)
  20. -setup (hd0)
  21. -quit
  22. -EOF
  23. +#     grub --device-map=/dev/null <<EOF
  24. +#device (hd0) ${DISK_IMAGE}
  25. +#root (hd0,0)
  26. +#setup (hd0)
  27. +#quit
  28. +#EOF
  29.       if [ $? -ne 0 ]; then
  30.          die "UBE061" "Failed to write MBR."
  31.       fi
  32.  
  33.  
  34.  
  35.  
  36. You still need to run step 6 with the above commented out.
  37.  
  38. 1) Use 12-chroot.bash to get into the VM
  39.  
  40. 2) Make sure that the other parts of step 6 executed properly (e.g. that there are stages)
  41. # ls -l /boot/grub
  42. total 132
  43. -rw-r--r-- 1 root root   8344 2011-08-17 21:12 e2fs_stage1_5
  44. -rw-r--r-- 1 root root   1024 2011-08-17 20:41 grubenv
  45. -rw-r--r-- 1 root root    150 2011-08-17 21:12 menu.lst
  46. -rw-r--r-- 1 root root    512 2011-08-17 21:12 stage1
  47. -rw-r--r-- 1 root root 121188 2011-08-17 21:12 stage2
  48.  
  49. 3) Execute grub from within the VM image
  50.  
  51. BE CAREFUL HERE OR YOU MIGHT WRITE THE WRONG MBR (e.g. the hosts).
  52.  
  53. 'losetup -a' can be used to find the loopback device for the VM.  These scripts use /dev/loop5 by default.  This is why it's /dev/loop5 in the example.
  54.  
  55. From within the chrooted VM
  56. # grub --device-map=/dev/null <<EOF
  57. > device (hd0) /dev/loop5
  58. > root (hd0,0)
  59. > setup (hd0)
  60. > quit
  61. > EOF
  62. #
  63. # exit
  64.  
  65. Exit the chroot.
  66.  
  67. 4) Try to launch the VM image using 13-launch-kvm.bash