Kvm-Virtualization

嘗試在 virt-manager 中創建或打開 VM 時出現錯誤“libosinfo: Unexpected file type (0)”

  • May 6, 2021

在 virt-manager 中點擊“打開”或“創建新虛擬機”時出現以下錯誤:

Error launching details: libosinfo: Unexpected file type (0)

Traceback (most recent call last):
 File "/usr/share/virt-manager/virtManager/vmwindow.py", line 39, in get_instance
   cls._instances[key] = vmmVMWindow(vm)
 File "/usr/share/virt-manager/virtManager/vmwindow.py", line 76, in __init__
   self._details = vmmDetails(self.vm, self.builder, self.topwin,
 File "/usr/share/virt-manager/virtManager/details/details.py", line 447, in __init__
   self.init_details()
 File "/usr/share/virt-manager/virtManager/details/details.py", line 774, in init_details
   self._os_list = vmmOSList()
 File "/usr/share/virt-manager/virtManager/oslist.py", line 39, in __init__
   self._init_state()
 File "/usr/share/virt-manager/virtManager/oslist.py", line 55, in _init_state
   all_os = virtinst.OSDB.list_os()
 File "/usr/share/virt-manager/virtinst/osdict.py", line 274, in list_os
   for name, osobj in self._all_variants.items():
 File "/usr/share/virt-manager/virtinst/osdict.py", line 198, in _all_variants
   loader = self._os_loader
 File "/usr/share/virt-manager/virtinst/osdict.py", line 190, in _os_loader
   loader.process_default_path()
gi.repository.GLib.GError: libosinfo: Unexpected file type (0)

這是在我從 Ubuntu 18.04 升級到 Ubuntu 20.04 之後開​​始的。

我怎樣才能擺脫這個錯誤?

有完全相同的問題。“~/.config”的權限錯誤。將所有者設置為“使用者:使用者”並且錯誤消失了……您可以通過執行“virt-manager –debug”來查看是否存在權限被拒絕錯誤

引用自:https://serverfault.com/questions/1054288