2016-02-12 212 views
1

我正在嘗試在Debian 7.7上運行核心(TM)i5-4402E CPU @ 1.6 GHz的KVM虛擬化,具體步驟如下:步驟here無法安裝kvm - 依賴於qemu-kvm

試圖apt-get install kvm qemu-kvm libvirt-bin virtinst後,我得到了

The following packages have unmet dependencies: 
qemu-kvm : Conflicts: kvm 
E: Unable to correct problems, you have held broken packages. 

然後我嘗試安裝逐一和管理的成功除了KVM安裝所有的人。

apt-get install kvm,我得到下面的輸出:

The following packages have unmet dependencies: 
kvm : Depends: qemu-kvm but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

我已經跟着this線程,但這些建議都沒有爲我工作。我也試着

apt-get clean apt-get update apt-get upgrade apt-get install -f

沒有成功。

回答

0

1)。查存儲庫:

###### Ubuntu Main Repos 
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 

###### Ubuntu Update Repos 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 

2)卸下襬臂kvm

apt-get remove --purge libvirt-bin kvm qemu-kvm libvirt-bin virtinst 

3).Install

apt-get install kvm qemu-kvm libvirt-bin virtinst 
0

我建立許多的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的較新內核功能,以實現更好的優化。