Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] There is no /dev/kvm directory for QEMU installing?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Dec 20, 2017 9:32 pm    Post subject: [SOLVED] There is no /dev/kvm directory for QEMU installing? Reply with quote

I am trying to install QEMU according this wiki: https://wiki.gentoo.org/wiki/QEMU
I followed wiki and did all needed kernel config's changes, but there is no /dev/kvm directory
Please inform if need to create this directory manually or any other advise?

BTW: Portage warning about this mistake in wiki regarding editing package.use with: qemu_softmmu_targets_m68k qemu_user_targets_x86_64
So I followed the first suggestion by editing make.conf
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”


Last edited by pmam on Sat Dec 23, 2017 4:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42850
Location: 56N 3W

PostPosted: Wed Dec 20, 2017 10:57 pm    Post subject: Reply with quote

pmam,

The contends of /dev are created by the kernel. Thats what the DEVTMPFS option does.
/dev is also a RAM filesystem so it does not persist across reboots.

If you don't have /dev/kvm, either you have one or more kernel options missing or you are not running the kernel you think you are.
What does
Code:
uname -a
say?

The date and time shown there is the build time of the running kernel.
Code:
 $ uname -a
Linux NeddySeagoon_Static 4.15.0-rc4 #4 SMP PREEMPT Tue Dec 19 19:25:32 GMT 2017 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux


A popular case is forgetting to mount /boot for the kernel install.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13611

PostPosted: Thu Dec 21, 2017 2:02 am    Post subject: Reply with quote

As a minor point, when this works correctly, /dev/kvm is not a directory; it is a character device. Its permissions should be root:kvm 660, so that only root or users in the kvm group can use this service.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Dec 21, 2017 8:48 am    Post subject: Reply with quote

I am aware of wrong kernel's rev... and looks this kernel is ok:
Code:
uname -a
Linux new-host.home 4.12.12-gentoo #1 SMP Wed Dec 20 22:22:44 IST 2017 x86_64 Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz GenuineIntel GNU/Linux

I am quite new with genkernel and not sure all configurations are taking place -
Please inform how to print menuconfig and verify if all kvm parameters are according wiki?
Here from /etc/genkernel.conf some settings -
BTW: MENUCONFIG="no" is ok or need to change to "yes" in order to "Using previous kernel configuration while changing the sources"?
Code:
# Configuration file for genkernel

# This file is sourced by genkernel at startup and determines which options
# we will be using to compile our kernel.  The order of precidence is simple,
# with the internal settings being least important, configuration file
# settings next, and command line options being most important.

# =========Common Command Line Option Defaults=========

# Should we install to $BOOTDIR?  Default is "no" because genkernel is used in
# catalyst and stage building.
#INSTALL="yes"

# Run 'make oldconfig' before compiling this kernel?
OLDCONFIG="yes"

# Run 'make menuconfig' before compiling this kernel?
MENUCONFIG="no"

# Run 'make nconfig' (ncurses 'menuconfig') before compiling this kernel?
NCONFIG="no"

# Note, that two previous lines are mutual exclusive (logically), while
# MENUCONFIG has a higher priority if both them is enabled.

# Run 'make clean' before compilation?
# If set to NO, implies MRPROPER WILL NOT be run
# Also, if clean is NO, it won't copy over any configuration
# file, it will use what's there.
CLEAN="yes"

# Run 'make mrproper' before configuration/compilation?
MRPROPER="yes"

# Override the arch detection?
#ARCH_OVERRIDE="x86"

# Mount BOOTDIR automatically if it isn't mounted?
MOUNTBOOT="yes"

# Make symlinks in BOOTDIR automatically?
#SYMLINK="no"

# Save the new configuration in /etc/kernels upon
# successfull compilation
SAVE_CONFIG="yes"

# Use Color output in Genkernel?
USECOLOR="yes"

_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42850
Location: 56N 3W

PostPosted: Thu Dec 21, 2017 10:07 am    Post subject: Reply with quote

pmam,

Heres my KVM settings

Code:
$ grep KVM /usr/src//linux/.config
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_KVM=y
CONFIG_KVM_AMD=y
ignore all the ones with _HAVE_, you can't change them.
If you have an Intel CPU, you will need CONFIG_KVM_INTEL=y

Genkernel always uses the same preset .config file every time its run. If you want to make changes, you need to run genkernel with the -menuconfig option.
Your changes will be forgotten by the next run.
You can save your changed .config file and tell genkernel to use it next time but other that knowing its possible, I've never done it as I don't use Genkernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Dec 21, 2017 11:53 am    Post subject: Reply with quote

Here mine - looks all kvm settings are ok so dont know why there is no /dev/kvm?
Code:
grep KVM /usr/src//linux/.config
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_KVM=y
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_MMU_AUDIT=y

I allways use this command:
Code:
genkernel --menuconfig all

Please inform how to verify if all kvm modules are actually loaded? I tried with lsmod but there is no kvm module...

