Android emulator /dev/kvm not found? - linux

I am using fedora distro.
I went to create android emulator in android studio, but i got that /dev/kvm not found!
I tried to install kvm but still same.
Any one can help me ?

You need to enable KVM, from the BIOS by pressing F1 key before the system boot. Next, go to the Security tab and enable Intel Virtualization Technology and Intel VT-d Feature. Save the new settings by pressing F10. Finally, exit and restart your computer.

Related

Unable to install Android Emulator Hypervisor Driver for AMD Processor

I am unable to install Android Emulator Hypervisor Driver for AMD Processor.
It is to be noted that virtualization is enabled.
Emulator Process for AVD was killed shown while running the code in Visual Studio while trying to install the Hypervisor Driver in Android Studio.
Error is also shown in Android Studio while installing the Hypervisor Driver:
What to do now? Thanks.
If you are using AVAST antivirus, It will not work .. So open Avast antivirus UI and go to Menu / Setting / troubleshooting and clear the tick on (( Enable hardware-assisted virtualization )) and restart. It will be installed.
First you should try to see if you have Hyper-V enabled. In most cases, the newer computers use it for hardware acceleration but it doesn't share with other virtualization apps, so to run this on an AMD or Intel VT-x first check if you have Hyper-V installed (go to your control panel, then in Programs and Features window, click “Turn Windows features on or off.” then look for Hyper-V and clear the checkbox then click OK.
If that doesn't work check your BIOS permissions, you can go to advanced CPU configuration or chipset and
find the "Intel Virtualization Technology", enable this option,
or
on AMD enable the SVM
then Save and Exit.
If you are using AVAST antivirus, It will not work .. So open Avast antivirus UI and go to Menu / Setting / troubleshooting and clear the tick on (( Enable hardware-assisted virtualization )) and restart. It will be installed.
This method by Tamer works for me but you have to restart your computer for it to be effective.
I had the same challenge when trying to add Bluestacks as an emulator in Android Studio and this was my solution.
Open PowerShell as Admin and do this command:
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
A restart should follow and all should be fine.
I'm not sure why you tried installing an AMD Virtualization driver for your Intel-CPU. As other people already suggested, try to install the Intel-Driver instead.
The installation probably failed because the program detected your not using an amd-cpu, so there's no point in installing it.

How to configure KVM for Android Studio on Ubuntu?

No matter how I configure my system, Android Studio shows the "We have detected that your system can run the android emulator in an accelerated performance mode. Linuxed-based systems support virtual machine acceleration through the KVM. Search for install instructions for your particular Linux configuration hat KVM is enabled for faster Android emulator performance."
egrep -c '(vmx|svm)' /proc/cpuinfo gives 8
kvm-ok gives INFO: /dev/kvm exists
KVM acceleration can be used
grep kvm /etc/group gives kvm:x:108:currentLoggedInUser
How should I configure KVM correct on Ubuntu 19.10? And how could I tell if Android Studio is running the VM using KVM?
Thanks.
i had same issue, but the other way around. To make it work, first make sure you've enabled virtualization in the BIOS and added your username in libvirt.
Click cancel on the screen that shows Android KVM
Android Studio will offer you to two options. Choose the one "don't start the setup wizard" (not the recommended one), so it will take you to the welcome screen.
Start a new project as usual and Android Studio will say couldn't find the SDK.
Choose the libraries and emulators to download and the rest is the same as usual.

android studio doesn't detect my device on my ubuntu laptop

