Page 1 of 2

[Solved] Cannot install 64-bit guest VMs

Posted: 4. Dec 2019, 11:57
by tomekz28
Hello,

I am having a difficulty running 64-bit vms on my setup. I have tried different versions of VB (5.2.x, 6.0) with corresponding extension packs, linux-headers-generic, etc. (purging, installing reinstalling, etc). I either do not get the 64 bit as a choice, or once I do get it as a choice then when installing a VM I get and error that kvm-amd is not istalled, or I need to change the BIOS settings.

My host is Ubuntu 18.04 running on AMD Ryzen 3800X, the motherboard being MSI X570 MPG GAMING PLUS , the BIOS has been updated. In the BIOS the virtualization is enabled by default (no option to change).

What I noticed:
when rebooted, the /dev/kvm does not exist, I need to run the following command to create it:

Code: Select all

sudo mknod /dev/kvm c 10 232
Heres what I get:

Code: Select all

sudo modprobe kvm-amd
modprobe: ERROR: could not insert 'kvm_amd': Operation not supported

tomek@Pececik:/dev$ sudo virt-host-validate
  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS   <== this is after the 'sudo mknod /dev/kvm c 10 232' command, otherwise FAIL
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller mount-point                  : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpu' controller mount-point                     : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuacct' controller mount-point                 : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'cpuset' controller mount-point                  : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'devices' controller mount-point                 : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for cgroup 'blkio' controller mount-point                   : PASS
  QEMU: Checking for device assignment IOMMU support                         : PASS
  QEMU: Checking if IOMMU is enabled by kernel                               : PASS
   LXC: Checking for Linux >= 2.6.26                                         : PASS
   LXC: Checking for namespace ipc                                           : PASS
   LXC: Checking for namespace mnt                                           : PASS
   LXC: Checking for namespace pid                                           : PASS
   LXC: Checking for namespace uts                                           : PASS
   LXC: Checking for namespace net                                           : PASS
   LXC: Checking for namespace user                                          : PASS
   LXC: Checking for cgroup 'memory' controller support                      : PASS
   LXC: Checking for cgroup 'memory' controller mount-point                  : PASS
   LXC: Checking for cgroup 'cpu' controller support                         : PASS
   LXC: Checking for cgroup 'cpu' controller mount-point                     : PASS
   LXC: Checking for cgroup 'cpuacct' controller support                     : PASS
   LXC: Checking for cgroup 'cpuacct' controller mount-point                 : PASS
   LXC: Checking for cgroup 'cpuset' controller support                      : PASS
   LXC: Checking for cgroup 'cpuset' controller mount-point                  : PASS
   LXC: Checking for cgroup 'devices' controller support                     : PASS
   LXC: Checking for cgroup 'devices' controller mount-point                 : PASS
   LXC: Checking for cgroup 'blkio' controller support                       : PASS
   LXC: Checking for cgroup 'blkio' controller mount-point                   : PASS
   LXC: Checking if device /sys/fs/fuse/connections exists                   : PASS

tomek@Pececik:/dev$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              16
On-line CPU(s) list: 0-15
Thread(s) per core:  2
Core(s) per socket:  8
Socket(s):           1
NUMA node(s):        1
Vendor ID:           AuthenticAMD
CPU family:          23
Model:               113
Model name:          AMD Ryzen 7 3700X 8-Core Processor
Stepping:            0
CPU MHz:             2199.647
CPU max MHz:         3600,0000
CPU min MHz:         2200,0000
BogoMIPS:            7200.08
Virtualization:      AMD-V
L1d cache:           32K
L1i cache:           32K
L2 cache:            512K
L3 cache:            16384K
NUMA node0 CPU(s):   0-15
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate sme ssbd mba sev ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca
Any help getting my rig to run 64-bit VMs would be greatly appreciated. :)

Re: Cannot install 64-bit guest VMs

Posted: 4. Dec 2019, 12:49
by mpack

Re: Cannot install 64-bit guest VMs

Posted: 4. Dec 2019, 12:53
by socratis
Disable KVM on the Host. KVM used to be able to run side-by-side with VirtualBox sharing the VT-x/AMD-V resources, but not anymore. Now KVM takes the exclusivity of the hardware virtualization capabilities from boot time, which leaves VirtualBox out in the cold. It's an "either/or" situation unfortunately...

Re: Cannot install 64-bit guest VMs

Posted: 4. Dec 2019, 17:49
by tomekz28
Than you Socratis,

I edited the /etc/modprobe.d/blacklist.conf adding

Code: Select all

blacklist kvm_amd
blacklist kvm-amd
blacklist kvm_intel
blacklist kvm
and run the

Code: Select all

sudo apt-get remove --purge qemu-kvm 
command. btw, shoudl I also remove the libvirt-bin ubuntu-vm-builder bridge-utils modules?

I rebooted, but it did not solve the issue. I cannot disable KVM in the BIOS settings.

Re: Cannot install 64-bit guest VMs

Posted: 5. Dec 2019, 15:25
by socratis
I don't know how to completely remove KVM, I don't deal with KVM primarily. Maybe you should check in their forums/channels?

Re: Cannot install 64-bit guest VMs

Posted: 5. Dec 2019, 16:14
by towo2099
There is no need to remove the kvm kernel modules nor for blacklisting them.
The only important thing is, not try to run a qemu vm at the same time as running vbox.

Re: Cannot install 64-bit guest VMs

Posted: 5. Dec 2019, 17:40
by mpack
Socratis seems to be implying above that KVM now grabs VT-x on startup, and being part of the kernel you don't explicitly need to launch a VM. Are you saying that is not the case? What versions are people assuming?

