Error VERR_SVM_IN_USE

Discussions related to using VirtualBox on Linux hosts.
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Error VERR_SVM_IN_USE

Post by bahamut00 »

Hi,

I am running the following VirtualBox:

Code: Select all

VirtualBox Graphical User Interface Version 6.0.12_RPMFusion r132055
© 2004-2019 Oracle Corporation (Qt5.12.4)
It comes from RPMFusion repository, but I tried with the Oracle repository and had the same problem.

My host is an up-to-date Fedora 30 with kernel 5.2.16-200.fc30.x86_64

When I try to start any virtual machine, I get the following error:

Code: Select all

Failed to open a session for the virtual machine XXX.

VirtualBox can't enable the AMD-V extension. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_SVM_IN_USE).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
I always update the Linux kernel from the official Fedora repositories. I never compile them by myself. VirtualBox worked perfectly for years, up to a recent update (including a kernel update), and now it keeps giving me this error. I have another machine (more recent) with exactly the same configuration and VirtualBox is still running correctly.

Do you have any clue?

NB: I tried to search for VERR_SVM_IN_USE, but the search engine splits this keyword in four separate words so the result is useless.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error VERR_SVM_IN_USE

Post by socratis »

I believe that the error couldn't have been any clearer; your kernel has the KVM module enabled at boot[1], which means that VT-x/AMD-V is not going to be available, which means that VirtualBox will have a hard time running.

Since there are several flavors of the kernel, it's up to you to install one that doesn't have KVM enabled. I would ask around in the Fedora forums as well...

[1] Note to volunteers: It seems that KVM is now pulling a Hyper-V-like behavior; locking VT-x/AMD-V at boot. :?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

socratis wrote:I believe that the error couldn't have been any clearer; your kernel has the KVM module enabled at boot.
Well, ok, but this diagnostic is not so obvious to me. Here is what my computer shows about KVM modules:

Code: Select all

[root@localhost ~]# lsmod | grep kvm
kvm_amd               106496  0
ccp                    98304  1 kvm_amd
kvm                   753664  1 kvm_amd
irqbypass              16384  1 kvm
But I have another computer with the same up-to-date Fedora 30, it has KVM modules too (see below), but NO PROBLEM to start a virtual machine.

Code: Select all

[root@localhost ~]# lsmod | grep kvm
kvm_intel             299008  0
kvm                   753664  1 kvm_intel
irqbypass              16384  1 kvm
So, why is it failing for the first one but not for the second one?
socratis wrote:Since there are several flavors of the kernel, it's up to you to install one that doesn't have KVM enabled. I would ask around in the Fedora forums as well...
As my lsmod test above does not seem relevant, do you know a clean way to check if KVM is enabled or not? More precisely on which test VirtualBox relies?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error VERR_SVM_IN_USE

Post by socratis »

bahamut00 wrote:So, why is it failing for the first one but not for the second one?
Can't you see the differences? The difference between "kvm_amd" and "kvm_intel"? Maybe the "kvm_amd" is more aggressive...
bahamut00 wrote:do you know a clean way to check if KVM is enabled or not?
Exactly what you did, 'lsmod | grep kvm'.
bahamut00 wrote:More precisely on which test VirtualBox relies?
The availability of VT-x/AMD-V. If it's not available, you get that error.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

socratis wrote:
bahamut00 wrote:So, why is it failing for the first one but not for the second one?
Can't you see the differences? The difference between "kvm_amd" and "kvm_intel"? Maybe the "kvm_amd" is more aggressive...
From my "basic" end-user point-of-view, such random behaviour looks more like a bug.
socratis wrote:
bahamut00 wrote:do you know a clean way to check if KVM is enabled or not?
Exactly what you did, 'lsmod | grep kvm'.
I have blacklisted the kvm modules so that they are not anymore loaded at boot. lsmod | grep kvm does not show them anymore at run time, but still no success the VM won't load.
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

At some point I realized that some of the guest VM could not start, but some others could. By comparing the settings, I had to uncheck "Enable VT-x/AMD-V" under Settings > System > Acceleration. Now I can boot any VM.

