crc: Cannot access backing file 'crc.qcow2'; Permission denied
CRC v 1.20 doesn’t start, fails with error:
(crc) Failed to start: virError(Code=38, Domain=18, Message='Cannot access backing file '/home/crcuser/.crc/cache/crc_libvirt_4.6.6/crc.qcow2' of storage file '/home/crcuser/.crc/machines/crc/crc.qcow2' (as uid:107, gid:107): Permission denied')
when reverting back to crc v1.17 , works fine.
- OS: Linux
- Hypervisor: KVM
- Did you run
crc setupbefore starting it (Yes/No)? yes
CRC version
# Put the output of `crc version`
[crcuser@zzxr7601 ~]$ crc version
CodeReady Containers version: 1.20.0+ef3f80d
OpenShift version: 4.6.6 (embedded in executable)
CRC status
# Put the output of `crc status`
[crcuser@zzxr7601 ~]$ crc status
CRC VM: Stopped
OpenShift: Stopped
Disk Usage: 0B of 0B (Inside the CRC VM)
Cache Usage: 13.69GB
Cache Directory: /home/crcuser/.crc/cache
## CRC config
```bash
# Put the output of `crc config view`
[crcuser@zzxr7601 ~]$ crc config view
- cpus : 16
- memory : 24576
- pull-secret-file : /home/crcuser/crc-pull-secret.txt
## Host Operating System
```bash
"Red Hat Enterprise Linux Server"
"VERSION="7.9 (Maipo)"
Steps to reproduce
- crc setup
- crc start
Expected
crc to start and running
Actual
(crc) Failed to start: virError(Code=38, Domain=18, Message='Cannot access backing file '/home/crcuser/.crc/cache/crc_libvirt_4.6.6/crc.qcow2' of storage file '/home/crcuser/.crc/machines/crc/crc.qcow2' (as uid:107, gid:107): Permission denied')
Logs
[crcuser@zzxr7601 ~]$ crc start
Changes to configuration property 'cpus' are only applied when the CRC instance is started.
If you already have a running CRC instance, then for this configuration change to take effect, stop the CRC instance with 'crc stop' and restart it with 'crc start'.
Changes to configuration property 'memory' are only applied when the CRC instance is started.
If you already have a running CRC instance, then for this configuration change to take effect, stop the CRC instance with 'crc stop' and restart it with 'crc start'.
Successfully configured pull-secret-file to /home/crcuser/crc-pull-secret.txt
DEBU CodeReady Containers version: 1.20.0+ef3f80d
DEBU OpenShift version: 4.6.6 (embedded in executable)
DEBU Couldn't set key CPE_NAME, no corresponding struct field found
DEBU Couldn't set key , no corresponding struct field found
DEBU Couldn't set key REDHAT_BUGZILLA_PRODUCT, no corresponding struct field found
DEBU Couldn't set key REDHAT_BUGZILLA_PRODUCT_VERSION, no corresponding struct field found
DEBU Couldn't set key REDHAT_SUPPORT_PRODUCT, no corresponding struct field found
DEBU Couldn't set key REDHAT_SUPPORT_PRODUCT_VERSION, no corresponding struct field found
INFO Checking if podman remote executable is cached
DEBU Currently podman remote is not supported
INFO Checking if goodhosts executable is cached
DEBU goodhost executable is not cached
INFO Caching goodhosts executable
DEBU Trying to extract goodhosts from crc executable
DEBU Extracting embedded 'goodhosts-cli-linux-amd64.tar.xz' from /usr/bin/crc to /tmp/crc211482787/goodhosts-cli-linux-amd64.tar.xz
DEBU Uncompressing /tmp/crc211482787/goodhosts-cli-linux-amd64.tar.xz to /tmp/crc211482787
DEBU Copying '/tmp/crc211482787/goodhosts' to '/home/crcuser/.crc/bin/goodhosts'
DEBU goodhost executable cached
DEBU Making /home/crcuser/.crc/bin/goodhosts suid
INFO Will use root access: change ownership of /home/crcuser/.crc/bin/goodhosts
DEBU Running '/usr/bin/sudo chown root /home/crcuser/.crc/bin/goodhosts'
INFO Will use root access: set suid for /home/crcuser/.crc/bin/goodhosts
DEBU Running '/usr/bin/sudo chmod u+s,g+x /home/crcuser/.crc/bin/goodhosts'
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
DEBU stat /home/crcuser/.crc/cache/crc_libvirt_4.6.6.crcbundle: no such file or directory
INFO Extracting bundle from the CRC executable
DEBU Error changing /home/crcuser/.crc/cache permissions to 0775
DEBU Extracting embedded 'crc_libvirt_4.6.6.crcbundle' from /usr/bin/crc to /home/crcuser/.crc/cache/crc_libvirt_4.6.6.crcbundle
DEBU Uncompressing /home/crcuser/.crc/cache/crc_libvirt_4.6.6.crcbundle to /home/crcuser/.crc/cache
crc.qcow2: 10.16 GiB / 10.16 GiB [------------------------------------------------------------------------------------------] 100.00%
INFO Checking minimum RAM requirements
DEBU Total memory of system is 33734914048 bytes
INFO Checking if running as non-root
INFO Checking if Virtualization is enabled
DEBU Checking if the vmx/svm flags are present in /proc/cpuinfo
DEBU CPU virtualization flags are good
INFO Checking if KVM is enabled
DEBU Checking if /dev/kvm exists
DEBU /dev/kvm was found
INFO Checking if libvirt is installed
DEBU Checking if 'virsh' is available
DEBU 'virsh' was found in /usr/bin/virsh
DEBU Checking 'virsh capabilities' for libvirtd/qemu availability
DEBU Running 'virsh capabilities'
DEBU Found x86_64 hypervisor with 'hvm' capabilities
INFO Checking if user is part of libvirt group
DEBU Checking if current user is part of the libvirt group
DEBU Running '/usr/bin/groups crcuser'
DEBU Current user is already in the libvirt group
INFO Checking if libvirt daemon is running
DEBU Checking if libvirtd service is running
DEBU Running 'systemctl status virtqemud.socket'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit virtqemud.socket could not be found.
DEBU virtqemud.socket is neither running nor listening
DEBU Running 'systemctl status libvirtd.socket'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit libvirtd.socket could not be found.
DEBU libvirtd.socket is neither running nor listening
DEBU Running 'systemctl status virtqemud.service'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit virtqemud.service could not be found.
DEBU virtqemud.service is neither running nor listening
DEBU Running 'systemctl status libvirtd.service'
DEBU libvirtd.service is running
INFO Checking if a supported libvirt version is installed
DEBU Checking if libvirt version is >=3.4.0
DEBU Running 'virsh -v'
INFO Checking if crc-driver-libvirt is installed
DEBU Checking if crc-driver-libvirt is installed
DEBU crc-driver-libvirt executable is not cached
INFO Installing crc-driver-libvirt
DEBU Installing crc-driver-libvirt
DEBU Trying to extract crc-driver-libvirt from crc executable
DEBU Extracting embedded 'crc-driver-libvirt' from /usr/bin/crc to /tmp/crc628423078/crc-driver-libvirt
DEBU Copying '/tmp/crc628423078/crc-driver-libvirt' to '/home/crcuser/.crc/bin/crc-driver-libvirt'
DEBU crc-driver-libvirt is installed in /home/crcuser/.crc/bin
INFO Checking if systemd-networkd is running
DEBU Checking if systemd-networkd.service is running
DEBU Running 'systemctl status systemd-networkd.service'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit systemd-networkd.service could not be found.
DEBU systemd-networkd.service is not running
INFO Checking if NetworkManager is installed
DEBU Checking if 'nmcli' is available
DEBU 'nmcli' was found in /usr/bin/nmcli
INFO Checking if NetworkManager service is running
DEBU Checking if NetworkManager.service is running
DEBU Running 'systemctl status NetworkManager.service'
DEBU NetworkManager.service is already running
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists
DEBU Checking NetworkManager configuration
DEBU File not found: /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf: stat /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf: no such file or directory
INFO Writing Network Manager config for crc
DEBU Fixing NetworkManager configuration
INFO Will use root access: write NetworkManager configuration to /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf
INFO Will use root access: Changing permission for /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf to 644
DEBU Running '/usr/bin/sudo chmod 644 /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf'
DEBU Reloading NetworkManager
INFO Will use root access: executing systemctl daemon-reload command
DEBU Running '/usr/bin/sudo systemctl daemon-reload'
INFO Will use root access: executing systemctl reload NetworkManager
DEBU Running '/usr/bin/sudo systemctl reload NetworkManager'
DEBU NetworkManager configuration fixed
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists
DEBU Checking dnsmasq configuration
DEBU File not found: /etc/NetworkManager/dnsmasq.d/crc.conf: stat /etc/NetworkManager/dnsmasq.d/crc.conf: no such file or directory
INFO Writing dnsmasq config for crc
DEBU Fixing dnsmasq configuration
INFO Will use root access: write NetworkManager configuration to /etc/NetworkManager/dnsmasq.d/crc.conf
INFO Will use root access: Changing permission for /etc/NetworkManager/dnsmasq.d/crc.conf to 644
DEBU Running '/usr/bin/sudo chmod 644 /etc/NetworkManager/dnsmasq.d/crc.conf'
DEBU Reloading NetworkManager
INFO Will use root access: executing systemctl daemon-reload command
DEBU Running '/usr/bin/sudo systemctl daemon-reload'
INFO Will use root access: executing systemctl reload NetworkManager
DEBU Running '/usr/bin/sudo systemctl reload NetworkManager'
DEBU dnsmasq configuration fixed
INFO Checking if libvirt 'crc' network is available
DEBU Checking if libvirt 'crc' network exists
DEBU Running 'virsh --connect qemu:///system net-info crc'
DEBU Command failed: exit status 1
DEBU stdout:
DEBU stderr: error: failed to get network 'crc'
error: Network not found: no network with matching name 'crc'
DEBU Libvirt network crc not found
INFO Setting up libvirt 'crc' network
DEBU Creating libvirt 'crc' network
DEBU Running 'virsh --connect qemu:///system net-destroy crc'
DEBU Command failed: exit status 1
DEBU stdout:
DEBU stderr: error: failed to get network 'crc'
error: Network not found: no network with matching name 'crc'
DEBU Running 'virsh --connect qemu:///system net-undefine crc'
DEBU Command failed: exit status 1
DEBU stdout:
DEBU stderr: error: failed to get network 'crc'
error: Network not found: no network with matching name 'crc'
DEBU libvirt 'crc' network created
INFO Checking if libvirt 'crc' network is active
DEBU Checking if libvirt 'crc' network is active
DEBU Running 'virsh --connect qemu:///system net-info crc'
DEBU Libvirt crc network is not active
INFO Starting libvirt 'crc' network
DEBU Starting libvirt 'crc' network
DEBU Running 'virsh --connect qemu:///system net-start crc'
DEBU Running 'virsh --connect qemu:///system net-autostart crc'
DEBU libvirt 'crc' network started
Setup is complete, you can now run 'crc start' to start the OpenShift cluster
DEBU CodeReady Containers version: 1.20.0+ef3f80d
DEBU OpenShift version: 4.6.6 (embedded in executable)
DEBU Total memory of system is 33734914048 bytes
DEBU Couldn't set key CPE_NAME, no corresponding struct field found
DEBU Couldn't set key , no corresponding struct field found
DEBU Couldn't set key REDHAT_BUGZILLA_PRODUCT, no corresponding struct field found
DEBU Couldn't set key REDHAT_BUGZILLA_PRODUCT_VERSION, no corresponding struct field found
DEBU Couldn't set key REDHAT_SUPPORT_PRODUCT, no corresponding struct field found
DEBU Couldn't set key REDHAT_SUPPORT_PRODUCT_VERSION, no corresponding struct field found
INFO Checking if podman remote executable is cached
DEBU Currently podman remote is not supported
INFO Checking if goodhosts executable is cached
DEBU goodhost executable already cached
INFO Checking minimum RAM requirements
DEBU Total memory of system is 33734914048 bytes
INFO Checking if running as non-root
INFO Checking if Virtualization is enabled
DEBU Checking if the vmx/svm flags are present in /proc/cpuinfo
DEBU CPU virtualization flags are good
INFO Checking if KVM is enabled
DEBU Checking if /dev/kvm exists
DEBU /dev/kvm was found
INFO Checking if libvirt is installed
DEBU Checking if 'virsh' is available
DEBU 'virsh' was found in /usr/bin/virsh
DEBU Checking 'virsh capabilities' for libvirtd/qemu availability
DEBU Running 'virsh capabilities'
DEBU Found x86_64 hypervisor with 'hvm' capabilities
INFO Checking if user is part of libvirt group
DEBU Checking if current user is part of the libvirt group
DEBU Running '/usr/bin/groups crcuser'
DEBU Current user is already in the libvirt group
INFO Checking if libvirt daemon is running
DEBU Checking if libvirtd service is running
DEBU Running 'systemctl status virtqemud.socket'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit virtqemud.socket could not be found.
DEBU virtqemud.socket is neither running nor listening
DEBU Running 'systemctl status libvirtd.socket'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit libvirtd.socket could not be found.
DEBU libvirtd.socket is neither running nor listening
DEBU Running 'systemctl status virtqemud.service'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit virtqemud.service could not be found.
DEBU virtqemud.service is neither running nor listening
DEBU Running 'systemctl status libvirtd.service'
DEBU libvirtd.service is running
INFO Checking if a supported libvirt version is installed
DEBU Checking if libvirt version is >=3.4.0
DEBU Running 'virsh -v'
INFO Checking if crc-driver-libvirt is installed
DEBU Checking if crc-driver-libvirt is installed
DEBU Running '/home/crcuser/.crc/bin/crc-driver-libvirt version'
DEBU Found crc-driver-libvirt version 0.12.13
DEBU crc-driver-libvirt is already installed
INFO Checking if systemd-networkd is running
DEBU Checking if systemd-networkd.service is running
DEBU Running 'systemctl status systemd-networkd.service'
DEBU Command failed: exit status 4
DEBU stdout:
DEBU stderr: Unit systemd-networkd.service could not be found.
DEBU systemd-networkd.service is not running
INFO Checking if NetworkManager is installed
DEBU Checking if 'nmcli' is available
DEBU 'nmcli' was found in /usr/bin/nmcli
INFO Checking if NetworkManager service is running
DEBU Checking if NetworkManager.service is running
DEBU Running 'systemctl status NetworkManager.service'
DEBU NetworkManager.service is already running
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists
DEBU Checking NetworkManager configuration
DEBU NetworkManager configuration is good
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists
DEBU Checking dnsmasq configuration
DEBU dnsmasq configuration is good
INFO Checking if libvirt 'crc' network is available
DEBU Checking if libvirt 'crc' network exists
DEBU Running 'virsh --connect qemu:///system net-info crc'
DEBU Checking if libvirt 'crc' definition is up to date
DEBU Running 'virsh --connect qemu:///system net-dumpxml --inactive crc'
DEBU libvirt 'crc' network has the expected value
INFO Checking if libvirt 'crc' network is active
DEBU Checking if libvirt 'crc' network is active
DEBU Running 'virsh --connect qemu:///system net-info crc'
DEBU libvirt 'crc' network is already active
Checking file: /home/crcuser/.crc/machines/crc/.crc-exist
INFO Loading bundle: crc_libvirt_4.6.6.crcbundle ...
INFO Verifying bundle crc_libvirt_4.6.6.crcbundle ...
INFO Creating CodeReady Containers VM for OpenShift 4.6.6...
Found binary path at /home/crcuser/.crc/bin/crc-driver-libvirt
Launching plugin server for driver libvirt
Plugin server listening at address 127.0.0.1:41546
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(crc) Calling .GetMachineName
(crc) Calling .DriverName
Running pre-create checks...
(crc) Calling .PreCreateCheck
(crc) DBG | About to check libvirt version
(crc) DBG | Validating network
(crc) DBG | Validating storage pool
(crc) Calling .GetConfigRaw
Creating machine...
(crc) Calling .Create
(crc) DBG | Preparing /home/crcuser/.crc/machines/crc/crc.qcow2 for machine use
(crc) DBG | image creation took 61.682815ms
(crc) DBG | Verifying executable bit set on /home/crcuser/.crc/machines/crc
(crc) DBG | Setting executable bit set on /home/crcuser/.crc/machines/crc
(crc) DBG | Verifying executable bit set on /home/crcuser/.crc/machines
(crc) DBG | Setting executable bit set on /home/crcuser/.crc/machines
(crc) DBG | Verifying executable bit set on /home/crcuser/.crc
(crc) DBG | Setting executable bit set on /home/crcuser/.crc
(crc) DBG | Verifying executable bit set on /home/crcuser
(crc) DBG | Verifying executable bit set on /home
(crc) DBG | Defining VM...
(crc) DBG | Found x86_64 hypervisor with 'hvm' capabilities
(crc) DBG | No q35 machine type
(crc) DBG | Adding the file: /home/crcuser/.crc/machines/crc/.crc-exist
(crc) DBG | disk image capacity is already 33285996544 bytes
(crc) DBG | Starting VM crc
(crc) DBG | Validating network
(crc) DBG | Validating storage pool
(crc) Failed to start: virError(Code=38, Domain=18, Message='Cannot access backing file '/home/crcuser/.crc/cache/crc_libvirt_4.6.6/crc.qcow2' of storage file '/home/crcuser/.crc/machines/crc/crc.qcow2' (as uid:107, gid:107): Permission denied')
Making call to close driver server
(crc) Calling .Close
Successfully made call to close driver server
Making call to close connection to plugin binary
Error creating machine: Error creating the VM: Error creating machine: Error in driver during machine creation: virError(Code=38, Domain=18, Message='Cannot access backing file '/home/crcuser/.crc/cache/crc_libvirt_4.6.6/crc.qcow2' of storage file '/home/crcuser/.crc/machines/crc/crc.qcow2' (as uid:107, gid:107): Permission denied')
– Notes: I tried all the suggestions from those who had same issue (not reported on crc v1.20), and none of them worked. can you advise ? thanks, Russ
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (8 by maintainers)
Problem solved. Got it working in Linux Mint 20, by adding the path to /etc/apparmor.d/libvirt/TEMPLATE.qemu
profile LIBVIRT_TEMPLATE flags=(attach_disconnected) { #include <abstractions/libvirt-qemu> /home/chanchal/.crc/cache/crc_libvirt_4.6.3/crc.qcow2 rk, }