我建立許多的Debian 7 KVM qemu的設置,我使用Debian 7只是爲了讓debian 8穩定下來,儘管它很快就會開始使用debian 8。
我認爲標準軟件包已經過時了很久,內核可用太舊了,我發現我有很多錯誤和凍結,並使其穩定在這裏是一個全新的安裝。確保你的IOMMU在BIOS中啓用,如果你有。注意我是在AMD 8核心機器上做的。
apt-get build-dep qemu
apt-get build-dep qemu
apt-get install git bc fakeroot kernel-package
apt-get install bc fakeroot kernel-package ca-certificates
獲得最新的內核和QEMU的混帳
cd /usr/src
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.8.tar.gz
tar -xzf linux-3.19.8.tar.gz
git clone git://git.qemu-project.org/qemu.git
cd linux-3.19.8
make oldconfig
make menuconfig
現在啓用內核,這將使的部分KVM工作最好
Virtualization
(CONFIG_VIRTUALIZATION=y)
Virtualization > Kernel-based Virtual Machine (KVM) Support
(CONFIG_KVM=y)
Virtualization > KVM for <whichever processor you have>
(CONFIG_KVM_INTEL=y and/or CONFIG_KVM_AMD=y)
你可以編譯成模塊[M]:
Virtualization > Host kernel accelerator for virtio net
(CONFIG_VHOST_NET=m)
Device Drivers > Virtio drivers > PCI driver for virtio devices
(CONFIG_VIRTIO_PCI=m)
Device Drivers > Virtio drivers > Virtio balloon driver
(CONFIG_VIRTIO_BALLOON=m)
Processor Type and Features > Preemption Model > Preemptible Kernel (Low Latency Desktop)
(CONFIG_PREEMPT=y)
Processor Type and Features > Timer Frequency > 1000 Hz
(CONFIG_HZ_1000=y)
當你完成讓Debian軟件包
make-kpkg --initrd --append-to-version=kvm.1 kernel_image kernel_headers
cd ..
dpkg -i linux-headers-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb linux-image-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb
然後安裝當然
dpkg -i linux-headers-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb linux-image-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb
重啓和檢查,如果你是在新內核
uname -r
3.19.8kvm.1
現在讓我們來加載git的零件和獲得本次車展馬路..
git submodule update --init dtc
cd /usr/src/qemu
./configure --enable-kvm && make && make install
和Libvirt庫然後檢查古都DEP以防萬一
apt-get install libvirt-bin build-dep qemu
/etc/init.d/libvirt-bin restart
請務必設置您的網絡設備(S)的橋
nano /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
##main onboard port0
auto eth0
iface eth0 inet manual
auto br0
#iface br0 inet dhcp
# bridge_ports eth0
# bridge_stp off
# bridge_fd 0
# bridge_maxwait 0
iface br0 inet static
address 10.0.0.241
network 10.0.0.0
netmask 255.255.255.0
broadcast 10.0.0.255
gateway 10.0.0.254
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
bridge_stp off # disable Spanning Tree Protocol
bridge_fd 0 # no forwarding delay
這裏有一些命令,這可能有助於
brctl show
brctl showmacs br0
東西th在幫助(注意這樣做了我的頭很可能錯過了一些東西 就像一個反向移植回購
nano /etc/apt/sources.list
deb http://http.debian.net/debian wheezy-backports main
apt-get update;apt-get install qemu-guest-agent
我希望這可以幫助別人。藉助Debian 8,可以更好地支持支持kvm qemu的較新內核功能,以實現更好的優化。