Can anyone with a Ryzen system please tell me if AMD-v, aka SVM, can be used for two different type 2 hypervisors at the same time? For example, at least one hardware accelerated Virtualbox machine running alongside at least one hardware accelerated QEMU/KVM.
I’m using KVM for GPU passthrough, and Virtualbox for some other things.
Intel cannot run both at the same time with VT-x, and it is a huge problem for me on Skylake-X. I have to load and unload the kernel modules each time I want to switch between the two, so cannot run them at the same time.
I’m going to be using the 16 core, or the new Threadripper, when they come out if that matters, but if any current Ryzen can do it, 3rd gen Ryzen should be able to too.
For those curious, the script I use to swap between the two on Intel is below.
#!/bin/bash
#This script changes the user of the vt-x feature from virtualbox to kvm, and vice versa
#Taken from: https://markandruth.co.uk/2016/12/14/easily-switch-between-kvm-and-virtualbox-virtual-machines
VM=$1
if [ "$VM" = "kvm" ]; then
sudo rmmod vboxpci vboxnetflt vboxnetadp vboxdrv
sudo modprobe kvm_intel
fi
if [ "$VM" = "vbox" ]; then
sudo rmmod kvm_intel kvm
for i in vboxdrv vboxpci vboxnetflt vboxnetadp; do
sudo modprobe $i
done
fi
I did try that yesterday (will be able to try it again in 2 hours after work), but had no luck, even changing the order that the hypervisors are started in. I got the same error as if it was using the “Default” option, about not being able to get VT-x. This is for the “Paravirtualization Interface” option under the System -> Acceleration options, which I am fairly certain you are talking about.
Does this work on your system? Are you sure that they can both use it together? Based on what I saw in testing, it appeared to me that Virtualbox is grabbing VT-x exclusively (or something). Care to try it? I hope you’re right!
So, I did try this again, but the same issue came up, from virt-manager with a virtualbox VM with KVM selected running:
“Unable to complete install: ‘internal error: process exited while connecting to monitor: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
failed to initialize KVM: Device or resource busy’”
I even tried this on a fresh install, just installed virtualbox and KVM, started the virtualbox VM, then created a new KVM VM, same problem.
EDIT: adding the virtualbox error that shows up when KVM is started first:
"VT-x is being used by another hypervisor (VERR_VMX_IN_VMX_ROOT_MODE).
VirtualBox can’t operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT_MODE).
|Result Code:|NS_ERROR_FAILURE (0x80004005)|"
What I’m really curious about is, if that error about VMX will show up on Ryzen too. I made a point to try starting a KVM then a virtualbox VM second, and vice versa.
Well, I was able to squeeze out certain odd behaviors that would not fall into line with that, such as running VMware with VT-x, alongside QEMU under some circumstances. So I think it won’t be possible to say for sure until it is tried on a Ryzen.
Definitely agree. But it might actually fully work on Ryzen. I think it is too complex of a CPU feature for me to speculate on, hence why I’m seeking out a guinea pig.
If you can wait until the end of October or maybe November, I can be your guinea pig. I am purchasing either the new 16 core Ryzen or two of the 12 core Ryzens. It all depends on if the 16 core is just vaporware. I suspect it is, and if AMD doesn’t confirm they are adding the 16 core Ryzen to their new lineup at E3, I will be sure it is.
Thro is right you can run two different hypervisors at the same time, but one has to be nested one under the other. Virtualbox has the ability to run nested hypervisors since 6.0, (this is true only for AMD processors) so the only thing I can suggest is to either pick hypervisor to run all your virtual machines or just give the new Ryzen a try.
It’s my opinion, running two different hypervisors on the X86 platform isn’t really possible or if it can be done it’s very unstable. At least that is the conclusion I have arrived at from all I have read about virtualization.