2

我正在尝试使用 CRC 在我的笔记本电脑(Ubuntu 20)上测试 Openshift 4。CRC 1.17 版不支持 Virtualbox 虚拟化,因此请按照设置说明进行操作

https://access.redhat.com/documentation/en-us/red_hat_codeready_containers/1.17/html/getting_started_guide/installation_gsg

我正在使用 libvirt,但是当我使用crc start它启动集群时,会出现以下错误

INFO Checking if oc binary is cached              
INFO Checking if podman remote binary is cached   
INFO Checking if goodhosts binary is cached       
INFO Checking minimum RAM requirements            
INFO Checking if running as non-root              
INFO Checking if Virtualization is enabled        
INFO Checking if KVM is enabled                   
INFO Checking if libvirt is installed             
INFO Checking if user is part of libvirt group    
INFO Checking if libvirt daemon is running        
INFO Checking if a supported libvirt version is installed 
INFO Checking if crc-driver-libvirt is installed  
INFO Checking if libvirt 'crc' network is available 
INFO Checking if libvirt 'crc' network is active  
INFO Checking if NetworkManager is installed      
INFO Checking if NetworkManager service is running 
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists 
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists 
INFO Starting CodeReady Containers VM for OpenShift 4.5.14... 
ERRO Error starting stopped VM: virError(Code=55, Domain=18, Message='Requested operation is not valid: format of backing image '/home/claudiomerli/.crc/cache/crc_libvirt_4.5.14/crc.qcow2' of image '/home/claudiomerli/.crc/machines/crc/crc.qcow2' was not specified in the image metadata (See https://libvirt.org/kbase/backing_chains.html for troubleshooting)') 
Error starting stopped VM: virError(Code=55, Domain=18, Message='Requested operation is not valid: format of backing image '/home/claudiomerli/.crc/cache/crc_libvirt_4.5.14/crc.qcow2' of image '/home/claudiomerli/.crc/machines/crc/crc.qcow2' was not specified in the image metadata (See https://libvirt.org/kbase/backing_chains.html for troubleshooting)')

我没有使用 libvirt 的经验,所以我被困在上面,在网上我什么也没找到……谢谢

4

1 回答 1

2

crc_libvirt_4.5.14 映像存在问题。修复它的最简单方法是执行

qemu-img rebase -f qcow2 -F qcow2 -b /home/${USER}/.crc/cache/crc_libvirt_4.5.14/crc.qcow2 /home/${USER}/.crc/machines/crc/crc.qcow2

现在,如果您尝试执行crc start,您将面临与 Apparmor 相关的“权限被拒绝”错误,除非您将主目录列入白名单。如果您不想修改 Apparmor 设置,则/var/lib/libvirt/images应该将其列入白名单。将图像移动到那里:

sudo mv /home/${USER}/.crc/machines/crc/crc.qcow2 /var/lib/libvirt/images

然后编辑指向新映像位置的虚拟机设置:virsh edit crc,然后将 替换 <source file='/home/yourusername/.crc/machines/crc/crc.qcow2'/><source file='/var/lib/libvirt/images/crc.qcow2'/>

然后做crc start和......就是这样。

相关的 Github 问题如下:

于 2020-10-20T20:46:22.347 回答