I can't remember when/why some of the VM had this option checked and others not. For sure I did not change this option for years. Something must have changed in the Linux kernel for Fedora and/or VirtualBox is more sensitive to the kernel configuration. Anyway, my problem is solved. Thanks for your support.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error VERR_SVM_IN_USE

Post by socratis »

bahamut00 wrote:I had to uncheck "Enable VT-x/AMD-V" under Settings > System > Acceleration. Now I can boot any VM.
Then that can mean only one thing; your host doesn't have VT-x/AMD-V available.

If you need further assistance, we need to see a complete VBox.log, from a complete VM run, where the problem occurs:
  • Start the VM from cold-boot (not from a paused or saved state) / Observe or recreate the problem / Shutdown the VM (force close it if you have to).
  • With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log", ZIP it and attach it to your response. See the "Upload attachment" tab below the reply form.
Image
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

I have upgraded VirtualBox from 6.0.14 to 6.1.0 and the VERR_SVM_IN_USE problem is back again. In the VM settings, the acceleration settings have been modified so I can not disable anymore the VT-x/AMD-V acceleration. None of my VM can boot now. I attach a complete log as requested.
Attachments
Vbox-2020-01-01-18-09-59.zip
(11.59 KiB) Downloaded 35 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Error VERR_SVM_IN_USE

Post by scottgus1 »

bahamut00 wrote:I have upgraded VirtualBox from 6.0.14 to 6.1.0
Virtualbox 6.1.x has removed the ability to run without VT-x or AMD-V. If your PC hasn't got it available, then you can't run 6.1.x. Stay with 6.0.x or clear things up so AMD-V is free.

Normally there's a line in the log "Full Name:" that shows the name of the CPU your PC has. This line isn't in your log. It appears the guest crashes out before the CPU name is shown. All we have is the nearest match: "AMD_K10 with CPU DB entry 'Quad-Core AMD Opteron 2384'. According to CPUworld this processor has AMD-V. If your PC's BIOS also has AMD-V turned on (It might be called 'SVM') then you should have the hardware in order.

My quick research on KVM is that it may be or can be a type-1 hyperivsor, like Windows Hyper-V, so:
socratis wrote:[1] Note to volunteers: It seems that KVM is now pulling a Hyper-V-like behavior; locking VT-x/AMD-V at boot.
Here's info on what Hyper-V does to Windows PCs so that it interferes with Virtualbox:
I have a 64bit host, but can't install 64bit guests and https://www.tenforums.com/tutorials/139 ... puter.html KVM is probably doing the same thing. To get the most out of your PC, try your best to get rid of KVM. (Note that how to do so is not within the purview of this forum.)

The Virtualbox error fingers KVM as the stealer of AMD-V and that you need to not only "disable the KVM kernel extension" (blacklist?) but also "recompile your kernel and reboot". If you have not done both of these, then you won't get AMD-V for Virtualbox to use.

Alternatively:
socratis wrote:install [a kernel] that doesn't have KVM enabled
A couple other notes:
00:00:01.102572 Host RAM: 3933MB (3.8GB) total, 2687MB (2.6GB) available
00:00:01.142668 Guest OS type: 'WindowsXP'
00:00:01.244590   RamSize  <integer> = 0x0000000008000000 (134 217 728, 128 MB)
You have room on this PC to give XP more ram. 512MB or even a GB. It'll run better.
00:00:01.245030   3DEnabled <integer> = 0x0000000000000001 (1)
00:00:01.245043   VRamSize         <integer> = 0x0000000002000000 (33 554 432, 32 MB)
6.1.x has disabled 3D acceleration for less than Windows 7 guests. (there's a real big security hole in 3D acceleration for VboxVGA video). If you go back to 6.0.14 you'll get 3D back. But you might want to give the guest more video RAM if you do.

bahamut00 wrote:I tried to search for VERR_SVM_IN_USE, but the search engine splits this keyword in four separate words so the result is useless.
So is the forum search function. :shock: In the future, to help you get underway getting a solution quick you can try searching for the error text (the CAPITALIZED_UNDERSCORE_SPACED_WORDS) in a web browser with the text "site:forums.virtualbox.org" added to restrict searching to this forum, like this:

VERR_SVM_IN_USE site:forums.virtualbox.org
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Error VERR_SVM_IN_USE

Post by fth0 »

Your problem may have another background: Some BIOSes, especially older ones from Gigabyte, erroneously indicate that SVM is in use. There is a hack/workaround available in VirtualBox (for 10 years now). For details see https://www.virtualbox.org/ticket/5639.

:!: Note that this workaround may be dangerous for your host (say: lead to crashes and whatnot), if the cause of your problem is not the BIOS, but another hypervisor (e.g. KVM). :!:
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

fth0 wrote:Some BIOSes, especially older ones from Gigabyte, erroneously indicate that SVM is in use.
There is a BIOS update available on the Gigabyte support pages, but they only provide a MS Windows executable, while my main OS is Linux/Fedora. I am stuck here...
fth0 wrote:There is a hack/workaround available in VirtualBox (for 10 years now). For details see https://www.virtualbox.org/ticket/5639.
Do you mean the VBOX_HWVIRTEX_IGNORE_SVM_IN_USE hack? It seems ineffective. Is it still supported?
fth0 wrote::!: Note that this workaround may be dangerous for your host (say: lead to crashes and whatnot), if the cause of your problem is not the BIOS, but another hypervisor (e.g. KVM). :!:
As explained in my first messages on top of this topic, I have found no trace of another running hypervisor.
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

scottgus1 wrote:Virtualbox 6.1.x has removed the ability to run without VT-x or AMD-V.
This decision seems to make obsolete my hardware configuration...
scottgus1 wrote:Normally there's a line in the log "Full Name:" that shows the name of the CPU your PC has.
My CPU is an AMD Phenom(tm) II X3 705e. It provides AMD-V. In the BIOS the "Virtualization" item is enabled.
scottgus1 wrote:The Virtualbox error fingers KVM as the stealer of AMD-V and that you need to not only "disable the KVM kernel extension" (blacklist?) but also "recompile your kernel and reboot". If you have not done both of these, then you won't get AMD-V for Virtualbox to use.
I have tried blacklisting the KVM modules with no success. I do not plan to recompile the Linux kernel by myself, as this gets me too far from the official/supported life of the distro.
scottgus1 wrote:You have room on this PC to give XP more ram. 512MB or even a GB. It'll run better.[...]
6.1.x has disabled 3D acceleration for less than Windows 7 guests.
Thanks for the advises, I will check for these if I succeed to start over again my VM.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Error VERR_SVM_IN_USE

Post by fth0 »

bahamut00 wrote:Do you mean the VBOX_HWVIRTEX_IGNORE_SVM_IN_USE hack? It seems ineffective. Is it still supported?
Yes, I think so. I found it first inside the VirtualBox 6.0.14 source code (which I already had available in one of my VMs), and only afterwards I found the ticket confirming it. You can see it for yourself in the first few lines of "hmR3InitFinalizeR0" in HM.cpp (current trunk version).

Why do you think it is ineffective?
bahamut00
Posts: 8
Joined: 25. Sep 2019, 20:01

Re: Error VERR_SVM_IN_USE

Post by bahamut00 »

fth0 wrote:Why do you think it is ineffective?
About VBOX_HWVIRTEX_IGNORE_SVM_IN_USE: I think it is ineffective because VirtualBox still complains about SVM already in use...

Anyway, I succeeded to update my BIOS. You were probably right about erroneous indication of SVM in use from the BIOS, because my PROBLEM is SOLVED! And this time it is probably solved for good. Thanks for your help.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Error VERR_SVM_IN_USE

Post by fth0 »

bahamut00 wrote:About VBOX_HWVIRTEX_IGNORE_SVM_IN_USE: I think it is ineffective because VirtualBox still complains about SVM already in use...
Did VirtualBox only complain or didn't the VM run? In the corresponding VBox.log file, you'd find a line containing "HM: VBOX_HWVIRTEX_IGNORE_SVM_IN_USE active!" if you set the environment variable correctly (with "export") and forced VBoxSVC to restart.
bahamut00 wrote:Anyway, I succeeded to update my BIOS.
Anyway, that's the best solution. :)
Post Reply