Enable Hyper-V and Hardware Virtialization for VirtualBOX under Windows - windows-10

I am developing xamarin apps under windows.
I want to regularly run the app under:
Windows Phone Emulator
iPhone Emulator
For the first, Hyper-V needs to enabled under windows.
For the second, one needs an OSX to connect to. I am trying to run OSX under VirtualBox. For this to work, Hardware Virtualization needs to be enabled.
Now, when I enable Hyper-V VirtualBox does not detect the hardware virtualization. And according to this, that will not change.
Is there an solution how I can test iOS and WindowsPhone without having to enable/disable Hyper-V (which requires a restart)?

I understand your pain-point, but this is just not possible to attain w/o a system restart because of the simple fact that the virtualization technologies you mentioned here are of different types.
In your case, Hyper-V that you use for #1 is a "Type 1" hyper-visor which run on host machine hardware. Other examples in this category include Citrix XenServer and VmWare ESXi.
The Virtual Box that you use for #2 is a "Type 2" hosted hyper-visor which runs within an OS.
If you need to toggle b/w these, a restart is eminent AFAIK.
A quick way to see the mode is by running "bcdedit" from Command Prompt to see the current config.
1. To disable Hyper-V run:
bcdedit /set hypervisorlaunchtype off
2. To turn Hyper-V back on run:
bcdedit /set hypervisorlaunchtype auto
However, you would need to reboot in both the cases. I just mentioned a easy config way to make you understand what was happening in the boot loader when toggling between the Type 1 and Type 2 hyper-visor modes.

Virtualbox 6 can use Hyper-V as backend virtualization engine. So that you can use them at same time.
You can enable this feature by this command:
cmd
cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0
According to this:
https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html
This is an experimental feature.
So this feature could be unstable and doesn't even work.
At least it work on my laptop.
Screenshot that Vbox and HyperV at same time

You can do it via opening powershell in administrator mode and run the following code :
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Related

Can I run AVD on a Virtual Windows 10 Desktop

I am currently working form home for an organisation.
Is it possible to run Android Emulator via Android Studio on a Virtual Desktop which has Windows 10 installed.
Also, should I keep my specs low for the Emulator, as I have enough RAM in my VDI.
And do I need to ask the organisation to enable Virtualization in the Virtual Machine, As it may not be possible for me to do so. Or, there is no such things in Virtual Machines?
Currently, When I try to run Emulator, it just gets stuck on black screen forever and timeouts.
I have tried multiple options. But none of them works.
No, after digging in a lot.
It was Azure VDI, windows 10.
And it's not possible to run a virtual machine (Android Emulator) inside another virtual machine.
It may be possible to run in another OS.
But not on Windows which asks to enable Hyper-V.
Which won't allow installation of Intel HAXM.

dnf.exceptions.error some packages from local repository have incorrect checksum