Re: Cannot install 64-bit guest VMs

Posted: 5. Dec 2019, 18:16
by towo2099
kvm grabs nothing, if it is only loaded.

See my picture here: https://i.imgur.com/g4lUtfj.png

And if qemu for example is running, then the device /dev/kvm is blocked, because in use:

Code: Select all

~
towo:Defiant> lsof /dev/kvm
COMMAND      PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
qemu-syst 394266 towo    9u   CHR 10,232      0t0  765 /dev/kvm
Then vbox can't start any 64bit vm. Maybe there is libvirt or virtmanager involved, i don't use that, so i can't say, if the running services are grabbing /dev/kvm, even there is no qemu vm running.

No 64bit guests on Ubuntu 64bit host despite HW-virtualization

Posted: 5. Dec 2019, 22:17
by Helig
Hi, I've read many posts in different forums on this kind of issue - anyway nothing seems to apply.

I'm running Ubuntu 18.04 on a Ryzen 5 2600 machine and want to create a Ubuntu 64bit guest in virtualbox.

uname -a shows:
Linux bunter 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Virtualbox version is 6.0.14 r133895 (Qt5.9.5)

From lscpu I understand hardware virtualization (AMD-V) is enabled.

Code: Select all

 
xxxxx:~$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              12
On-line CPU(s) list: 0-11
Thread(s) per core:  2
Core(s) per socket:  6
Socket(s):           1
NUMA node(s):        1
Vendor ID:           AuthenticAMD
CPU family:          23
Model:               8
Model name:          AMD Ryzen 5 2600 Six-Core Processor
Stepping:            2
CPU MHz:             1377.170
CPU max MHz:         3400.0000
CPU min MHz:         1550.0000
BogoMIPS:            6799.34
Virtualization:      AMD-V
L1d cache:           32K
L1i cache:           64K
L2 cache:            512K
L3 cache:            8192K
NUMA node0 CPU(s):   0-11
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
Anyway Virtualbox only offers 32bit guests in the "create virtual machine" dialog.

After creating a 32bit VM I check the settings and see "Invalid settings detected" -> Acceleration page ... hardware virtualization is enabled in the acceleration section of the system page although it is not supported by the host system ...

Actually "Enable VT-x/AMD-V" and "Enable Nested Paging" are enabled but I why should it not be supported by the host system? This appears wrong to me. What do I have to check next? I do not have the slightest idea which processes could "steal" the virtualization as suggested in some (windows host related) posts.

Best regards and thx for your support.

Re: No 64bit guests on Ubuntu 64bit host despite HW-virtualization

Posted: 5. Dec 2019, 22:25
by scottgus1
Not a Linux guy, but if "lscpu" is something like "list the CPU's capabilities", then it seems your CPU has AMD/V.

The BIOS also needs to enable it. Check your PC's BIOS to turn AMD/V on too.

Things like antivirus & debuggers can also take AMD/V. See I have a 64bit host, but can't install 64bit guests
Helig wrote:"Enable VT-x/AMD-V" and "Enable Nested Paging" are enabled
These are settings required by the guest OS chosen in the New Guest Template. These settings do not reflect what the host PC can do.

Re: No 64bit guests on Ubuntu 64bit host despite HW-virtualization

Posted: 6. Dec 2019, 04:14
by socratis
Helig wrote:From lscpu I understand hardware virtualization (AMD-V) is enabled.
scottgus1 wrote:if "lscpu" is something like "list the CPU's capabilities", then it seems your CPU has AMD/V.
Do not confuse "capability" with "availability". The fact that a CPU can use hardware virtualization, doesn't mean that the Host OS is in a state that can offer hardware virtualization.

I'm merging this thread with a really close one from yesterday, hoping to find common ground.

Re: Cannot install 64-bit guest VMs

Posted: 6. Dec 2019, 08:28
by towo2099
Since i've never seen a Ryzen system, where AMD-v is enabled by default in BIOS, i would really check that.
In Linux, not many things can block AMD-v, unlike Windows.

Re: Cannot install 64-bit guest VMs

Posted: 6. Dec 2019, 09:50
by socratis
towo2099 wrote:In Linux, not many things can block AMD-v, unlike Windows.
Even on Windows, there's only one single thing that can block AMD-V... Hyper-V! :)

(excluding the 0.1% of debuggers)

Re: Cannot install 64-bit guest VMs

Posted: 6. Dec 2019, 13:51
by tomekz28
Guys, thanks for all the feedback. Right now, I don't even have the /dev/kvm directory present, however still no ability to create 64 bit vms.

Code: Select all

tomek@Pececik:~$ lsof /dev/kvm
lsof: status error on /dev/kvm: No such file or directory
lsof 4.89
To clarify, I have run into two issues while trying to install and then remove/purge different versions of vbox:
  1. I either get no 64 bit choice when creating a VM (most of the time)
  2. or do I get the choice, but when I try to run for the first time and install the OS, I get the error, that virtualization is not enabled in BIOS. I have not been able to determine what makes it go to choice number one versus number two.
As to the BIOS settings, as I mentioned in the original post, I do get virtualization enabled in BIOS by default without the possibility to turn it off.

Edit:
Here's a link to my BIOS screenshot:
https://drive.google.com/file/d/1NR6tAl ... sp=sharing

Re: Cannot install 64-bit guest VMs

Posted: 6. Dec 2019, 13:54
by mpack
Until we see a VM log, this is all speculation.