AMD-V activated, or not?

Discussions related to using VirtualBox on Linux hosts.

AMD-V activated, or not?

Postby Sepp Mosch » 27. Feb 2011, 19:38

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   Expand viewCollapse view
% 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
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?

Postby Perryg » 27. Feb 2011, 19:56

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.
Perryg
Site Moderator
 
Posts: 25941
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

Re: AMD-V activated, or not?

Postby przemoc » 27. Feb 2011, 21:43

Checking hardware assisted virtualization support in CPU
Code: Select all   Expand viewCollapse view
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   Expand viewCollapse view
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   Expand viewCollapse view
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   Expand viewCollapse view
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   Expand viewCollapse view
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   Expand viewCollapse view
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.
AMD Athlon 64 X2 4600+ (2.4GHz) | GeIL DDR2-800 2x 2x1GB Ultra (4-4-4-12) | Abit KN9 (nForce 4 Ultra) | Palit GeForce GTX460 1024MB GDDR5 | be quiet! Straight Power CM 680W | HD321KJ (320GB) | 2xHD403LJ (400GB) [RAID0] | HD103UJ (1TB) | WD1002FAEX (1TB) | LH20A1H (DVD+RW) | iHBS212 (BD-RE) | MX1000 | Soprano RS 101 | iiyama ProLite B2403WS
przemoc
 
Posts: 30
Joined: 4. Sep 2008, 16:02
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Linux, Windows

Re: AMD-V activated, or not?

Postby Sepp Mosch » 27. Feb 2011, 21:54

przemoc wrote:
Solution
To unload KVM modules type:
Code: Select all   Expand viewCollapse view
sudo modprobe -r kvm_amd kvm_intel




That's it!
Thanks for the explanation!
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?

Postby przemoc » 18. Nov 2012, 04:40

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:
AMD Athlon 64 X2 4600+ (2.4GHz) | GeIL DDR2-800 2x 2x1GB Ultra (4-4-4-12) | Abit KN9 (nForce 4 Ultra) | Palit GeForce GTX460 1024MB GDDR5 | be quiet! Straight Power CM 680W | HD321KJ (320GB) | 2xHD403LJ (400GB) [RAID0] | HD103UJ (1TB) | WD1002FAEX (1TB) | LH20A1H (DVD+RW) | iHBS212 (BD-RE) | MX1000 | Soprano RS 101 | iiyama ProLite B2403WS
przemoc
 
Posts: 30
Joined: 4. Sep 2008, 16:02
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Linux, Windows


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 15 guests