Kali Linux upgrade - boot - kernel panic

Discussion in 'Linux Virtual Machine' started by MarcM11, Sep 10, 2023.

Tags:
  1. MarcM11

    MarcM11 Bit poster

    Messages:
    2
    Hello,

    i have updated Kali Linux , now the Kali is not booting with Kernel 6.4

    Anybody knows how to solve this?

    Regards
     
    Brian33 likes this.
  2. csftech

    csftech Bit poster

    Messages:
    5
    Best Answer
    The main reason for the kernel panic is due to changes in the Linux Kernel in the following two commits:
    (1) https://github.com/torvalds/linux/commit/54d020692b342f7bd02d7f5795fb5c401caecfcc
    (2) https://github.com/torvalds/linux/commit/3e3271549670783be20e233a2b78a87a0b04c715

    Here is a quick workaround, but it's not an official solution provided by Parallels. If it is not urgently needed, it is recommended to wait for an official update of Parallels Tools.
    First, boot Kali with the old kernel (6.4.0) and use the attached file to patch the following two files. Afterward, you can upgrade the kernel to 6.5.0 using `apt update`:
    (1) /var/lib/dkms/parallels-tools/19.0.0.54570/source/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c
    (2) /var/lib/dkms/parallels-tools/19.0.0.54570/source/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h
     

    Attached Files:

    JonR7, BogdanS1, ShawnC4 and 5 others like this.
  3. MarcM11

    MarcM11 Bit poster

    Messages:
    2
    Screenshots from error:
     

    Attached Files:

    Brian33 likes this.
  4. csftech

    csftech Bit poster

    Messages:
    5
    Best Answer
    The main reason for the kernel panic is due to changes in the Linux Kernel in the following two commits:
    (1) https://github.com/torvalds/linux/commit/54d020692b342f7bd02d7f5795fb5c401caecfcc
    (2) https://github.com/torvalds/linux/commit/3e3271549670783be20e233a2b78a87a0b04c715

    Here is a quick workaround, but it's not an official solution provided by Parallels. If it is not urgently needed, it is recommended to wait for an official update of Parallels Tools.
    First, boot Kali with the old kernel (6.4.0) and use the attached file to patch the following two files. Afterward, you can upgrade the kernel to 6.5.0 using `apt update`:
    (1) /var/lib/dkms/parallels-tools/19.0.0.54570/source/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c
    (2) /var/lib/dkms/parallels-tools/19.0.0.54570/source/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h
     

    Attached Files:

    JonR7, BogdanS1, ShawnC4 and 5 others like this.
  5. cyb3rw0lf

    cyb3rw0lf Junior Member

    Messages:
    13
    Thanks a lot, this worked!

    After a failed attempt to upgrade to kernel 6.5.0 I did the following to fix it
    1. I booted my kali VM with kernel 6.3.0 and Uninstalled kernel 6.5.0 (this also autoremoved linux-image-arm64 and linux-header-arm64)
    user$ sudo apt remove linux-headers-6.5.0-kali1-arm64 linux-image-6.5.0-kali1-arm64 linux-headers-6.5.0-kali1-common linux-kbuild-6.5.0-kali1

    2. Manually deleted the /lib/modules/6.5.0-kali1-arm64 folder
    sudo rm -rf /lib/modules/6.5.0-kali1-arm64

    3. Reinstalled parallel tools
    user$ sudo mount -oro,exec,remount /media/cdrom
    user$ sudo /media/cdrom/install


    4. Patched the files with your patch
    root# cd /var/lib/dkms/parallels-tools/19.0.0.54570/source
    root# patch -p1 < /home/user/Downloads/parallels-tools_kernel_6_5_0.txt


    5. Reinstalled the new kernel and headers
    sudo apt update
    sudo apt install linux-image-arm64 linux-header-arm64
     
  6. ring0

    ring0 Junior Member

    Messages:
    11
    Thanks csftech, cyb3rw0lf. The patch worked great.
     
  7. SPX

    SPX Junior Member

    Messages:
    18
    $ sudo apt install linux-image-arm64 linux-header-arm64
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    E: Unable to locate package linux-header-arm64

    Why i get this error?
     
  8. cyb3rw0lf

    cyb3rw0lf Junior Member

    Messages:
    13
    There's a typo, it's headerS, not header.
    sudo apt install linux-image-arm64 linux-headers-arm64
     
  9. SPX

    SPX Junior Member

    Messages:
    18
    Thank you that worked!
     
  10. djh87

    djh87

    Messages:
    1
    Massive thanks to cyb3rw0lf and csfetch, this worked a dream for me (though my files were slightly differently named - linux-headers-6.5.0-kali2-arm64, etc.)

    For anybody struggling to get into the old kernel version, I used an Ubuntu Parallels VM to set the grub timeout and was then able to select the older version. Same logic would work with any other Linux VM
    • Shut down the Kali VM & Ubuntu VM
    • On the Ubuntu VM's settings in Parallels > Hardware > + > Hard Disk > Add Existing
    • Add the Kali VM disk (Home dir > Parallels > KaliVMName.Pvm > kaliDiskName.hdd) to the Ubuntu VM in the settings of the Ubuntu VM
    • Boot Ubuntu
    • Mount the Kali disk and use chroot (great guide here livecd - What's the proper way to prepare chroot to recover a broken Linux installation? - Super User) to access the Kali filesystem [A shortcut here rather than using chroot might be to edit /boot/grub.cfg directly and change the timeout values to 30, but mileage may vary]
    • Edit the grub files and run update-grub as above
    • Shut down the Ubuntu VM
    • In settings, remove the Kali VM disk (make sure to click 'keep files'!)
    • Boot the Kali VM and you should now see a grub screen with 'advanced options for Kali GNU/Linux', select that and press enter
    • On the next screen you'll see your installed kernels (eg. 6.4.0) choose one of those and Kali should boot
    • Follow the patching instructions from cyb3rw0lf
    • Edit your grub settings and run update-grub (I've left mine with a 3 second delay, to save some aggro next time...)
     
  11. gspot

    gspot Member

    Messages:
    23
    Can someone help explain how to boot to a terminal prompt to do this? I reboot and post the beginning of the GUI, I get the error and am stuck.
     
  12. BogdanS1

    BogdanS1 Bit poster

    Messages:
    1
    I do confirm the patch is working perfectly! Thank you for this!
     
  13. gspot

    gspot Member

    Messages:
    23
    what I get with latest Parallels tools and doing apt update and dist update as well. Help appreciated
     

    Attached Files:

  14. JonR7

    JonR7 Bit poster

    Messages:
    1
    What is the location on mac for this? and will it work on ARM mac running m1 chip?
     
  15. RodrigoG11

    RodrigoG11 Bit poster

    Messages:
    1
    Please Parallels TEAM, update us here to see if we can upgrade without this work around. Thank you
     

Share This Page