I am trying to install redhat (rhel8) in virtualBox 6.1 on a windows 10 64 bit Home edition machine.
I verified the checksum of the iso file after download and its correct (I compared the checksum against another friend iso file who is able to install properly), still I am getting exception like
dnf.exceptions.error some packages from local repository have incorrect checksum
I even tried to run troubleshooting, but it raise exceptin like
failed to start media check on /dev/sr0 virtualbox
I have downloaded the iso files from multiple places and every time it gives me the same exception.
Any help is highly aprreciated.
Finally I found the reason for the above error.
Virtual Box uses virtualization to run multiple Operating Systems and in one system (let's say a windows machine) only one of the application will be allowed to use system virtualization capability.
So we have to disable any manual virtualization if performed in the system.
So we can disable virtualization by following ways:
Search for “Turn Windows features on or off” in the Start menu, hit
the Enter key to open the Windows Features window. Here, scroll down
to Hyper-V and disable it by clearing checkbox next to it. Then click
OK
Disable Hyper-V by using command.
Press Windows logo key + X, then hit A to run Command Prompt as administrator. In Command Prompt window, type
bcdedit /set hypervisorlaunchtype off
and hit Enter key to execute this command.
Finally restart system.

Problems enabling hyper-v for Windows 10 Pro

Does anyone have any ideas how to enable Hyper-v and containers on Windows 10 Pro 64bit with compatible hardware (according to msinfo32) and all requirements met ie BIOS virtualisation enabled, >4GB RAM and so on. Despite all this none of the commands in powershell or cmd succeed. They complain that one or more parent features must be enabled. There is no error when enabling via Windows features but after the restart Hyper-v regresses to disabled. This question seems to come up a lot and I have tried a wide range of “solutions” but no fix so far. My main goal here is to run Docker for Windows.
Fixed with Windows Defender Fresh start. Not ideal but not as bad as a full reinstall. Worked immediately after this.

Installing emulator: hardware virtualization

When trying to install the Microsoft Emulator - Windows 10 for mobile I got the following error. I have Intel VT enabled in my BIOS setting!
I need to run an UWP application on my Windows 10 Pro; how can I fix this?
A typical error that many of us do when enabling Hyper-V is doing so from the BIOS and expecting it will work.
Hyper-V needs to be enabled on two different points:
The BIOS settings.
The operative system
The fun thing with Visual Studio is that, if hyper-v is not enabled on the OS, it still says that needs to be done on the BIOS settings.
The BIOS settings differ from manufacturers and versions, but the OS remains the same.
It is done so from the Program and Features option in the Control Panel; select the Turn Windows features on or off and then select the Hyper-V options from the dropdown.
Step 1:
Step 2:
Take into account that you need to be an Administrator in your PC as hyper-v needs to add users to the Admin group.
If you're working on a controlled environment, these options may be disabled by your company administrator.
Once everything is in place, you will need to reinstall the VM.

Android Studio running on VMware virtual machine: KVM is not installed

I'm running Android Studio on a Ubuntu VMWare virtual machine. The problem is that when I try to run an app with the AVD emulator I get the following errors in the console:
/home/verite/Android/Sdk/tools/emulator -avd Nexus_5_API_22_x86 -netspeed full -netdelay none
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing).
I've tried to solve the problem by doing this:
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo adduser `id -un` kvm
and restarting, but it doesn't work. When I issue the command:
sudo kvm-ok
I get
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used
Could someone tell me how to fix the problem, please?
Thanks
I faced the same problem. I searched and I found the solution it works with me now:
In VMware:
Open Virtual machine setting.
Go to the processor.
Check the virtualize Intel VT-x/EPT or AMD-RVI option.
Click ok and run the Virtual machine, it should work fine with you.
Hope that works with you.
This link HW virtualization in VMware (KVM - Android Studio) helped me to find the solution.
Bad news found in the Using the Emulator section of the official Android developer website:
Not Inside a VM - You cannot run a VM-accelerated emulator inside
another virtual machine, such as a VirtualBox or VMWare-hosted virtual
machine. You must run the emulator directly on your system hardware.
So it seems my best alternative is look for a real device compatible with the Android Studio for running the apps.
You have vCenter and vSphere Web client use this to edit the VMs config Right click the Your_Windows_GuestOs > Edit Settings > CPU > Check the box "Expose hardware assisted virtualization to the guest OS
.
Install Android on a Cloud Virtual machine (AWS windows server)
Since my machine was slow with Android Studio I created a virtual machine on windows server on AWS with the best processor and RAM configurations, which gave me seamless programming and execution experience. But to use the emulator I face the error listed below.
Error:
Unable to install Intel HAXM
HAXM doesn't support nested virtual machines.
Unfortunately, the Android Emulator can't support virtual machine acceleration from within a virtual machine.
Here are some of your options:
1) Use a physical device for testing
2) Start the emulator on a non-virtualized operating system
3) Use an Android Virtual Device based on an ARM system image (This is 10x slower than hardware accelerated virtualization)
Since we can't connect our device to the Cloud machine, the option #3 is the best way to go.
Once the Android studio is installed,
Go to Tools -> Android -> AVD Manager
Click "Create Virtual Device"
Select which device you want to use from the list (i.e Nexus 5) and click "Next".
Here you're given a list of android release versions. Look at the ABI column.
Choose "Armeabi-v7a" for whichever API Level you want.
Hit "Next" and modify name/size, click "Finish" when done.
if 'Next' doesn't work, download the desired image and continue
I have android emulators running inside VMWare guest. It is utilizing Windows and not Linux, but the principles apply. As has been mentioned, the biggest item is ensuring the the VMWare processor setting for virtualization is checked.
Here are my specifics:
I'm running Win10 for both Host and Guest.
I have Android studio and android emulators running inside of a single VMWare guest which is being run using VMWare's player software.
Here are the versions:
Windows 10 64 bit both host and guest.
Windows 10 guest Ram 6 Gig
Android studio 3.3.2
AVD Emulator
VMWare Player 12, 12.5.1 build-4542065
VMware Number of Processors: 1
VMWare Setting for Processors: Virtualize Intel VT checked.
I faced this exact same error while running AVD in a cloud VM, adding a license solved it.
So, VMWare any cloud provider will not provide you the ability to create nested virtual machines. It is blocked by default so the Android studio would work but you would not be able to run an AVD, that’s not much useful.
To allow this you would then add the following license while VM creation-
https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx
Note: This works only for GCP, you need to add different licenses for VMWare
This was just a short just of what you would do and the major steps involved, however, I highly recommend you to read this blog by me which provides a step by step guide to doing so.
I also urge you to check this answer by me where I explain this in greater detail for GCP.

Resources