PDA

View Full Version : Installing Kali Linux as a Virtual Machine in Virtual Box



brav0hax
2013-03-14, 05:31
Covered in this tutorial:

Creating a proper Virtual Machine for Kali Linux
Installing Kali Linux to a hard disk inside the Virtual Machine
Install VirtualBox Guest Addition Tools in Kali Linux
Setting up shared folders in VirtualBox with your Kali Linux installation


Note: The instructions below were performed with the latest version of VirtualBox which at the time of this tutorial is 4.2.8. If you are experiencing issues with 4.1.x, please upgrade VirtualBox to this or a later release.

Although each platform of VirtualBox has slight aesthetic differences, this method should work on any VirtualBox platform.

Creating the Virtual Machine:

When you launch VirtualBox you will be presented with the Virtual Machine Manager. From this screen you can create a new virtual machine by clicking 'New' in the upper left corner.
The next screen will ask you to provide a Name, OS Type and Version. You can provide any name you would like for the virtual machine. Set the Type to 'Linux' and the Version to 'Debian.' VirtualBox offers both 32 and 64 bit options, please make sure to choose the proper version for your architecture. Once completed, click the continue button to move on with the setup.
The next portion allows you to configure the amount of memory to allocate to your new virtual machine. It is best to provide as much as can be spared, but as a minimum allocate 2048MB. Once completed, click the Continue button.
The next step is creation of the virtual machine hard drive, The default is to 'Create a virtual hard drive now.' Accept the default and click the Create button in the lower right portion of the window.
In this step, VirtualBox allows you the option to pick your hard drive file type. The default is VDI (VirtualBox Disk Image), however you can create any other type. For example, creating a VMDK will allow you to use this hard drive with VMWare as well as VirtualBox. Once you have selected your file type, click the Continue button.
The next step asks if you would like to allocate the entire amount of disk space at once, or dynamically allocate as hard drive space is needed. For example, if you specify a hard drive of 20GB, the initial size of the install may only be 10GB, but will grow as required until it hits the maximum size allocated. Either option is acceptable and is clearly user preference. Once you have made your selection, click the Continue button.
The next step is for creation of the hard drive file location and size. For location, it will always install in the default directory and only needs to be changed if desired.
The base install of Kali Linux will take up approximately 8GB of disk space. It is good practice to provide roughly 4 times that amount in order to ensure proper space as you add to and update the installed system with tools and files. Once you have provided the desired size, click the Create button.


You have now created your virtual machine in VirtualBox.

Although your virtual machine is created, there are a few steps to complete before starting it. With your newly created Kali Linux virtual machine selected, click the 'General' link in the right portion of the Manager window. This will launch a window that allows for additional configuration settings.

Here you can make any changes you need to your new virtual machine. There are at least two changes that should be made during this step, the amount of processors to allocate to the Kali Linux VM and the attachment of the Kali Linux iso for first boot and installation.

To change the amount of processors, select the System option and the Processor tab. As a default, the machine is granted only 1 VCPU. You can provide the VM as many processors as you like, but at least 2 are recommended.

Next, select the Storage option to attach your Kali Linux ISO image. In the Storage Tree window, select your CD-Rom controller. Then within the Attributes pane click the CD-Rom Icon and 'Choose a virtual CD/DVD disk file' from the pop up menu. This will open a window to browse the host system for your Kali Linux ISO file. Once selected, click the Open button and then click the OK button to save all your changes you will be returned to the VirtualBox Manager.

Your VirtualBox Virtual Machine is now ready for initial startup and Kali Linux Installation. You can now click the Start Button to launch the VM and begin the Kali Linux installation process.

Kali Linux Installation

