how to tell if you can use kvm

素颜马尾好姑娘i 2022-05-21 23:06 261阅读 0赞

kvm

Check out https://help.ubuntu.com/community/KVM for more updated and complete information on installing KVM on Ubuntu.

kvm is qemu plus some great kernel level stuff for VT enabled CPUs.

Some rough notes:-

How to tell if you can use kvm

Intel CPU

  1. grep vmx /proc/cpuinfo

However, if you have an Intel CPU it’s possible that your computer manufacturer may have turned off VT in the BIOS. See below for more info.

AMD CPU

  1. grep svm /proc/cpuinfo

On some Gigabyte motherboards it is turned off in the BIOS if you use “Load safe defaults” (GiBy M61SME-S2 nF405 RLVSM bios < F7)

If you see something you have it, if you don’t you don’t.

Install it

  1. sudo apt-get install kvm qemu

Load the modules

  1. sudo modprobe kvm

Load Intel module

If you have an Intel CPU

  1. sudo modprobe kvm-intel

Note if you get this when you load the module then it may mean VT is switched off in the BIOS.

  1. $ sudo modprobe kvm-intel
  2. FATAL: Error inserting kvm_intel (/lib/modules/2.6.20-15-generic/kernel/drivers/kvm/kvm-intel.ko): Operation not supported

Typing dmesg you may find the following at the end:-

  1. kvm: disabled by bios






  • IconsPage/IconTip.png You might need to enable the virtualization setting in the BIOS. Each BIOS is different and it can be difficult to find (it may be in the “Advanced” section or under “CPU” or “Security”). You may also need to power shutdown for the changes to take effect (some bios will do this automatically).

Load AMD module

If you have an AMD CPU

  1. sudo modprobe kvm-amd

Add yourself to the group

  1. sudo addgroup `whoami` kvm

Create a KVM disk image

This example makes a virtual disk that grows on the fly:

  1. qemu-img create -f qcow2 virtualdisk.img 10G

Start the emulator

For example:-

  1. kvm -hda virtualdisk.img -cdrom cdrom.iso -m 256 -net nic -net user -soundhw all

Load the modules more permanently

Once you know it all works, edit /etc/modules and add the following two lines

  1. kvm
  2. kvm-intel

or

  1. kvm
  2. kvm-amd

发表评论

表情:
评论列表 (有 0 条评论,261人围观)

还没有评论,来说两句吧...

相关阅读

    相关 how to use kvm

    kvm 是qemu 集成了一些針對開啟了VT技術的cpu而開發的不錯的內核級程式. 下面是一些簡要的說明:- <table style="border:1px solid