AMD-V activated, or not?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Sepp Mosch
Posts: 2
Joined: 27. Feb 2011, 19:27
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Windows, Plan 9

AMD-V activated, or not?

Post by Sepp Mosch »

Hi,
Just installed VB OSE, but i does not work the way it should. In the session information on the basic tab it says VT-x/AMD-V are activated, but on the runtime it says it isn't and i'm sure it's not, it's _horrilbe_ slow. The kernel module is loaded:

Code: Select all

% lsmod|grep box
vboxnetadp              4193  0 
vboxnetflt             12525  1 
vboxdrv              1723671  5 vboxnetadp,vboxnetflt
My mainboard is supporting AMD-V and it workes well with QEMU/KVM, but these don't have have a good graphic performace, the sound is laggy and bridged networking is pain, so i tryed out VB. Do I have to unload any kvm modules? Where can i read error messages?

Sepp Mosh
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: AMD-V activated, or not?

Post by Perryg »

QEMU/KVM
If these are still active on the host VirtualBox will not/can not use VT-x/AMD-v as it would corrupt everything. Make sure that KVM is completely stopped and try again.
przemoc
Posts: 32
Joined: 4. Sep 2008, 16:02
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Linux, Windows, DragonFlyBSD, FreeBSD, NetBSD, OpenBSD
Location: Poland

Re: AMD-V activated, or not?

Post by przemoc »

Checking hardware assisted virtualization support in CPU

Code: Select all

egrep -q '^flags.*(vmx|svm)' /proc/cpuinfo && echo yes
If you don't get yes in output, then the answer is obviously no. ;)

Checking whether hardware virtualization is enabled/used in AMD CPUs
Checking SVME bit (12th bit, counting from 0 as in AMD docs, SVM Enable) in EFER (MSR 0xC0000080, Extended Feature Enable Register).
You can check it using rdmsr from msr-tools package.

Code: Select all

sudo rdmsr 0xC0000080 #EFER
If you get a number where 4th (counting from 1 and obviously from right) hexadecimal digit has first bit set, or it just equals 1, then SVME is on.

If you've got an error, then you have to load msr module before.

Code: Select all

sudo modprobe msr
KVM problem
KVM module works a bit differently than VB. E.g. in case of AMD KVM sets SVME immediately after loading. So having KVM module loaded, you'll get following, and a bit misleading, message in VB:

Code: Select all

HWACCM: No VT-x or AMD-V CPU extension found. Reason VERR_SVM_IN_USE
Misleading is only a first part, reason is correct.

Solution
To unload KVM modules type:

Code: Select all

sudo modprobe -r kvm_amd kvm_intel
It will be a bit off-topic now, but still may be useful for somebody.

Checking whether hardware virtualization is permanently (in current session) disabled
For AMD CPU to check whether you can use hardware virtualization, i.e. it wasn't blocked by BIOS, etc. you have to look at SVME_DISABLE bit (4th, counting from 0) in VM_CR (MSR 0xC0010114).

Code: Select all

sudo rdmsr 0xC0010114 #VM_CR
If you get a number where 2nd (counting from 1) hexadecimal digit has first bit set, or it just equals 1, then your hardware virtualization is not available in this session.
Desktop: NUC11PHKi7C [Core i7-1165G7 @ 2.80GHz, DDR4-3200 32GB RAM, GeForce RTX 2060, M.2 NVMe SSD 2TB] | 32UN880-B
Laptop: ThinkPad T430 (2344-56G) [Core i7 3520M @ 2.9GHz, DDR3-1600 8GB RAM, NVS 5400M, SATA3 SSD 512GB]
Sepp Mosch
Posts: 2
Joined: 27. Feb 2011, 19:27
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Windows, Plan 9

Re: AMD-V activated, or not?

Post by Sepp Mosch »

przemoc wrote:
Solution
To unload KVM modules type:

Code: Select all

sudo modprobe -r kvm_amd kvm_intel
That's it!
Thanks for the explanation!
przemoc
Posts: 32
Joined: 4. Sep 2008, 16:02
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Linux, Windows, DragonFlyBSD, FreeBSD, NetBSD, OpenBSD
Location: Poland

Re: AMD-V activated, or not?

Post by przemoc »

Just for the reference (for old hardware users/googlers), some possibly useful information (on topic of AMD-V activated, or not?) can be found in my comments on ticket 1933, in particular:
Desktop: NUC11PHKi7C [Core i7-1165G7 @ 2.80GHz, DDR4-3200 32GB RAM, GeForce RTX 2060, M.2 NVMe SSD 2TB] | 32UN880-B
Laptop: ThinkPad T430 (2344-56G) [Core i7 3520M @ 2.9GHz, DDR3-1600 8GB RAM, NVS 5400M, SATA3 SSD 512GB]
Post Reply