How to Change Boot Kernel on USB Live with Persistent Kali

initrdkali-linuxkernellive-usbvirtualbox

First, the issue that I'm having is being unable to run VirtualBox on Kali 2.0.

I set up a usb live with persistence running Kali 2.0, which at the time had the 4.6.0-kali1-amd64 kernel. I have since updated/upgraded/dist-upgraded etc with all of the recommended sources. As a part of this, the new headers/kernels that have been installed are 4.9.0-kali4-amd64. However, even after boot, the kernel is 4.6.0, as confirmed by uname -r and the error thrown by vbox. I know normally grub needs to be config'd, though there is no grub bootloader in the usb live boot.

The error thrown by virtualbox says that no suitable driver was found for the 4.6.0 kernel, and also that the system is not set up to dynamically create drivers (though I believe that this is due to the fact that it is making the driver for the 4.9.0, but this is not the running kernel).

Best Answer

Due to a bug in either the way my live system was installed or the way live-tools handles the mounted partition, live-update-initramfs does not work in this particular case, as it looks to /lib/live/mount/medium/ as the root of the usb live device, though this was not the mountpoint (and there are 3 partitions needed from the usb device).

Instead of messing with mounting/unmounting etc. I was able to simply create a initrd.img file (it was missing) using update-initramfs, and moving this to the live folder manually from my non-live linux dist:

/usr/sbin/update-initramfs.orig.initramfs-tools -c -k 4.9.0-kali4-amd64

This creates the image. The vmlinuz-4.9.0-kali4-amd64 was already available. From within my non-live dist, with my usb inserted:

  1. I first moved the initrd.img and vmlinuz from the /live folder on my usb to my desktop (for backup).
  2. I then copied the initrd.img-4.9.0-kali4-amd64 and vmlinuz from my usb's persistence rw root folder to the /live folder.
  3. I renamed these to initrd.img and vmlinuz and rebooted. VoilĂ 

-Big thank you Jeff S. for your contribution.

Related Question