I am trying to run an app from Android Studio on my Ubuntu laptop.
I have enabled USB debugging, but it is still not working.
When I press run in Android Studio, it does not detect my device (LG G3 Lollipop).
I could not find any help :(
First of all,
Open terminal and do following:
Do lsusb command to check your device is indeed connected.
Do adb devices to check if your device is connected then it is detected as in adb mode.
2.a. if the above command is not found, do sudo apt-get install android-tools-adb and then check if it is listed.
Secondly, post results of step 1 and 2 with your question to help us in finding a correct solution.
Troubleshooting:
Make sure adb mode in enabled.
Make sure you have opted for Allow option when prompted for in your device upon connecting to your ubuntu system.
This one is from some past LG users, Try connecting your device in PTP mode rather than MTP mode, it surprisingly works.
If it atill doesn't work, (most likely your case), try googling. I landed upon this page by pressing I'M FEELING LUCKY, you should try to feel lucky once in a while.
Source for step number 3 and 4
follow the steps as mentioned upon page:
Create a file: /etc/udev/rules.d/70-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
As a second step of troubleshooting (make sure you again repeated troubleshooting from step1 in case you failed at this step)
Again, the process:
Create a file: /etc/udev/rules.d/51-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idProduct}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
Make sure you have adb installed in your ubuntu system.
If not then type -
sudo apt-get install adb
Provide your system password and press 'Y' asked during installation process.
Then disconnect your device through USB and then reconnect it.
You will have to grant permission for debugging which prompts on your device just after reconnecting.
I faced the same issue but it was my mistake. I didn't turn on the " USB DEBUGGING MODE ".
Settings > Developer Option > Enable USB Debugging Mode.
Try to revoke USB debugging authorizations and then connect your device, it should show permission prompt for authorization.
go to
settings -> developer options -> revoke USB debugging authorizations.
I tried restarting adb using root priviledges and it worked for me. Use these commands in the terminal:
sudo adb kill-server
sudo adb start-server
Hope it works for you too...
For my situation with Ubuntu 16.04, with my device properly connected via USB, confirmed by lsusb
The solution is let the Studio aware of the Android/Sdk folder by defining
export ANDROID_HOME=<the Android/Sdk folder>
in ~/.bashrc
(I have installed the SDK at a custom location)
Then start a new shell, from there re-start the studio, then it works.
I solved with this: https://stackoverflow.com/a/37109216/5081063
If the problem is only on Android Studio and not in your OS you can solve with that.
So first check if adb recognize any devices with:
$ adb devices
If yes, open Android Studio and follow these steps:
Go to Run > Edit Configurations...
Under Deployment Target Options select Show Device Chooser Dialog from the drop-down-list
if you are doing it first time in Ubuntu Linux, then Use sudo apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.
or, use
sudo adb kill-server
sudo adb start-server
and check using
sudo adb devices
you can also check uncheck the usb debugging option, in your developer option in the phone.
follow this link for more info.
Run apps on a hardware device
Enable USB Debugging from Settings->Developer Options
Enable Developer Mode by clicking on build number several times
My device appeared as unrecognized and when I ran adb devices fom android-tools directory it said: adb not a command. Strange. So what I did is installed adb tools additionally and then run adb devices:
sudo apt-get install android-tools-adb
89LY0810Y unauthorized
Then I saw the dialog on my device and selected: Always authorize.
Please make sure your device is in debug mode.
If you have tried many terminal commands to connect your physical device to android studio in ubuntu and you failed to connect try this :- Connect your device and change your USB preference(device notification) to PTP,android studio will detect your device.see this image
I had the same problem, as I had enabled the USB Debugger but it was my first try so I didn't know what to expect. If you answer "yes" to "use as storage device," you will set it to mtp, if you answer no, after that you will have the option to connect on debug mode and it will appear.
I was using a Samsung A31 and Debian
After trying a lot of different solutions, I notice that the problem was my cable, so I changed it and now it works.
Thanks to RazorHail Answer.

Android Studio KVM Setting?

Put in KVM (Kernel-based Virtual Machine) into my 64 bit Ubuntu 14.04 LTS per:
https://help.ubuntu.com/community/KVM/Installation
In the terminal:
kvm-ok INFO: /dev/kvm exists KVM acceleration can be used
OK so the KVM is in.
When I run the Android Emulator there is no change from the way the Emulator ran before I put in the KVM.
I've looked in to the various settings within Android Studio, and I found nothing obvious about KVM.
Does Android Studio have a setting somewhere to enable KVM?
Android Studio 1.5 and 2.0 do not have such option any more.
Update: that is because the team has made KVM mandatory. And see comments from Google employees claiming that their new 2.0 emulator is also KVM-based.
Alright, so when you see the message (on Android Studio v2 and higher):
KVM is required to run this AVD.
/dev/kvm device: permission denied
Grant current user access to dev/kvm
What you can do (manually, since I haven't found anything in Android Studio) to fix this is:
Add your Linux user into the kvm group: sudo adduser your_linux_user kvm
If the group doesn't exist, download this package sudo apt install qemu-kvm and try to add your user again into the kvm group.
When the user has successfully been added into the KVM group, logout or restart and try opening Android Studio again.
This setting works totally fine in Ubuntu 18.04/18.10, but it should work in other distros as well.
You can do this:
Click on Run -> Edit Configurations and go to the Emulator tab
You can add it on "additional commandline options":
-qemu -enable-kvm
I'm not sure if there is also a GUI option somewhere though, or how to check if it is working or not.
I'd test the x86 image to see if it works any faster.
Downgrade to Android Studio 1.4 (delete Android Studio 1.5 installation, download zip from http://tools.android.com/download/studio/builds/1-4-0, follow installation instructions).
Follow Stuart Axon's instructions above.
Gabor as far as I can tell is correct (and addresses the OP's question) - the option to use this acceleration by starting the emulator from within Android Studio 1.5 has been removed.
(Weirdly, I don't seem to be able access the acceleration when starting the emulator from the command line once Android Studio 1.5 has been installed - but maybe I'm wrong.)

android studio: unable to turn on the emulator

The error I get is:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
I believe it is asked once per week and I have search for different solution but still fail
In the installation, I get the same message as the first image of the follow post.
Intel HAXM installation error - This computer does not support Intel Virtualization Technology (VT-x)
The solution I have tried:
1. disable and enable the VT in the bios----same problem in installation of Intel haxm
2. disable the Hyper-V ---------------------Seem my windows do not conation Hyper-V
3. download the workaround patch released by Intel in
http://software.intel.com/en-us/blogs/2013/04/25/workaround-patch-for-haxm-installation-error-failed-to-configure-driver-unknown
whew execute the .cmd file, it just jump up the cmd for half an second and not thing is happened.
In my process, I have stop my avast anti-virus, and I am using windows 8.1.
Could anyone help?
A couple things you haven't tried :
bcdedit /set nx AlwaysOn (to make sure XD bit is on)
bcdedit /set hypervisorlaunchtype off
(and reboot)

Resources