/dev/kvm not found on mac - macos

So I've been working with android studio 2.0 beta on my Mac and AVD was working fine.
But then I notice that android studio can't launch AVD now. It says /dev/kvm not found. enable VT-x in your bios security settings, ensure that your linux distro has working kvm module.
The thing is: I didn't touch bios settings at all. Possible causes :
VMWare - I was playing with virtual machines and configuring new networks for vm's just before I noticed the error.
CleanMyMac - I also used this app to clean the system
other causes are possible, but I never entered BIOS or touched system settings
The solutions on resolving this issue I found all refer to Linux, rather than Mac. How would I fix this?
EDIT:
I reinstalled OS X (without formatting hard drive). That didn't work.

Here is the solution that worked me.
Well, Android Studio need HAXM to run emulator.
The issue is that the HAXM drivers doesn’t support the beta version of Mac Os High Serria yet.
The driver works but with a little bit of additional command.
First, you will need to disable the Security Protection on kext. The drivers is not sign for this version.
From https://apple.stackexchange.com/a/269777:
Get into Recovery Mode by restarting and holding down ⌘+R until Apple logo appears.
In the top menu click Utilities > Terminal.
In the Terminal window type and press Enter:
csrutil enable --without kext
Then restart the Mac.
Then you can install HAXM from:
Download the driver from here https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager/ and unzip it.
Open a terminal and go to the directory of the driver :
cd Downloads/haxm-macosx_v6_2_0
# edit the file and look for 10.12
nano silent_install.sh
CTRL + W
10.12
Add 10.13 after 10.12, and save the file ( CTRL+X, Y, ENTER)
Run it:
./silent_install.sh
To be sure it works:
sudo kextload -bundle-id com.intel.kext.intelhaxm
Now your emulator should work !

Just remove the previous HAXM and install IntelHAXM_6.0.3.dmg in haxm-macosx_v6_0_3.zip
here is download link haxm-macosx_v6_0_3.zip
its work for me!

/dev/kvm not found on mac.
Follow the steps. You can solve your problem.
Step1: Download Intel HAXM from software.intel.com.
Step2: Extract and Open the file name like “IntelHAXM_6.2.1.dmg”.
Step3: Double click on “IntelHAXM_6.2.1.mpkg” to Install manually.
Step4: Read and Install carefully.
Step5: When you receive Security warning for new extension goto system preferences and Click “Allow” button.
Step6: That’s it. Now you can run the emulator.
(Note : Incase you get same error again. Please Re-Install the
“IntelHAXM_6.2.1.mpkg” Once again. That’s really fix your problem.)
Happy coding... :-)

Enter your VM settings and then search for virtualization engine :
Check the virtualize Intel VT-x/EPT or AMD-RVI option.
This should resolve the problem.

Your MacOS need to enable Intel VT-x
Reference:
enable Intel VT-x

Related

How can I launch Android Emulator without android studio on Mac M1

I'm trying to start the emulator with this command emulator -avd Pixel_4_API_30 but it gives me an error:
[8633370112]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/primulax/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory
Android Studio specs:
Build #AI-203.7717.56.2031.7935034, built on November 21, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
✅ I was able to run with ~/Library/Android/sdk/emulator/emulator -avd Pixel_4_API_30 with this command
Use ~/Library/Android/sdk/emulator/emulator instead of ~/Library/Android/sdk/tools/emulator on MacOS, for Ubuntu use ~/Android/Sdk/emulator/emulator.
I just experienced the same issue on a freshly setup machine, emulator installed through SDK manager and all.
The error message says it all actually: If you go to /Users/primulax/../emulator/qemu/ on your machine, you'll notice that of course there is no darwin-x86_64 directory, but darwin_aarch64, since you are on an M1 machine. Whatever the reason is the emulator looks in the wrong directory, if you just duplicate the darwin_aarch64 folder and name your copy darwin-x86_64, it works as intended. Not ideal, but it's a workaround until this path-problem is fixed.
Edit: Please take a look at #Andrew Stromme's comment. Of course symlinking is a much more elegant solution to this problem!
If you have Android Studio installed, you can run the emulator from terminal without having started Android Studio first.
First of all, run
cd ~/Android/Sdk/tools && ./emulator -list-avds
to get a list of all the available Android virtual devices that you have installed.
Then, copy the name of the virtual device you want to use and run
cd ~/Android/Sdk/tools && ./emulator -avd YOUR_DEVICE_NAME
where you replace "YOUR_DEVICE_NAME" with the name of a virtual device that was listed in the installed virtual devices list.
This info and more that you may find useful can be found in the official documentation.
Now for the error you get it's most possibly due to a wrong file path. It seems that others have also faced this issue and a bug has been opened before here. The most common solution proposed is to launch emulator from the
/path/to/android-sdk/tools
directory in command line.
Also, before trying this or any other solution listed in this issue tracker, firstly make sure that you have installed from the SDK Manager the Android Emulator in SDK Tools.

