2016-05-15 90 views
1

我試圖啓動客人操作系統繼續我的工作,但我有我的virsh安裝問題。 下面是安裝腳本的一部分:KVM客戶操作系統啓動錯誤

qemu-img create -f qcow2 -o preallocation=metadata ~/images/${vm_name}.qcow2 ${pool_size}G 

# create dir for images 
mkdir ~/images/ 

virt-install \ 
--connect qemu:///system \ 
--name $vm_name \ 
--ram 10240 \ 
--vcpus 4 \ 
--disk ~/images/${vm_name}.qcow2,size=$pool_size,bus=virtio,sparse=false,format=qcow2 \ 
--network network=default,model=virtio \ 
--location http://ua.archive.ubuntu.com/dists/trusty-updates/main/installer-amd64/ \ 
--initrd-inject=$current_dir/preseed.cfg \ 
--extra-args="file=file:/preseed.cfg vga=788 quiet console=tty0 utf8 console=ttyS0,115200" \ 
--os-type=linux \ 
--virt-type kvm \ 
--video=vga \ 
--noreboot \ 
--cpu host \ 
--hvm 

virsh start $vm_name 
echo "----------Login to console----------" 
virsh console $vm_name 

當我試着去運行該腳本喜歡./script.sh它產生一個錯誤文件:

Formatting '/home/{username}/images/test.qcow2', fmt=qcow2 size=53687091200 encryption=off cluster_size=65536 preallocation='metadata' lazy_refcounts=off refcount_bits=16 
mkdir: cannot create directory '/home/flash/images/': File exists 
ERROR 'DebianDistro' object has no attribute '_prefix' 
error: failed to get domain 'test' 
error: Domain not found: no domain with matching name 'test' 

----------Login to console---------- 
error: failed to get domain 'test' 
error: Domain not found: no domain with matching name 'test' 

我曾嘗試重新安裝已KVM qemu包使用本指南 - https://help.ubuntu.com/community/KVM/Installation 和一切都成功完成。 我相信,腳本將工作文件,因爲我以前在其他機器上使用它沒有任何問題。

闖闖: 使用下面

virt-install --connect qemu:///system -n test -r 10240 \ 
--vcpus=4 \ 
--disk path=/data0/images/test.img,size=50,format=qcow2,bus=virtio,cache=none \ 
--cdrom /home/{username}/Downloads/kvm/ubuntu-14.iso \ 
--vnc \ 
--os-type=linux \ 
--accelerate \ 
--network network=default \ 
--hvm 

該腳本產生一個錯誤:

ERROR internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied 
failed to initialize KVM: Permission denied 

此外,當我試圖列出所有操作系統的變體通過的virt-安裝--oS變列出它無法識別此命令並嘗試啓動guest虛擬機操作系統而不是列出變體。

你能幫我找出這裏有什麼問題嗎?

回答

2

要修正這個錯誤:

ERROR 'DebianDistro' object has no attribute '_prefix' 

編輯文件/usr/share/virt-manager/virtinst/urlfetcher.py和線1034更改此:

if self._prefix: 

這樣:

if self._url_prefix: 

的Ubuntu 14.04。

相關問題