next up previous contents
Next: Nested KVM Up: 管理 KVM 虛擬機 Previous: 虛擬機還原   Contents

問題與解決

  1. 問題一:virt-install 安裝虛擬機時出現以下錯誤訊息:
    ERROR    internal error Process exited while reading console log output:\
     char device redirected to /dev/pts/8 open /dev/kvm: Permission denied
    
  2. 解決方式:
    1. 重新載入 kvm_intelkvm 模組,重點是將 /dev/kvm 的群組改為 kvm。
      [root@dywH ~]# rmmod kvm_intel
      [root@dywH ~]# rmmod kvm
      [root@dywH ~]# modprobe kvm
      [root@dywH ~]# modprobe kvm_intel
      [root@dywH ~]# chown root:kvm /dev/kvm
      
    2. 如果重開機後還是出現同樣的問題,查看 /dev/kvm 開機後群組還是 root。
      [root@dywH ~]# ll /dev/kvm
      crw-rw----+ 1 root root 10, 232 Aug 27 06:23 /dev/kvm
      
    3. 原因為 /etc/udev/rules.d/80-kvm.rules 不存在,編輯此檔。
      [root@dywH ~]# vim /etc/udev/rules.d/80-kvm.rules
      [root@dywH ~]# cat /etc/udev/rules.d/80-kvm.rules
      KERNEL=="kvm", GROUP="kvm", MODE="0666"
      
    4. 不必重開機,重新驅動 udev。
      [root@dywH ~]# udevadm trigger
      
    5. 再查看 /dev/kvm,群組已改為 kvm。
      [root@dywH ~]# ll /dev/kvm
      crw-rw-rw-+ 1 root kvm 10, 232 Aug 27 06:33 /dev/kvm
      
    6. /etc/udev/rules.d/80-kvm.rules 屬於 qemu-kvm-rhev。
      [root@dywH ~]# rpm -qf /etc/udev/rules.d/80-kvm.rules 
      qemu-kvm-rhev-0.12.1.2-2.355.el6_4.9.x86_64
      
    7. 重新安裝 qemu-kvm-rhev 套件。
      [root@dywH ~]# yum reinstall qemu-kvm-rhev
      
  3. 問題二:virt-install 安裝虛擬機時出現以下錯誤訊息:
    ** (anaconda:778): WARNING **: Could not open X display
    An unknown error has occured, look at the /tmp/anaconda-tb* file(s) for more details
    
    ===============================================================================
    An unknown error has occurred
    ===============================================================================
    anaconda 19.31.14-1 exception report
    Traceback (most recent call first):
      File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/tui/hubs/summary.py", line 60, in prompt
        raise RuntimeError(errtxt)
      File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/tui/simpleline/base.py", line 345, in _mainloop
        prompt = last_screen.prompt(self._screens[-1][1])
    RuntimeError: Can't have a question in command line mode!
    
    What do you want to do now?
    1) Report Bug
    2) Debug
    3) Quit
    
    Please make your choice from above: Something went wrong (tm)
    Cannot continue. Aborting.
    
  4. 原因為 undefine 虛擬機 domain 時沒有一併刪除 image 檔,解決方式:
    [root@dywH ~]# rm /var/lib/libvirt/images/kvm5usb.qcow2
    
  5. 問題三:虛擬機新增網卡後 DHCP 自動取得 IP,造成 SSH 連續操作鍵盤輸入停頓。
    [root@dywH ~]# virsh domiflist kvm7usb
    Interface  Type       Source     Model       MAC
    -------------------------------------------------------
    vnet3      network    default    virtio      52:54:00:22:bd:ce
    vnet4      network    default    virtio      52:54:00:00:00:71
    vnet5      network    default    virtio      52:54:00:00:00:72
    
  6. 解決方式:刪除不用的 connections。
    [root@dywH ~]# ssh kvm7.deyu.wang
    root@kvm7.deyu.wang's password: 
    Last login: Sun Aug 30 21:05:41 2015 from deyu.wang
    [root@kvm7 ~]# nmcli connection 
    NAME                UUID                                  TYPE            DEVICE 
    Wired connection 1  c1434cae-fd3c-48d8-b070-535c6356e7ba  802-3-ethernet  eth1   
    eth0                4742279b-e673-4072-89ac-7d11ea2a86c6  802-3-ethernet  eth0   
    Wired connection 2  4b79d058-6f0f-44b8-942f-491134c69eb1  802-3-ethernet  eth2   
    [root@kvm7 ~]# nmcli connection delete Wired\ connection\ 1
    [root@kvm7 ~]# nmcli connection delete Wired\ connection\ 2
    [root@kvm7 ~]# nmcli connection show 
    NAME  UUID                                  TYPE            DEVICE 
    eth0  a197ddb1-25a7-4c87-9a4a-03b3e51eb86e  802-3-ethernet  eth0
    


2018-04-25