构建虚拟机时出错

构建虚拟机时出错

我的系统:

#uname -a
Linux hostname 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

我正在尝试构建一个虚拟机(https://help.ubuntu.com/community/KVM/CreateGuests)使用以下命令:

#ubuntu-vm-builder kvm trusty --libvirt qemu:///system

但最终它失败并出现以下错误:

Unpacking linux-image-virtual (3.13.0.58.65) ...
, stderr: grep: /proc/cpuinfo: No such file or directory
**This kernel does not support a non-PAE CPU.**
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-58-generic_3.13.0-58.97_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-58-generic /boot/vmlinuz-3.13.0-58-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-58-generic /boot/vmlinuz-3.13.0-58-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.13.0-58-generic_3.13.0-58.97_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

看起来我确实有一个 PAE CPU......

 #grep -i PAE /proc/cpuinfo
 flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36

我想在此服务器上构建和托管 KVM VM。我做错了什么?

更新:我正在使用 --addpkg linux-image-generic 进行测试

答案1

在 python-vm-builder 中查找 dapper.py

dpkg -L python-vm-builder | grep 'dapper.py$'

打开它并找到 install_kernel 函数。修改如下:

def install_kernel(self, destdir):
    try:
        self.run_in_target('mount', '-t', 'proc', 'proc', '/proc')
        run_cmd('chroot', destdir, 'apt-get', '--force-yes', '-y', 'install', self.kernel_name(), env={ 'DEBIAN_FRONTEND' : 'noninteractive' })
    finally:
        self.run_in_target('umount', '/proc')

另请参阅:

由于内核 pae 检测失败,vmbuilder 在 Quantal 上完全失败

答案2

解决方案是添加参数:

   --addpkg linux-image-generic

相关内容