LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-01-2018, 05:46 AM   #1
farhankhatri435
LQ Newbie
 
Registered: Mar 2018
Posts: 27

Rep: Reputation: Disabled
Active kernel Image deleted in kali linux which runs as a virtual machine in my windows 10 laptop.


The active kernel of my kali linux, 4.16.0-kali2-amd4, which runs on Oracle VM Virtualbox, was accidently deleted by me. After shutting down the session in which I deleted them, I was stuck at the login screen and was unable to move the mouse and type anything when started the machine again. I would appreciate any help by you people. Thanks
 
Old 07-01-2018, 06:44 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,413
Blog Entries: 9

Rep: Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659
delete the vm and start a new one.
 
Old 07-01-2018, 06:46 AM   #3
farhankhatri435
LQ Newbie
 
Registered: Mar 2018
Posts: 27

Original Poster
Rep: Reputation: Disabled
Is there any other way other than starting a complete new VM? Because all the data in it would be deleted.
 
Old 07-01-2018, 01:30 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,905

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
Do you still have the kali iso file? If so, you should be able to boot it in VirtualBox and and mount the Kali install in VirtualBox and copy the kernel from the iso. It's a bit of a convoluted process and if you don't have the Kali iso it would be pointless. Might be an easier way but I'm not aware of any.
 
Old 07-01-2018, 01:57 PM   #5
farhankhatri435
LQ Newbie
 
Registered: Mar 2018
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Do you still have the kali iso file? If so, you should be able to boot it in VirtualBox and and mount the Kali install in VirtualBox and copy the kernel from the iso. It's a bit of a convoluted process and if you don't have the Kali iso it would be pointless. Might be an easier way but I'm not aware of any.

Thank you for your reply Sir .I do have the kali iso file. Now when i boot my "No kernel Kali Linux", I get stuck in the login page. I see what you are saying is to copy the kernel image from the iso file, and then paste it into the location from where i deleted the kernel. Now I do understand the part where you say about copying the kernel from the iso by a procedure, but I do not understand how to paste the kernel image file to the location of the original kernel file which i deleted as my system freezes on the login screen. Thanks Sir.
 
Old 07-01-2018, 02:04 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,413
Blog Entries: 9

Rep: Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659
ah, i didn't know it was possible to mount vm files without actually booting them.
if all you want is retrieve your data, you don't even need to boot it, no need to copy the kernel.
have you taken a closer look at virtualbox documentation yet?
 
Old 07-01-2018, 06:29 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,905

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
You'll notice this isn't a one click solution. This is the method I used to modify an installed Mint on VBox with a GParted iso and to copy files from GParted to the Mint in VBox. Your situation is going to be a little confusing as you will be using 2 instances of Kali so don't confuse them and be sure to make notes during the process. You will need to make changes from what I have as I have left Mint and GParted so substitute you installed Kali for Mint and your Kali iso for GParted.

Open VirtualBox but do NOT try to boot Kali. Highlight Mint in VBox in the left panel, click Settings then Storage then Controller:IDE (or Controller SATA). I had the Mint vdi under Sata so I just highlighted Controller IDE. You can select either then click on the cd icon with the green plus on it on the right center of the window (mouse over it and it shows Adds Optical Drive, then select from the new window Choose disk option. If I select Choose Disk I can navigate to the GParted iso on the host and click Open at the bottom of the window. The name of the gparted.iso will show below Controller IDE. Click the gparted iso to highlight it and you should then see on the far upper right of the window Optical Drive with a drop down box to the right. Mine shows IDE Primary Master. Now mouse over to the left panel above Storage and click on System and in the center of that window, you will see boot order. Click on Optical to highlight it and then on the up arrow to the right of that little box to move optical to the top and click OK at the bottom of the window. You will now be in the main Virtual Box window so select Mint from the VBox menu, it boots GParted.

Then you will need to mount the installed Kali from the booted Kali iso. The commands following will work if your boot partition is on sda1. Since Kali runs as root by default, you can skip the sudo in the commands: sudo mkdir /mnt/sda1; sudo mount /dev/sda1 /mnt/sda1; Before doing the copy, note the exact name of the kernel/vmlinuz file then navigate to the /mnt/sda1/boot/grub/grub.cfg file to check the entry forKali and compare the name of the kernel/vmlinuz file to what you have on the iso. If they are identical, proceed to copying. If your kernel is in the /boot directory on the Kali iso, just do: sudo cp /boot/vmlinuz /mnt/sda1/boot/. You need the full name of the kernel, vmlinuz file. After the copy, check to see if it copied with:
ls /mnt/sda1/boot If it worked, you should see your kernel and you can shut down the Kali iso. Using this method, I was able to copy files from the GParted iso to the Mint in VBox

Stay in the main VirtualBox window and again highlight Kali in the left panel and click on Storage. Find the Kali iso entry and right click it and select Remove Attachment. Make certain you get the correct instance of Kali or the whole install will be deleted.

Once again, I would suggest you make notes of every step of the way so that if it doesn't work, you can post the info for review.

Last edited by yancek; 07-02-2018 at 07:08 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kali Linux Virtual Machine Image Installation failed ModernNoob Linux - Newbie 3 04-13-2018 10:51 PM
Running Windows 7 in a Virtual Machine on my new Laptop dwains Linux - Laptop and Netbook 14 08-14-2012 04:40 PM
Need help desperately: deleted a virtual machine with critical data under linux. starriol Linux - Virtualization and Cloud 4 01-18-2011 06:35 PM
Need help desperately: deleted a virtual machine with critical data under linux. starriol Linux - Server 3 01-18-2011 06:16 PM
Need help desperately: deleted a virtual machine with critical data under linux. starriol Linux - Software 2 01-18-2011 03:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration