how to tell if you can use kvm

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

 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

 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

sudo apt-get install kvm qemu

Load the modules

sudo modprobe kvm

Load Intel module

If you have an Intel CPU

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.

$ sudo modprobe kvm-intel
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:-

 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

sudo modprobe kvm-amd

Add yourself to the group

sudo addgroup `whoami` kvm

Create a KVM disk image

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

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

Start the emulator

For example:-

 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

kvm
kvm-intel

or

kvm
kvm-amd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值