KVM vmbuilder 失敗

KVM vmbuilder 失敗

我全新安裝了 16.04,並且安裝了 kvm。我正在嘗試使用 vmbuilder 建立虛擬機器。

sudo vmbuilder kvm ubuntu --suite xenial --flavour virtual --arch i386 -o --libvirt qemu:///system --ip 10.0.0.80 --hostname sabsickvm --bridge br0

當我在沒有顯示虛擬機器後運行 virsh list 時

當一切「結束」時我明白了

Errors were encountered while processing:
sudo
Extracting templates from packages: 100%
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

為force-confnew 設定 dpkg 選項也似乎可以運作:

patch /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.py<<EOT
@@ -72,7 +72,7 @@
             self.call_hook('fix_ownership', manifest)

     def update(self):
-        self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',
+        self.run_in_target('apt-get', '-y', '--force-yes', '--option=Dpkg::Options::=--force-confnew', 'dist-upgrade',
                            env={ 'DEBIAN_FRONTEND' : 'noninteractive' })

     def install_authorized_keys(self):
EOT

答案2

我現在遇到了同樣的問題,使用 1 週前(2016 年 9 月 28 日)的相同設置,當時沒有錯誤。我的安裝幾乎與操作相同,但我使用的是 amd64。

我提供了我用作創可貼的解決方案,直到修復了潛在的錯誤。

解決方案:

1. change the word 'dist-upgrade' to 'update' in
    /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.py

 2. delete /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.pyc

現在重新運行 vmbuilder。我仍然遇到一些錯誤/警告,但它構建得很好。

認識到這並沒有解決根本問題,但它確實讓您現在可以使用:vmbuilder with 16.04。

相關內容