Next installation I will not choose genkernel - It saves some time in the beginning,
however, each kernel's compilation takes very long time, and I dont use to configuration and settings it.
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1785
Location: Oranienburg/Germany

PostPosted: Thu Dec 21, 2017 1:01 pm    Post subject: Reply with quote

Hi,

Please post your output of
Code:

lsmod | grep kvm


if you dont have /dev/kvm, usually the module is not loaded as needed.

greets, bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Dec 21, 2017 1:14 pm    Post subject: Reply with quote

Code:
lsmod | grep kvm

There is no output of this command...
If it means that kvm module is not loaded, thus my kernel's settings do not compile into kernel...
Do not know how to update genkernel with the kvm's changes?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Dec 21, 2017 7:35 pm    Post subject: Reply with quote

Dont know why my menuconfig changes are not updating genkernel...
I found that symlink=no by default in /etc/genkernel.conf - Is it needed and should change to "yes"?
Code:
# Make symlinks in BOOTDIR automatically?
#SYMLINK="no"

_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42850
Location: 56N 3W

PostPosted: Thu Dec 21, 2017 8:14 pm    Post subject: Reply with quote

pmam,

Code:
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m


You will need to modprobe one of those ... whichever matches your CPU
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Dec 21, 2017 9:13 pm    Post subject: Reply with quote

I found in this directory: /lib/modules/4.12.12-gentoo/kernel/arch/x86/kvm/ two files:
Code:
kvm # ls -l
total 428
-rw-r--r-- 1 root root 104968 Dec 21 17:07 kvm-amd.ko
-rw-r--r-- 1 root root 329208 Dec 21 17:07 kvm-intel.ko

But I am not sure how to write the modprobe command? The following command gives an I/O error:
Code:
modprobe kvm-intel
modprobe: ERROR: could not insert 'kvm_intel': Input/output error

Other options give Fatal like:
Code:
modprobe kvm-intel.ko
modprobe: FATAL: Module kvm-intel.ko not found in directory /lib/modules/4.12.12-gentoo

_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1785
Location: Oranienburg/Germany

PostPosted: Fri Dec 22, 2017 8:20 am    Post subject: Reply with quote

Can you try "modprobe -v kvm-intel" please? And please post the output of "grep vmx /proc/cpuinfo" please.

Maybe you forgot to enable VT-x in the BIOS. ;)

greets, bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Dec 22, 2017 9:35 am    Post subject: Reply with quote

Quote:
Maybe you forgot to enable VT-x in the BIOS. ;)

It is ok... :)
Code:
modprobe -v kvm-intel
insmod /lib/modules/4.12.12-gentoo/kernel/arch/x86/kvm/kvm-intel.ko
modprobe: ERROR: could not insert 'kvm_intel': Input/output error

Code:
grep vmx /proc/cpuinfo
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow dtherm
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow dtherm

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42850
Location: 56N 3W

PostPosted: Fri Dec 22, 2017 6:19 pm    Post subject: Reply with quote

pmam,

Code:
Input/output error
indicates that there is a fundamental problem reading the hard drive.
Provoke that error again then post the end of dmesg so we can see what the problem is.

Whatever, the file kvm-intel.ko cannot be read for some reason.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
papas
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2014
Posts: 75
Location: Athens

PostPosted: Sat Dec 23, 2017 7:37 am    Post subject: Reply with quote

Good morning,
you can find informations about how this behaviour starts here:
https://patchwork.kernel.org/patch/9646589/
also you can find the solution (patch) for the 4.12.12 kernel, here:
https://patchwork.kernel.org/patch/10043403/
and
https://patchwork.kernel.org/patch/10043407/
OR
you can just install the 4.14.* kernel, works fine.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sat Dec 23, 2017 9:05 am    Post subject: Reply with quote

Neddy,

Here what I think the error after trying to load kvm module - but according papas advise it seems a known issue of old Intel Core2 machines..
Code:
[  115.610540] gnome-session-f[2333]: segfault at 0 ip 00007f85d3e74689 sp 00007ffd5ed1a600 error 4 in libgtk-3.so.0.2200.16[7f85d3b91000+6f4000]


papas,

I have some relief informed by your response that it is a known issue...
I am not familiar with patch adding - do not know how and where to add it -
so think it is better to wait for kernel 4.14, or - can I install it even it is not stable?

Thanks a lot
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
papas
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2014
Posts: 75
Location: Athens

PostPosted: Sat Dec 23, 2017 9:18 am    Post subject: Reply with quote

I think 4.14.8-r1 is stable try --sync your system...
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sat Dec 23, 2017 4:09 pm    Post subject: Reply with quote

Quote:
I think 4.14.8-r1 is stable try --sync your system...

You are right, it's stable and I installed it and now have /dev/kvm..
At the moment I am updating the system and hpe emulator will work ok

Thanks :)
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum