Wondering how to fix “OnApp: VM won’t boot after running apt-get upgrade”? We can help you!
At times Ubuntu users report to us that their VM does not boot after running apt-get upgrade.
Here at Bobcares, we handle requests from our customers to fix similar errors as a part of our Server Management Services.
Today we will see how our Support Engineers fix this for our customers.
How to fix “OnApp: VM won’t boot after running apt-get upgrade”
Before going into the steps for fixing this error we will see what causes this error.
While performing an apt-get upgrade on a Debian VM, the /boot/grub/menu.lst file gets modified, and at times this can point to a kernel that is not recognized or able to boot.
Steps to fix the error:
1. First, we need to boot the VM in the recovery mode using the OnApp UI.
2. For this we have to go to the VM console as root.
3. After logging in we can run the following command:
4. Next we need to find the disk for the VM, for example ( /dev/sdb1 20GB ).
5. Once we find the disk, we can mount it using the following:
mount /dev/sdb1 /mnt
6. After mounting successfully, we can edit the bootloader file with the following step:
The file will have something like the following at the top:
default 0 timeout 5 title Debian GNU/Linux, kernel 2.6.32-5-xen-amd64 root (hd0,0) kernel /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda1 ro quiet initrd /boot/initrd.img-2.6.32-5-xen-amd64 title Debian GNU/Linux, kernel 2.6.32-5-xen-amd64 (single-user mode) root (hd0,0) kernel /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda1 ro single initrd /boot/initrd.img-2.6.32-5-xen-amd64
Towards the end of the file if we find the following lines:
### BEGIN AUTOMAGIC KERNELS LIST ## lines between the AUTOMAGIC KERNELS LIST markers will be modified ## by the debian update-grub script except for the default options below
We must delete the section in the automagic kernel list section, starting with the line:
###BEGIN AUTOMAGIC KERNELS LIST
and ending with:
### END DEBIAN AUTOMAGIC KERNELS LIST
The automagic kernel list might be the one that is causing the boot to fail, or we may also need to change the ‘default’ value to point to the old Kernel.
7. Now, we can unmount the disk:
8. Then disconnect from the console and shut down the VM from the OnApp UI.
9. Finally we can try booting the VM to see if it boots up normally.
[Need assistance? We can help you]
To conclude, we saw the steps that our Support Techs follow to fix this error for our customers.