LINUX
Install Android on Kali Linux

Fastest Android Emulator on Kali

Steps to enable Hardware accelaration on Virtual box

# Resolving x86_64 Emulation Hardware Acceleration Error in Kali Linux on VirtualBox
 
## Steps to Enable Hardware Acceleration
 
1. **Enable Virtualization in BIOS:**
   - Restart your computer and enter the BIOS/UEFI settings (usually by pressing a key like `F2`, `F10`, `DEL`, or `ESC` during boot).
   - Find and enable options like "Intel VT-x," "AMD-V," "Virtualization Technology," or "SVM."
 
2. **Configure VirtualBox Settings:**
   - Open VirtualBox and select your Kali Linux virtual machine.
   - Go to `Settings` > `System` > `Processor` and ensure that the checkbox for "Enable PAE/NX" is checked.
   - Go to `Settings` > `System` > `Acceleration` and ensure that "Enable VT-x/AMD-V" and "Enable Nested Paging" are checked.
 
3. **Install KVM on Kali Linux:**
   - Open a terminal in Kali Linux and run the following commands to install KVM and check for hardware virtualization support:
     ```bash
     sudo apt update
     sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
     sudo systemctl enable --now libvirtd
     sudo usermod -aG libvirt $USER
  • Reboot your Kali Linux VM to apply the group membership changes.
  1. Verify KVM Installation:

    • After rebooting, check if KVM is installed correctly and hardware virtualization is enabled:
      sudo kvm-ok
    • This command should output that your CPU supports KVM.
  2. Install Android Emulator Dependencies:

    • Ensure that you have the necessary dependencies for the Android emulator:
      sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
  3. Create and Run the Android Emulator:

    • Try creating and running the Android emulator again:
      emulator -avd <Your_AVD_Name>

Alternative: Use ARM System Images

If enabling hardware acceleration is not possible or you continue to encounter issues, you can use ARM-based system images instead of x86_64. ARM system images do not require hardware acceleration.

  1. Download ARM System Image:

    • In the Android SDK Manager, download an ARM-based system image (e.g., armeabi-v7a or arm64-v8a).
  2. Create a New AVD Using ARM System Image:

    • Create a new AVD using the downloaded ARM system image.
  3. Run the ARM-Based Emulator:

    • Run the emulator with the ARM-based AVD:
      emulator -avd <Your_ARM_AVD_Name>

This guide should help you resolve the hardware acceleration requirement issue when running the Android emulator on Kali Linux in VirtualBox.

download from https://developer.android.com/studio
cli as root user:


cd Downloads
cp commandlinetools-linux-11076708_latest.zip ~/
unzip commandlinetools-linux-11076708_latest.zip
mkdir Android_SDK
mv cmdline-tools Android_SDK
cd Android_SDK
mv cmdline-tools latest
mkdir cmdline-tools
mv latest cmdline-tools
cd cmdline-tools/lates/bin
./sdkmanager --list
./sdkmanager "platform-tools" type yes to accept rules
./sdkmanager "emulator"
# Note platforms;android-# where 28 is android 9, 29=android 10, 30=android 11, 31=android 12, 32=12.3
./sdkmanager "platforms;android-29"

# parser for API 29-30
/sdkmanager "skiaparser;1"


# System images API list

| API Level | Version | Description                                               |
|-----------|---------|-----------------------------------------------------------|
| system-images;android-30;android-tv;x86                  | 4        | Android TV Intel x86 Atom System Image           |
| system-images;android-30;android-wear-cn;arm64-v8a       | 12       | China version of Wear OS 3 ARM 64 v8a System Image|
| system-images;android-30;android-wear-cn;x86             | 12       | China version of Wear OS 3 Intel x86 Atom System Image|
| system-images;android-30;android-wear;arm64-v8a          | 12       | Wear OS 3 ARM 64 v8a System Image                |
| system-images;android-30;android-wear;x86                | 12       | Wear OS 3 Intel x86 Atom System Image            |
| system-images;android-30;aosp_atd;arm64-v8a              | 2        | AOSP ATD ARM 64 v8a System Image                 |
| system-images;android-30;aosp_atd;x86                    | 1        | AOSP ATD Intel x86 Atom System Image             |
| system-images;android-30;aosp_atd;x86_64                 | 2        | AOSP ATD Intel x86_64 Atom System Image          |
| system-images;android-30;default;arm64-v8a               | 2        | ARM 64 v8a System Image                          |
| system-images;android-30;default;x86_64                  | 11       | Intel x86_64 Atom System Image                   |
| system-images;android-30;google-tv;x86                   | 4        | Google TV Intel x86 Atom System Image            |
| system-images;android-30;google_apis;arm64-v8a           | 14       | Google APIs ARM 64 v8a System Image              |
| system-images;android-30;google_apis;x86                 | 12       | Google APIs Intel x86 Atom System Image          |
| system-images;android-30;google_apis;x86_64              | 12       | Google APIs Intel x86_64 Atom System Image       |
| system-images;android-30;google_apis_playstore;arm64-v8a | 10       | Google Play ARM 64 v8a System Image              |
| system-images;android-30;google_apis_playstore;x86       | 9        | Google Play Intel x86 Atom System Image          |
| system-images;android-30;google_apis_playstore;x86_64    | 10       | Google Play Intel x86_64 Atom System Image       |
| system-images;android-30;google_atd;arm64-v8a            | 2        | Google APIs ATD ARM 64 v8a System Image          |
| system-images;android-30;google_atd;x86                  | 1        | Google APIs ATD Intel x86 Atom System Image      |


# We will download the default API 
./sdkmanager "system-images;android-29;default;x86_64"

# Confirm installed
./sdkmanager --list_installed

# Creating a new AVD (Android Virtual Device)

1. ./avdmanager create avd -n Android11 -k "system-images;android-30;default;x86_64" -c 1000M 
(-c for memory)
2. When you see do you wish to create a custom hardware profile? go with default no
3. cd ~
4. you will see a .android folder cd into that folder
5. cd avd
6. list dir and you will see a .avd folder and .ini  file
7. cd Android11.avd and list 
8. run the command to see all the specs
```bash
mousepad v

Start AVD emulator

  1. cd ~/Android_SDK/emulator
  2. ls
  3. ./emulator -list-avds
  4. you will se Android11
  5. ./emulator -avd Android11
  6. this will start the emulator