The tutorial for installing Kali Linux can be found here (http://docs.kali.org/installation/kali-linux-hard-disk-install). Once installation is complete, you will need to install the VirtualBox Guest Addition tools.

Installing VirtualBox Guest Additions in Kali Linux
In order to have proper mouse and screen integration as well as folder sharing with your host system, you will need to install the VirtualBox Guest additions.

Once you have booted into your Kali Linux virtual machine, open a terminal window and issue the following command to install the Linux Kernel headers.

apt-get update && apt-get install -y linux-headers-$(uname -r)
NOTE: If you are not running as root, ensure you prepend the command with a 'sudo'

Once this is complete you can now attach the Guest Additions CD-Rom. This can be done by selecting 'Devices' from the VirtualBox Menu and selecting 'Install Guest Additions.' (In addition you can use the shortcut Host key+D.) This will mount the virtual CD Drive to your Kali Linux virtual machine. When prompted to autorun the CD, click the Cancel button.

From a terminal window copy the VboxLinuxAdditions.run file from the Guest Addition CD-Rom to a path on your local system and then run the file.

cp /media/cd-rom/VBoxLinuxAdditions.run /path/to/copy/file

./VboxLinuxAdditions.run
NOTE: If you are not running as root, ensure you prepend the command with a 'sudo'

Reboot the Kali Linux VM to complete the Guest Additions installation. You should now have full mouse and screen integration as well as the ability to share folders with the host system.

Creating Shared Folders with the Host System

In order to share folders on your host system with your Kali Linux VM, there are a few short steps that need to be completed.
From the VirtualBox Manager, select your Kali Linux VM instance and click on the 'Shared Folders' link in the right window pane. This will launch a pop up window for adding shared folders. Within this window click the icon to add a folder (the icon is a Folder with a '+' on it).
In the Folder Path text box, provide the path to the folder you would like to share, or click the drop-down arrow to browse your host system for the path. Select the check boxes that allow for 'Auto-mount' and 'Make Permanent' and click the OK button both times when prompted.


Your shared folders will now be available in the media directory. You can create a bookmark or link for easier access to the directory.

Gr4nD T3R0R
2013-03-14, 11:16
Covered in this tutorial:

Creating a proper Virtual Machine for Kali Linux
Installing Kali Linux to a hard disk inside the Virtual Machine
Install VirtualBox Guest Addition Tools in Kali Linux
Setting up shared folders in VirtualBox with your Kali Linux installation


Although each platform of VirtualBox has slight aesthetic differences, this method should work on any VirtualBox platform.

Creating the Virtual Machine:

When you launch VirtualBox you will be presented with the Virtual Machine Manager. From this screen you can create a new virtual machine by clicking 'New' in the upper left corner.
The next screen will ask you to provide a Name, OS Type and Version. You can provide any name you would like for the virtual machine. Set the Type to 'Linux' and the Version to 'Debian.' VirtualBox offers both 32 and 64 bit options, please make sure to choose the proper version for your architecture. Once completed, click the continue button to move on with the setup.
The next portion allows you to configure the amount of memory to allocate to your new virtual machine. It is best to provide as much as can be spared, but as a minimum allocate 2048MB. Once completed, click the Continue button.
The next step is creation of the virtual machine hard drive, The default is to 'Create a virtual hard drive now.' Accept the default and click the Create button in the lower right portion of the window.
In this step, VirtualBox allows you the option to pick your hard drive file type. The default is VDI (VirtualBox Disk Image), however you can create any other type. For example, creating a VMDK will allow you to use this hard drive with VMWare as well as VirtualBox. Once you have selected your file type, click the Continue button.
The next step asks if you would like to allocate the entire amount of disk space at once, or dynamically allocate as hard drive space is needed. For example, if you specify a hard drive of 20GB, the initial size of the install may only be 10GB, but will grow as required until it hits the maximum size allocated. Either option is acceptable and is clearly user preference. Once you have made your selection, click the Continue button.
The next step is for creation of the hard drive file location and size. For location, it will always install in the default directory and only needs to be changed if desired.
The base install of Kali Linux will take up approximately 8GB of disk space. It is good practice to provide roughly 4 times that amount in order to ensure proper space as you add to and update the installed system with tools and files. Once you have provided the desired size, click the Create button.


You have now created your virtual machine in VirtualBox.

Although your virtual machine is created, there are a few steps to complete before starting it. With your newly created Kali Linux virtual machine selected, click the 'General' link in the right portion of the Manager window. This will launch a window that allows for additional configuration settings.

Here you can make any changes you need to your new virtual machine. There are at least two changes that should be made during this step, the amount of processors to allocate to the Kali Linux VM and the attachment of the Kali Linux iso for first boot and installation.

To change the amount of processors, select the System option and the Processor tab. As a default, the machine is granted only 1 VCPU. You can provide the VM as many processors as you like, but at least 2 are recommended.

Next, select the Storage option to attach your Kali Linux ISO image. In the Storage Tree window, select your CD-Rom controller. Then within the Attributes pane click the CD-Rom Icon and 'Choose a virtual CD/DVD disk file' from the pop up menu. This will open a window to browse the host system for your Kali Linux ISO file. Once selected, click the Open button and then click the OK button to save all your changes you will be returned to the VirtualBox Manager.

Your VirtualBox Virtual Machine is now ready for initial startup and Kali Linux Installation. You can now click the Start Button to launch the VM and begin the Kali Linux installation process.

Kali Linux Installation

The tutorial for installing Kali Linux can be found here (http://docs.kali.org/installation/kali-linux-hard-disk-install). Once installation is complete, you will need to install the VirtualBox Guest Addition tools.

Installing VirtualBox Guest Additions in Kali Linux
In order to have proper mouse and screen integration as well as folder sharing with your host system, you will need to install the VirtualBox Guest additions.

Once you have booted into your Kali Linux virtual machine, open a terminal window and issue the following command to install the Linux Kernel headers.

apt-get update && apt-get install -y linux-headers-$(uname -r)
NOTE: If you are not running as root, ensure you prepend the command with a 'sudo'

Once this is complete you can now attach the Guest Additions CD-Rom. This can be done by selecting 'Devices' from the VirtualBox Menu and selecting 'Install Guest Additions.' (In addition you can use the shortcut Host key+D.) This will mount the virtual CD Drive to your Kali Linux virtual machine. When prompted to autorun the CD, click the Cancel button.

From a terminal window copy the VboxLinuxAdditions.run file from the Guest Addition CD-Rom to a path on your local system and then run the file.

cp /media/cd-rom/VBoxLinuxAdditions.run /path/to/copy/file

./VboxLinuxAdditions.run
NOTE: If you are not running as root, ensure you prepend the command with a 'sudo'

Reboot the Kali Linux VM to complete the Guest Additions installation. You should now have full mouse and screen integration as well as the ability to share folders with the host system.

Creating Shared Folders with the Host System

In order to share folders on your host system with your Kali Linux VM, there are a few short steps that need to be completed.
From the VirtualBox Manager, select your Kali Linux VM instance and click on the 'Shared Folders' link in the right window pane. This will launch a pop up window for adding shared folders. Within this window click the icon to add a folder (the icon is a Folder with a '+' on it).
In the Folder Path text box, provide the path to the folder you would like to share, or click the drop-down arrow to browse your host system for the path. Select the check boxes that allow for 'Auto-mount' and 'Make Permanent' and click the OK button both times when prompted.


Your shared folders will now be available in the media directory. You can create a bookmark or link for easier access to the directory.
when i try this code with sudo apt-get update && apt-get install -y linux-headers-$(uname -r)
and i get this error "root@kali:~# sudo apt-get update && apt-get install -y linux-headers-$(uname -r)Hit http://security.kali.org kali/updates InRelease
Hit http://security.kali.org kali/updates/main amd64 Packages
Hit http://security.kali.org kali/updates/contrib amd64 Packages
Hit http://security.kali.org kali/updates/non-free amd64 Packages
Ign http://security.kali.org kali/updates/contrib Translation-en_US
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://security.kali.org kali/updates/main Translation-en_US
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en_US
Ign http://security.kali.org kali/updates/non-free Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-3.7-trunk-amd64
E: Couldn't find any package by regex 'linux-headers-3.7-trunk-amd64'
root@kali:~#
"
im using amd64 on vmplayer

brav0hax
2013-03-14, 18:15
I doubt this is the issue, but I can tell you, you don't need the 'sudo' you're running as root already.

It seems to me that your sources.list is messed up. They should look like this: http://pastebin.com/5cUsiBZr

If they do not, you can copy/paste this in the file and you should be ok. I can already tell that it won't match based on your output.

Best Regards,
Eric

Coded32
2013-03-15, 06:20
when i try this code with sudo apt-get update && apt-get install -y linux-headers-$(uname -r)
and i get this error "root@kali:~# sudo apt-get update && apt-get install -y linux-headers-$(uname -r)Hit http://security.kali.org kali/updates InRelease
Hit http://security.kali.org kali/updates/main amd64 Packages
Hit http://security.kali.org kali/updates/contrib amd64 Packages
Hit http://security.kali.org kali/updates/non-free amd64 Packages
Ign http://security.kali.org kali/updates/contrib Translation-en_US
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://security.kali.org kali/updates/main Translation-en_US
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en_US
Ign http://security.kali.org kali/updates/non-free Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-3.7-trunk-amd64
E: Couldn't find any package by regex 'linux-headers-3.7-trunk-amd64'
root@kali:~#
"
im using amd64 on vmplayer

You shouldn't really quote a whole thread, also, use code tags to show your codes in a proper format.

Hawk
2013-03-16, 01:30
You shouldn't really quote a whole thread, also, use code tags to show your codes in a proper format.

And it'd be really great if you didn't post useless comments without addressing the topic thanks. On a second note I'm having an issue mounting the guest additions iso all together. I installed the headers, and clicked the "install guest additions drop down". Nothing occurs and a second attempt throws up an error about the drive being locked. I tried mounting /dev/cdrom manually. It gives me a file type required message, and when i specify one it gives an incorrect type error. FWIW there's no /media/cd-rom directory automatically in either the 386 or x64 versions. Any help is appreciated.

brav0hax
2013-03-16, 05:21
Note: The instructions were performed with the latest version of VirtualBox which at the time of this tutorial is 4.2.8. If you are experiencing issues with 4.1.x, please upgrade VirtualBox to this or a later release.

Many of the issues being reported appear to be related to VitualBox 4.1.x installed on the host system. There are known issues with this version and newer kernels. (https://www.virtualbox.org/ticket/11036)

I recommend you upgrade to the latest version of VirtualBox from https://www.virtualbox.org/wiki/Downloads.

Thanks

skorpinok
2013-03-16, 10:17
hey brav0hax : cp /media/cd-rom/VBoxLinuxAdditions.run /path/to/copy/file what path should be typed ???? plz mention awaiting for your prompt reply

critikaster
2013-03-16, 10:22
I doubt this is the issue, but I can tell you, you don't need the 'sudo' you're running as root already.

It seems to me that your sources.list is messed up. They should look like this: http://pastebin.com/5cUsiBZr


Thanks Eric, adding these two lines did fixxed it it for me indeed:


deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib

:cool:

Hawk
2013-03-16, 13:21
Update: It appears to be an issue with 4.2.10. The issue exists in my Windows VMs also, so we'll see if Oracle gets a fix out anytime soon.

bidouiller
2013-03-16, 17:22
hello all,
I just put an online tutorial to install French "KALI" under "VirtualBox"
if you are interested it is here:

http://bidouiller.fr/2013/03/15/tuto-test-de-kali-linux-backtrack-6-sur-virtualbox/

Sincerely,

brav0hax
2013-03-16, 20:16
hey brav0hax : cp /media/cd-rom/VBoxLinuxAdditions.run /path/to/copy/file what path should be typed ???? plz mention awaiting for your prompt reply

That can be any path.

I would say you could do: /tmp/

and then you would either need to cd into /tmp and run, or give the gull path to run i.e.: /tmp/VboxLinuxAdditions.run

brav0hax
2013-03-16, 20:19
Update: It appears to be an issue with 4.2.10. The issue exists in my Windows VMs also, so we'll see if Oracle gets a fix out anytime soon.

Hawk, there should be no issues, several of us have installed the tools without issue. If there is a specific error being displayed please provide so we have a chance to get you the best assistance possible.

I hate to say "Works for me" so let see if we can't get it working for you too.

Errors and logs go a long way toward this.

brav0hax
2013-03-16, 20:32
Update: It appears to be an issue with 4.2.10. The issue exists in my Windows VMs also, so we'll see if Oracle gets a fix out anytime soon.

Hawk do you mean 4.1.10 that comes in the latest Ubuntu repos? 4.2.10 was just released yesterday and is on the VirtualBox Site for download.

Please download and give that a try and let me know if you are still having issues. (See post above for link)

Calvin
2013-03-18, 13:07
I had a problem after I did the installation,, when I will start using virtual mahine TIMES ..... I can not get into system error occurs GURU Mediation ... a notice to check the error log in Virtual Box.
after there is an error in check this:
00:00:57.529680 ********************* End of statistics **********************
00:00:57.558231 Changing the VM state from 'DESTROYING' to 'TERMINATED'.
00:00:57.723378 ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={db7ab4ca-2a3f-4183-9243-c1208da92392} aComponent={Console} aText={The virtual machine is not powered up}, preserve=false


please give the solution in??? : D

wetlinux
2013-03-19, 19:11
Hi,

According to the VirtualBox forum, the VBoxGuestAdditions_4.2.10.iso file included with the Windows version of VirtualBox 4.2.10 is corrupt. Get a useable copy from:
http://download.virtualbox.org/virtualbox/4.2.10/VBoxGuestAdditions_4.2.10.iso

Worked for me.

Thanks,
wetlinux

Hawk
2013-03-19, 22:30
Hawk do you mean 4.1.10 that comes in the latest Ubuntu repos? 4.2.10 was just released yesterday and is on the VirtualBox Site for download.

Please download and give that a try and let me know if you are still having issues. (See post above for link)

Sorry for the delay, I had 4.2.10 build 84104 which had a corrupted guest additions ISO as discussed over on the VBox forum. They have since fixed the issue with 4.2.10 build 84105. I apparently just got caught in an "early adopter" issue. Also, if anyone else runs into this issue, I had to manually download the new package. The "check for updates" didn't trigger on the new build.

VicBollen
2013-03-23, 18:12
Covered in this tutorial:
To change the amount of processors, select the System option and the Processor tab. As a default, the machine is granted only 1 VCPU. You can provide the VM as many processors as you like, but at least 2 are recommended.

Thanks for the great tutorial.

I got the following error when I tried to start up the VM in order to install the ISO:

Failed to open a session for the virtual machine kali

VT-x features locked or unavailable in MSR.
(VERR_VMX_MSR_LOCKED_OR_DISABLED)
I found a couple of sites that referenced this error:
http://choorucode.com/2012/11/11/vt-x-is-not-available-for-virtualbox/
https://forums.virtualbox.org/viewtopic.php?f=6&t=43403

But none of the solutions resolved my issue. What I ended up doing was reducing the number of processors back down to 1 and I was able to start up the VM and Kali install.

brav0hax
2013-03-24, 06:40
Thanks for the great tutorial.

I got the following error when I tried to start up the VM in order to install the ISO:

I found a couple of sites that referenced this error:
http://choorucode.com/2012/11/11/vt-x-is-not-available-for-virtualbox/
https://forums.virtualbox.org/viewtopic.php?f=6&t=43403

But none of the solutions resolved my issue. What I ended up doing was reducing the number of processors back down to 1 and I was able to start up the VM and Kali install.

I had that issue as well with a very old laptop, no matter what I tried I couldn't get it to work. I enabled the bios and such, but it was a hardware issue I couldn't overcome.

VicBollen
2013-03-24, 18:52
I had that issue as well with a very old laptop, no matter what I tried I couldn't get it to work. I enabled the bios and such, but it was a hardware issue I couldn't overcome.

I was trying to install it on a i7 laptop but I was using VirtualBox 4.1. It was only after I ran into problems with guest editions that I upgraded. But even though it works, Kali seems a lot slower than its predecessors. Maybe I'll try reinstalling Kali on the 4.2 version, see if I can bump up the VCPUs then.

brav0hax
2013-03-27, 07:19
I was trying to install it on a i7 laptop but I was using VirtualBox 4.1. It was only after I ran into problems with guest editions that I upgraded. But even though it works, Kali seems a lot slower than its predecessors. Maybe I'll try reinstalling Kali on the 4.2 version, see if I can bump up the VCPUs then.

My pentest VM has 4 vCPUs and 8192MB RAM, my standard is 2 vCPUs and 4096MB RAM. (Both 64 bit)

If that helps you at all, the first one is ofcourse super fast. Second one is good, but not as fast as the first ;)

Thanks,
Eric

vita
2013-03-28, 02:05
just for note.
if we fail when installing Kali from the ISO, make sure that the Enable PAE options on Virtualbox have been checked.

Adelson
2013-04-18, 00:20
Hi guys one module for error .
erro Unable to locate package kernel-headers-3.7-trunk-amd64

vim /etc/apt/sources.list
add in line
deb http://ftp.de.debian.org/debian/ experimental main
deb-src http://ftp.de.debian.org/debian/ experimental main


apt-get update && apt-get install -y linux-headers-$(uname -r)

dewmon689
2013-04-23, 04:43
Update: It appears to be an issue with 4.2.10. The issue exists in my Windows VMs also, so we'll see if Oracle gets a fix out anytime soon.

After I added additional mirrors found here: http://forums.kali.org/archive/index.php/t-72.html. It worked for me!

wordi
2013-05-22, 15:35
after I follow the "apt-get update && apt-get install -y linux-headers-$(uname -r)" appears like this in the terminal:


root@localhost:~# apt-get update && apt-get install -y linux-headers-$(uname -r)Hit http://security.kali.org kali/updates InRelease
Hit http://security.kali.org kali/updates/main i386 Packages
Hit http://security.kali.org kali/updates/contrib i386 Packages
Hit http://security.kali.org kali/updates/non-free i386 Packages
Ign http://security.kali.org kali/updates/contrib Translation-en_US
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://security.kali.org kali/updates/main Translation-en_US
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en_US
Ign http://security.kali.org kali/updates/non-free Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-3.7-trunk-686-pae
E: Couldn't find any package by regex 'linux-headers-3.7-trunk-686-pae'

AAFA
2013-05-29, 22:19
after I follow the "apt-get update && apt-get install -y linux-headers-$(uname -r)" appears like this in the terminal:


I just completed the install on Linux with VB 4.2.12
The main Issue I had during the install was that Kali did not support the second ETH* interface that was bridged so it could find path to setup repos.
During the install the eth* were not available for mirror choice so I knew source.list would be empty.

I had to delete the NAT and setup the Bridged adapter.
Then added the three sources in the /etc/apt/sources.list
[code]

root@kali:/etc/apt# cat sources.list

#deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130425-10:30]/ kali contrib main non-free

deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib

## Security updates

deb http://security.kali.org/kali-security kali/updates main contrib non-free
[code/]

I was able then to install GuestAdditions with no issue and reboot.

wbble
2013-06-24, 11:02
So I did all the following but when I go to run VBoxLinuxAdditions.run it just says there is no command found. This is exactly what it said when I tried to run it before running the apt-get command. However that didnt post any error results. What did I do wrong. Heres a screenshot.

http://pbrd.co/19jVEuG

thorin
2013-07-02, 19:17
So I did all the following but when I go to run VBoxLinuxAdditions.run it just says there is no command found. This is exactly what it said when I tried to run it before running the apt-get command. However that didnt post any error results. What did I do wrong. Heres a screenshot.

http://pbrd.co/19jVEuGIs VBoxLinuxAdditions.run executable?
man chmod

jeimues
2013-07-03, 14:33
I doubt this is the issue, but I can tell you, you don't need the 'sudo' you're running as root already.

It seems to me that your sources.list is messed up. They should look like this: http://pastebin.com/5cUsiBZr

If they do not, you can copy/paste this in the file and you should be ok. I can already tell that it won't match based on your output.

Best Regards,
Eric

Eric, I add this lines in /etc/apt/sources.list and solved my problem

deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib

Thanks for your help,

Jorge

teotoet
2013-08-27, 06:19
Can I install kali linux as VM in VirtualBox on my pc??

Specifications:

-Host os winXP
-Ram 1GB
-HDD 80GB
-Processor Intel Core2 duo
-Vga 512MB

Please Reply, Thanks :)

Sippy
2013-10-30, 13:26
So I did all the following but when I go to run VBoxLinuxAdditions.run it just says there is no command found. This is exactly what it said when I tried to run it before running the apt-get command. However that didnt post any error results. What did I do wrong. Heres a screenshot.

http://pbrd.co/19jVEuG

I think your problem is that you didn't copy the run file using terminal. You can't drag and drop the .run file.

Keyser_Soze
2013-12-16, 23:04
1. Dear Friends, After reading this excellent thread VB (4.3.4r91027 is running the current version (1.0.5) of Kali very well under Win 7 SP1. Thanks for all the information. I have set up my HDD as a shared drive and issued this command logged in as root: mount -t vboxsf D_Drive /home/josea/Shared josea is a second id that I created for everyday use. Where can I add the aforementioned command so I do not have to issue it each time I login as josea?

2. Also is it a good idea to make josea a standard account? I have about 1 year experience with Ubuntu 12.04 but obviously have a lot to learn.
3. Is there any easy way to edit hidden files with leafpad? I have used spaceFM 0.9.1 recently and it is very easy with that FM.
Many thanks to whoever fixed my account so that I can now post!

johnaaronrose
2013-12-28, 16:17
I'm using Ubuntu Precise 64 bit as my host OS. I've created a VDI using Virtualbox 4.1.12. When I try using the 64 bit Kali 1.0.5 iso (downloaded today) as my CD Device, it hangs. I then deleted my Kali vdi & used the 32 bit Kali 1.0.5 iso, but that said that there was an error in the Install (after over 60% copying files) & refused to go further. What should I do?

shaberu
2013-12-29, 11:04
I personally stick with the 32 bit version more compatibility but the 60% issue are you doing a GUI or ClI? whichever you use try the opposite and try re downloading the iso. also try using a different version of linux on the virtual box to be shore its working correct. also if you really want to you can use vmware workstation. you can also try my non pae iso from here (https://forums.kali.org/showthread.php?17776-Updated-i386-iso)

johnaaronrose
2013-12-29, 17:15
I personally stick with the 32 bit version more compatibility but the 60% issue are you doing a GUI or ClI? whichever you use try the opposite and try re downloading the iso. also try using a different version of linux on the virtual box to be shore its working correct. also if you really want to you can use vmware workstation. you can also try my non pae iso from here (https://forums.kali.org/showthread.php?17776-Updated-i386-iso)

Thanks for the suggestion. I just tried your non PAE iso. It gave the same problem as with the 32 bit Kali 1.0.5 iso: an error in the Install (after 69% copying files) & refused to go further.

64 bit .iso hangs on installation.

Only reasons that I can think of are:
1. not enough memory, though Virtualbox should give more as required. The thread says 2GB. I've tried that with no effect
2. on install, Virtualbox says Linux OS with 2.6 kernel. Tried 'Other Linux' (instead of 2.6 the kernel) but made no difference
3. install Virtualbox 4.3.6 from Oracle's website (as I'm using 4.1.12): however, this seems to involve removal of other VMs which I'm reluctant to do.

I'm lost as to what to do. Help please?

shaberu
2013-12-30, 15:40
i still vote using vmware workstation you can download it here (http://www.vmware.com/products/workstation/) or you can search google for a "Permanent trial Key" if you know what i mean.

johnaaronrose
2014-01-02, 14:33
I don't want to use vmware workstation. I much prefer Virtualbox. I've successfully replaced Virtualbox 4.1.12 with 4.3.6 and the VMs have been retained. However, Kali 64 bit still hangs on installation: 2GB memory allocated with 32 GB dynamically allocated storage. Details are shown below. What do I do?
VirtualBox 4.3.6
I have installed the Guest Additions (in the guest).
Ubuntu Precise 64 bit host: 8 GB actual memory & 6GB virtual memory (though Ubuntu should increase amount if required).
Kali 1.0.5 64 bit: 2GB memory & 32GB dynamically allocated storage.
Guest log file attached as a .zip file.

johnaaronrose
2014-01-03, 09:44
Reason for hang now known. Someone in the Virtualbox forum gave me the reason:
64-bit guests need hardware-virtualzation (VT-x/AMD-V) enabled in the hosts BIOS. In my case this was the VT-d parameter.
Kali now installing.

lee_can
2014-01-12, 21:55
Still I am facing problem with linux header, i used the link which was in the http://pastebin.com/5cUsiBZr.

Any advise?

go_chad
2014-01-13, 00:02
Reason for hang now known. Someone in the Virtualbox forum gave me the reason:
64-bit guests need hardware-virtualzation (VT-x/AMD-V) enabled in the hosts BIOS. In my case this was the VT-d parameter.
Kali now installing.

I have the current version of VirtualBox, 4.3.6 and I'm using the Kali-Linux-1.0.5-amd64.iso as an image file to run the install, and this it is still hanging on me. If I try to run it live, it's telling me it requires an x86-64 processor and it only detects an i686. I can not find anywhere to specify the architecture. I tried attaching my .vhdx from Hyper-V that I have of Kali but it says the format isn't supported, even if I do it as an IDE drive and not a SATA. I downgraded to VirtualBox 4.2.22 or something so I could open my .vhdx drive, but it would hang after GRUB loaded and also wouldn't boot live with the same error as before. Since it didn't work, I just went back up to 4.3.6. Can anyone help me out here? I am fine using Hyper-V for most of the testing I want to do, but I can't use it for wireless pen testing since I can't pass through my AWUS036NHA, unless someone knows how to make that work!?! Any help would be greatly appreciated.

*UPDATE* I found where the issue lies. Apparently I have to disable Hyper-V in the OS to get the x64 option to show up in VirtualBox. This sucks because I actually use Hyper-V quite a bit. Guess I will have to live boot a persistent USB for my wireless pen testing.

Jerepigo
2014-02-24, 01:18
Superb article. Accurate in every detail. Worked as promised. No mess, no fuss. Thnx

Mad Medik
2014-02-25, 03:20
I'm still trying to find a workable solution and just about to throw in the towel on virtualbox. Would appreciate insight from someone successful with macbook.

My system:

MBP Intel 64 bit process
8GB
Kali 1.0.6 AMD 64
(4096 MB memory and 20GB vHD expandable given. )
1 CPU given ( vt-x enabled and supposedly default enabled in OSX but no option to add vcpu's seen)
Alfa awus036h

After frustration with VMware, I tried VirtualBox 4.3.6. It seemed to work as expected, but any mitm I tried would slow the network throughout to a crawl. I experimented with both NAT and Bridged connection from the host (OSX). On my network, the host's WiFi (OSX) was steadily over 20mbits down, 10mbits up. I got similar results using alfa and testing within kali on the vbox. Also, browsing the net within kali using the host's connection via eth0 worked fine. But, any attempt to bridge the two resulted in the targets network speed dropping to < 0.2 mbits and getting timeout or unavailable errors on the browser. I assumed it must be a pentest tool configuration error on my part but tried a few established scripts with similar results (easy-creds, subterfuge, and cred harvester).

I decided that running a dual boot instead of a virtual machine might bypass the issue but am still struggling with making Kali bootable on a MBP with reFind.

I'd appreciate a point in the right direction from someone with a successful setup on a macbook pro (VMware/virtualbox/dual boot).

Thanks,

MM

Kazuya
2014-07-02, 11:02
Hi

Can someone please assist with the issue I am having

I have download and installed linux on a virtual machine. I cannot get the guest additions installed. It was easy on Backtrack 5 r3. This is what I have done so far. I downloaded and installed Oracle Virtual box 4.3.12 plus the expension modules, some reason it would not show me the option to install any 64 bit OS even though my laptop is a 64 bit machine. I did a bit of googling and it seems as though this is a common issue. So I reverted back to Oracle Virtual box 4.3.2 as Backtrack 5 r3 64 bit is working fine there.

After installing Kali I tried to install the guest additions. No luck. Bellow is a sumary of what I have done to get the guest additions installed. I followed instructions that I found using google still no luck.

root@kali:~#cat sources.list
# # deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64 LIVE/INSTALL Binary 20140526-16:38]/ kali contrib main non-free


#deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64 LIVE/INSTALL Binary 20140526-16:38]/ kali contrib main non-free
## Security updates


deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free

root@kali:/etc/apt# apt-get update && apt-get install build-essential linux-headers-3.14-kali1-amd64

root@kali:~#./VBoxLinuxAdditions.run

Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!

root@kali:~#cat /var/log/vboxadd-install.log

make[4]: *** [/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.o] Error 1
make[3]: *** [_module_/tmp/vbox.0] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make: *** [vboxguest] Error 2

Your assistance will be greatly appriciated

OS-13115
2014-07-03, 06:06
Kazuya, Hi,

As I was reading your post I began to see if your I/O was replicable. Unfortunately, my kali works flawlessly, so I was not able to reproduce your output and some of the input commands do not apply to my architecture. In other news, I found some hope for you: https://www.virtualbox.org/manual/ch04.html here. It is a detailed walkthrough for installing guest additions INSIDE the VirtualBox. Maybe that is why it isn't working the way you'd expect. Always install the guess additions inside the VM, your Host OS is only a proxy, where you download it. Also, check: http://docs.oracle.com/cd/E36500_01/E36502/html/qs-guest-additions.html here. The second link is more visual. Finally, you could follow this post: https://help.ubuntu.com/community/VirtualBox/GuestAdditions which pretty much shows you exactly how to do it step-by-step.

As much as I would love to hold your hand and walk you through this, the best thing for you as of now is to consult the docs. We can still sing Kumbi ya though. :)

HTH

OS-13115
2014-07-03, 06:46
I'm still trying to find a workable solution and just about to throw in the towel on virtualbox. Would appreciate insight from someone successful with macbook.

My system:

MBP Intel 64 bit process
8GB
Kali 1.0.6 AMD 64
(4096 MB memory and 20GB vHD expandable given. )
1 CPU given ( vt-x enabled and supposedly default enabled in OSX but no option to add vcpu's seen)
Alfa awus036h

After frustration with VMware, I tried VirtualBox 4.3.6. It seemed to work as expected, but any mitm I tried would slow the network throughout to a crawl. I experimented with both NAT and Bridged connection from the host (OSX). On my network, the host's WiFi (OSX) was steadily over 20mbits down, 10mbits up. I got similar results using alfa and testing within kali on the vbox. Also, browsing the net within kali using the host's connection via eth0 worked fine. But, any attempt to bridge the two resulted in the targets network speed dropping to < 0.2 mbits and getting timeout or unavailable errors on the browser. I assumed it must be a pentest tool configuration error on my part but tried a few established scripts with similar results (easy-creds, subterfuge, and cred harvester).

I decided that running a dual boot instead of a virtual machine might bypass the issue but am still struggling with making Kali bootable on a MBP with reFind.

I'd appreciate a point in the right direction from someone with a successful setup on a macbook pro (VMware/virtualbox/dual boot).

Thanks,

MM





Check the forum thread: https://forums.kali.org/showthread.php?19266-How-to-install-Kali-with-EFI-and-dualboot-on-Macbook-Pro&highlight=dualboot+Macbook

Kazuya
2014-07-03, 11:24
Kazuya, Hi,

As I was reading your post I began to see if your I/O was replicable. Unfortunately, my kali works flawlessly, so I was not able to reproduce your output and some of the input commands do not apply to my architecture. In other news, I found some hope for you: https://www.virtualbox.org/manual/ch04.html here. It is a detailed walkthrough for installing guest additions INSIDE the VirtualBox. Maybe that is why it isn't working the way you'd expect. Always install the guess additions inside the VM, your Host OS is only a proxy, where you download it. Also, check: http://docs.oracle.com/cd/E36500_01/E36502/html/qs-guest-additions.html here. The second link is more visual. Finally, you could follow this post: https://help.ubuntu.com/community/VirtualBox/GuestAdditions which pretty much shows you exactly how to do it step-by-step.

As much as I would love to hold your hand and walk you through this, the best thing for you as of now is to consult the docs. We can still sing Kumbi ya though. :)

HTH

Hi OS-13115

Still unable to get this working even started from scratch following this guide http://kanishkashowto.com/2013/09/03/how-to-install-kali-linux-in-virtualbox-step-by-step-guide/
I am still getting this issue

Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)

Kazuya
2014-07-04, 11:06
Hi OS-13115

Still unable to get this working even started from scratch following this guide http://kanishkashowto.com/2013/09/03/how-to-install-kali-linux-in-virtualbox-step-by-step-guide/
I am still getting this issue

Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)

Resolved. I did more googling and eventually found this post http://askubuntu.com/questions/204098/error-building-main-guest-additions-module-while-installing-virtualbox-guest-add and ran this command apt-get install virtualbox-guest-x11 rebooted and all seems fine

OS-13115
2014-07-07, 04:38
Resolved. I did more googling and eventually found this post http://askubuntu.com/questions/204098/error-building-main-guest-additions-module-while-installing-virtualbox-guest-add and ran this command apt-get install virtualbox-guest-x11 rebooted and all seems fine

I'm glad your problem is resolved.

atige
2014-08-01, 13:55
For Guru meditation problem in installation on vbox
visit this iranian guide:
http://notion.mihanblog.com/post/153

uttejshas
2014-08-28, 19:10
Creating Shared Folders with the Host System

In order to share folders on your host system with your Kali Linux VM, there are a few short steps that need to be completed.
From the VirtualBox Manager, select your Kali Linux VM instance and click on the 'Shared Folders' link in the right window pane. This will launch a pop up window for adding shared folders. Within this window click the icon to add a folder (the icon is a Folder with a '+' on it).
In the Folder Path text box, provide the path to the folder you would like to share, or click the drop-down arrow to browse your host system for the path. Select the check boxes that allow for 'Auto-mount' and 'Make Permanent' and click the OK button both times when prompted.



Your shared folders will now be available in the media directory. You can create a bookmark or link for easier access to the directory.

Hello,
I dont want to infect my host system (OSX). How can i protect my host if i share a folder with VM which contains Kali? Otherwise, what are the tips or things that i can do to secure my host system? I'm very new to Virtual machines and Kali.. Please guide me.

Thanks.

giant22000
2016-02-12, 03:31
Resolved. I did more googling and eventually found this post http://askubuntu.com/questions/204098/error-building-main-guest-additions-module-while-installing-virtualbox-guest-add and ran this command apt-get install virtualbox-guest-x11 rebooted and all seems fine

Thanks for sharing. This fixed me up as well!

Gh0st131
2016-03-10, 19:21
when i try this code with sudo apt-get update && apt-get install -y linux-headers-$(uname -r)
and i get this error "root@kali:~# sudo apt-get update && apt-get install -y linux-headers-$(uname -r)Hit http://security.kali.org kali/updates InRelease
Hit http://security.kali.org kali/updates/main amd64 Packages
Hit http://security.kali.org kali/updates/contrib amd64 Packages
Hit http://security.kali.org kali/updates/non-free amd64 Packages
Ign http://security.kali.org kali/updates/contrib Translation-en_US
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://security.kali.org kali/updates/main Translation-en_US
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en_US
Ign http://security.kali.org kali/updates/non-free Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-3.7-trunk-amd64
E: Couldn't find any package by regex 'linux-headers-3.7-trunk-amd64'
root@kali:~#
"
im using amd64 on vmplayer

I am having a similar problem.

root@kali:~# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.3.0-kali1-amd64
E: Couldn't find any package by glob 'linux-headers-4.3.0-kali1-amd64'
E: Couldn't find any package by regex 'linux-headers-4.3.0-kali1-amd64'
root@kali:~#

My sources:

deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
deb-src http://http.kali.org/kali kali-rolling main contrib non-free

I'm running Kali 2016.1 in the latest version of VirtualBox. Does anyone know a possible fix to get the Linux headers? It's a fresh install of Kali.

I've done:
apt-get update
apt-get upgrade
apt-get dist-upgrade