Kernel driver not installed (rc=-1908) Getting Errors in macOS Big Sur 11.0.1

I just want to work with VirtualBox but now I am getting this type of error.
I could not find a proper solution.
Kernel driver not installed (rc=-1908)
Make sure the kernel module has been loaded successfully.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
MAC with BIG SUR -- Kernel driver not installed (rc=-1908)
Make sure the kernel module has been loaded successfully.
where the error is:
suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
Download and install the latest VirtualBox 6.1.18 or higher. And then follow the below steps to resolve.
Step 1 - run:
sudo kextload -b org.virtualbox.kext.VBoxDrv
Step 2: Go into System Preferences->Security & Privacy
Step 3: Unlock the security center
Step 4: Approve the software by Oracle
Step 5:
sudo kextload -b org.virtualbox.kext.VBoxNetFlt
sudo kextload -b org.virtualbox.kext.VBoxNetAdp
sudo kextload -b org.virtualbox.kext.VBoxUSB
Step 6: Reboot
Registering the .kext directly via terminal solved this issue for me.
sudo kmutil load -p '/Library/Application Support/VirtualBox/VBoxDrv.kext'
There should be a prompt in System Preferences to allow the kernel, which will require a reboot.
Reboot and run command cd ˜/Homestead && vagrant up
On MacOS Monterey 12.4, I just installed the latest version and opened VirtualBox (version 6.1.34 r150636 (Qt5.6.3)). Then:
Step 1: Went into System Preferences->Security & Privacy.
Step 2: Unlocked the security center.
Step 3: Approved the software by Oracle.
I haven't uninstalled my old virtualBox or restarted the machine or typed any code.
Big Sur disables the VirtualBox kernel extensions as part of the installation process. You can verify this by running:
kextstat | grep -v com.apple
If the kernel extensions are installed, you will see something like this:
Executing: /usr/bin/kmutil showloaded
No variant specified, falling back to release
Index Refs Address Size Wired Name (Version) UUID <Linked Against>
184 3 0xffffff7fa232d000 0xb2000 0xb2000 org.virtualbox.kext.VBoxDrv (6.1.18) 9C1C33DF-8061-30A2-9266-C9284816A6A2 <8 6 5 3 1>
187 0 0xffffff7fa240a000 0x5000 0x5000 org.virtualbox.kext.VBoxUSB (6.1.18) 51E577B4-43B6-359F-B817-9C63A69E7943 <186 184 62 8 6 5 3 1>
188 0 0xffffff7fa2405000 0x4000 0x4000 org.virtualbox.kext.VBoxNetFlt (6.1.18) 96E530DE-E34D-3447-89A5-FCF6646AE47E <184 8 6 5 3 1>
189 0 0xffffff7fa23ff000 0x2000 0x2000 org.virtualbox.kext.VBoxNetAdp (6.1.18) 63EFABA5-3341-3BEB-B47A-AAFCDD7312A5 <184 6 5 1>
If you don't see the extensions loaded, the easier fix is to delete your current VirtualBox app, download and install the lastest version and then go the Security & Privacy System Preferences Pane. You should see a message that some applications require a restart to work correctly.
Restart your Mac and VirtualBox should now work. You can re-run the kexstat command just to be sure the extensions were loaded.
Here is how I solved the issue on MAC with MONTEREY
Update 09 december 2021 : installing the latest version (VirtualBox-6.1.30-148432-OSX.dmg when updating this post) completely solve the issue on my machine
Initial post :
Download the latest installer of VirtualBox (VirtualBox-6.1.28-147628-OSX.dmg when writing this post)
Launch the installer
Double click on the file VirtualBox_Uninstall.tool in order to uninstall VirtualBox
Reboot
Reinstall VirtualBox
Solution worked for Big Sur (no need to delete anything):
Update VirtualBox
Install VirtualBox Extension Pack https://www.virtualbox.org/wiki/Downloads
Settings -> Security -> General settings -> Unlock settings
On "General settings" form turn allow application usage checkbox from "App Store and others..." to "App Store" and back to "App Store and others..." (to make sure Mac recognised the changes made before on steps 1-2)
Go to "Additional settings" ("General settings" form button right after application usage checkbox), system will show Applications changes made before (steps 1-2), push "Ok" and system will ask for reboot
After reboot VirtualBox will work
I also got the same error while trying to run Windows 10 on macOS Big Sur 11.6, but I was easily able to fix the issue by navigating to System Preferences > Security & Privacy. There, under allow apps downloaded from section I found something like Oracle wants to install additional updates, and I gave permission. My Win 10 VM started to work. I hope this help.
after googling for few days and no solution worked for me on macos
I run the below commands
sudo kextload -b org.virtualbox.kext.VBoxDrv
sudo kextload -b org.virtualbox.kext.VBoxNetFlt
sudo kextload -b org.virtualbox.kext.VBoxNetAdp
sudo kextload -b org.virtualbox.kext.VBoxUSB
then
go to "https://www.virtualbox.org/wiki/Downloads"
and download "VirtualBox 6.1.30 Oracle VM VirtualBox Extension Pack" all platform
then open your virutalbox preferences --> choose extension --> and add the extension you just downloaded and eveything will be ok
Another restart of the system solved my problem as I was already at the most current version of virtualbox. My macOS upgrade was from Big Sur 11.6.1 to 11.6.4.
None of the methods here worked for me, the option to approve the driver in System Preferences / Security & Privacy never appeared.
The only way I could get to approve the extension was rebooting in recovery mode, and then giving consent to the Oracle Developr ID running in the Terminal the following command:
spctl kext-consent add VB5E2TV963
Then after a reboot, I could approve the driver and VirtualBox works just fine. Tested in Monterey 12.3.1
Full credits to this site: https://appuals.com/kernal-driver-not-installed-rc-1908-error-mac/
I started getting this issue when my Mac updated from Big Sur to Monterey. I just downloaded and installed the latest version of VirtualBox on my Mac and it started working like earlier.
I couldn't make the option to allow the kext appear in System Preferences either. Rebooting, reinstalling VBox and running sudo kextload -b org.virtualbox.kext.VBoxDrv didn't help.
I discovered another cause: in my case, I had to enable WiFi for internet access and also allow syspolicyd to contact api.apple-cloudkit.com in Little Snitch (it is allowed by default, but I'd disabled that rule). Then running sudo kextload -b org.virtualbox.kext.VBoxDrv forced syspolicyd to verify the signature (or whatever my data it may be uploading) — the option appeared in Security & Privacy and I could allow it finally.
So if anyone has such an issue, try verifying that syspolicyd can contact api.apple-cloudkit.com.
(I also posted this discovery on my blog: https://egeek.me/2022/06/25/kexts-for-virtualbox-do-not-load/).
I had face this issue before and I tried all the threads in this question and doesn't work, then I tried to add the iso file from the setting tab like shown in screenshots, and it worked well.
VirtualBox kernel error
VirtualBox kernel error

Can't launch AVD on macOS 10.13

I created some AVDs in Android studio 3.0, but I can't launch them. I used the following command to launch them:
./emulator #Nexus_5X_API_17
logs:
emulator: WARNING: encryption is off
Hax is enabled
Hax ram_size 0x60000000
Failed to open vm 3
Failed to create HAX VM
No accelerator found.
failed to initialize HAX: Invalid argument
And when I reinstalled "Intel x86 Emulator Accelerator(HAXM installer)", the logs:
HAXM silent installation only supports macOS from 10.8 to 10.12 !
I don't know if it is related with this.
After that, I tried to install virtualBox to install genymotion, but I found when I clicks the virturalBox.dmg, the installer crashed.
Could you help me? thanks.
Use the new Hypervisor.Framework support instead of HAXM on macOS, as described in the comments of the issue filed for this:
Try running the emulator on Canary channel 26.1.x (API 25/26
recommended) with Hypervisor.Framework; put the text "HVF = on" in
~/.android/advancedFeatures.ini (create this file if it doesn't exist
already).
You can download and install the latest version haxm
https://github.com/intel/haxm/releases/latest
Following steps worked for me:
Uninstall HAXM from android studio SDK manager (Tools->Android->SDK Manager->SDK Tools then uninstall 'Intel x86 Emulator Accelerator (HAXM)' by unchecking it.
Download the HAXM version 6.2.1 zip file from Intel site https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx
Install the .dmg file
Restart your computer
Open your AVD having x86_64 image and it should work.
Go to your SDK installation directory, and manually run the HAXM installer. See step 4 on the page: https://developer.android.com/studio/run/emulator-acceleration.html#vm-mac
Technically HAXM is only officially supported up until MacOS 10.12 (Sierra) . Since MacOS 10.13 is still in beta, there may be a bug or incompatible API. If the wizard does no work, please file a bug here for the Android Emulator dev team to investigate further: https://source.android.com/source/report-bugs
Go to Tools->Android->SDK Manager, then in the SDK tools search for Intel x86 Emulator Accelerator (HAXM installer) and update to the latest version, restart and thats all!
On install/reinstall of HAXM you get:
HAXM silent installation only supports macOS from 10.8 to 10.12 !
From https://issuetracker.google.com/issues/62395878#comment44
in System Preferences > Security & Privacy > General, there was a message “System software from developer xxx was blocked from loading.” with an Allow button. Clicking the allow button enabled HAXM again
I just redownloaded the simulator and it worked.

Installing MAC OS useing virtualbox On Windows 8.1

I am trying to install Mac(OSX-Mavericks) using virtualbox On Windows 8.1.
Everything works fine But, when MAC Installation setup starts in virtual machine, it keep on loading and do not start the installation wizard stays on the first screen.
I have waited for a log time like 3-4 hrs but unable to figure out the problem as there is no error.
I am using a dell(Inspiron 3537).
I have installed Mac on my previous Samsung laptop successfully in the same way.
I will provide other information on demand as I'm not sure where the problem is as setup loads but not starts the installation process.
Thanks in advance
enable virtualisation on your BIOS, it may helps.
Open an administrator CMD shell and try this:
cd "C:\Program Files\Oracle\Virtualbox"
VBoxManage modifyvm <name_of_your_vm> --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
Then close/VirtualBox and open again (to save your new settings). Boot OSX with "-v" flag.

Genymotion error at start 'Unable to load virtualbox'

I've installed the genymotion+virtualbox package on Windows 7 64-bit and everything goes fine... But when I start Genymotion it presents me an error message Unable to load virtualbox.
VirtualBox is installed and I'm able to start it manually. I've tried to install the packages separately, updated virtualbox to 4.2.16 but nothing worked.
I've already read genymotion FAQ but it did not help.
I have spend all day to solve this error since none of the answers worked for me.
I found out that oracle virtual box doesn't install the network adapter correctly in windows 8.1
Solution:
Delete all previous virtual box adapters
Go to device manager and click "Action" > "Add legacy hardware"
Install the oracle virtual box adapters manually (my path was C:\Program Files\Oracle\VirtualBox\drivers\network\netadp\VBoxNetAdp.inf)
Now that virtual box adapters is installed correctly, it needs to be setup correctly. (the following solution is like many other solution in here)
Start Oracle VM VirtualBox and go to "File" > "Preferences" > "Network" > "Host-only Network"
Click edit
Set IPv4 192.168.56.1 mask 255.255.255.0
Click DHCP Server tab and set server adr: 192.168.56.100 server Mask: 255.255.255.0 low address bound: 192.168.56.101 upper adress bound 192.168.56.254
Now click OK and start genymotion
Had the same problem, Uninstall Genymotion, install VirtualBox stand alone from https://www.virtualbox.org/wiki/Downloads then install the Genymotion package without VirtualBox.
Try closing Android Studio/Eclipse if it's open. It worked for me.
In Linux at least, I had to restart VirtualBox, running this command on terminal:
/lib/virtualbox/VirtualBox restart
Seems to be the same on Mac OS X.
What worked for me in Windows 7 is to remove the Host-only Network (in Oracle virtual box Preferences menu [CTRL+G] -> Network -> Host-only Networks). Genymotion will recreate it automatically at the next virtual device start. For the record; I'm using a Nexus S 2.3.7 virtual device.
Open Genymotion in Windows as an administrator. My Genymotion works only in this mode
FIXED SOLUTION
Run below command in terminal, It denotes where is your virtualbox install on MAC/Linux.
$ which vboxmanage
/usr/local/bin/VBoxManage
Genymotion search the virtualBox in /usr/bin/VBoxManage while it is located to /usr/local/bin/VBoxManage , you need to create the symlink to that location , Run in terminal to fix it.
sudo ln -s /usr/local/bin/VBoxManage /usr/bin/VBoxManage
I am using Intellij IDEA and same error happened to me, I found that the path to genymotion folder was not configured properly. Either open settings using File > Settings or press Ctrl + Alt + S then in IDE Settings check if the path to the genymotion folder is correct or not.
Since Android Studio are almost similar to Intellij IDEA so you can apply the same steps above to Android Studio as well.
Actually it seems like Genymotion has an issue with the newer versions of Virtual box, I had the same issue on my Mac but when I downgraded to 4.3.30 it worked like a charm.
Verify that GenyMotion is in your PATH environment variable. I noticed mine was not auto populated, so once I entered it, it was fine.
For Windows there are 2 installers. Did you use the bundle containing VirtualBox installer?
It is call Windows 32/64 bits (with VirtualBox).
Don't ask what this has to do with that , but by right clicking the genymotion application file and changing to compatibility to Vista solved the problem!
I also experienced this when I upgraded operating system from Windows 8 to Windows 8.1. Un-installing Virtualbox and re-installing worked for me.
Close Android Studio (if Android Studio is running)
Run Genymotion as administrator
that's all! simple.
try launching it via android-studio/eclipse plugin. Thats how I had similar issue when launching it from ubuntu.

Resources