Qubes OS Post-Installation Issue: Automatic Template Installation Fails, No Templates and No VM

Hello Qubes OS community,

I’m trying to install Qubes OS, but I’m encountering a particular issue that I’m unable to resolve. The initial installation of Qubes OS from the ISO seems to occur without any issues. However, during the post-installation phase, on the first reboot, the automatic installation of the templates fails. To be more precise, a window displays indicating that the Fedora 37 Template is being installed. For some time (1 to 2 minutes), nothing happens and typically the fan of my computer starts up. Then a new window opens indicating the following error:

['/usr/bin/qvm-template', 'install', '--nogpgcheck', '/var/lib/qubes/template-packages/qubes-template-fedora-37-4.1.2.noarch.rpm'] failed:
stdout: ""
stderr: "Installing template 'fedora-37'...

gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Error is not recoverable: exiting now
ERROR: Failed to extract fedora-37 template
"

This is preceded by a gzip and tar error, suggesting that the program encountered an error when reading the compressed data.

I can then click on “OK”, the window closes and I find myself on the Qubes OS Desktop in dom0. However, I don’t have any templates and therefore no VMs (sys-net, sys-usb, etc.).

To try to resolve this issue, I’ve attempted numerous things, notably with the help of older posts on this forum or on GitHub (see links below):

  • Verifying the integrity of the ISO.
  • Using different sources for downloading the ISO: direct download of the ISO or use of torrent.
  • Using different versions of the ISO: 4.1.2 and 4.2.0-rc1.
  • Using different installation methods: “Install Qubes OS R4.X.X”, “Test media and install Qubes OS…”, “Install Qubes OS using kernel-latest”.
  • Using 2 different USB sticks.
  • Partitioning the disk with and without encryption.
  • Removing various templates when choosing which templates to install: during post-installation, I tried removing Fedora and/or Debian.

In all cases, the same problem repeats itself, no matter which template is being installed.

I then tried to check a number of things:

  • Checking the integrity of the template RPM files using the following command:

rpm -Kv /var/lib/qubes/templates-packages/qubes-template-fedora-37.noarch.rpm

The result indicates that the signatures and the integrity of the RPM package are correct.

  • Checking if there could be a problem at the decompression process level with the command:

rpm2cpio /var/lib/qubes/templates-packages/qubes-template-fedora-37.noarch.rpm | cpio -idmv

This command succeeded, suggesting that there’s no problem with manual decompression.

  • Checking partitions with ‘lsblk’, and I obtained (here, without encryption):
nvme0n1                           259:0    0 953.9G  0 disk 
|-nvme0n1p1                       259:1    0   600M  0 part /boot/efi
|-nvme0n1p2                       259:2    0     1G  0 part /boot
`-nvme0n1p3                       259:3    0 952.3G  0 part 
  |-qubes_dom0-root--pool_tmeta   253:0    0    24M  0 lvm  
  | `-qubes_dom0-root--pool-tpool 253:2    0    20G  0 lvm  
  |   |-qubes_dom0-root           253:3    0    20G  0 lvm  /
  |   `-qubes_dom0-root--pool     253:8    0    20G  1 lvm  
  |-qubes_dom0-root--pool_tdata   253:1    0    20G  0 lvm  
  | `-qubes_dom0-root--pool-tpool 253:2    0    20G  0 lvm  
  |   |-qubes_dom0-root           253:3    0    20G  0 lvm  /
  |   `-qubes_dom0-root--pool     253:8    0    20G  1 lvm  
  |-qubes_dom0-swap               253:4    0     4G  0 lvm  [SWAP]
  |-qubes_dom0-vm--pool_tmeta     253:5    0   844M  0 lvm  
  | `-qubes_dom0-vm--pool         253:7    0 826.7G  0 lvm  
  `-qubes_dom0-vm--pool_tdata     253:6    0 826.7G  0 lvm  
    `-qubes_dom0-vm--pool         253:7    0 826.7G  0 lvm
  • I tried running commands as they had been described in old posts and which had worked for a similar problem (see links at the bottom of the page):
dnf config-manager --add-repo /tmp/installer.repo
dnf download --downloaddir=/mnt/sysimage/var/lib/qubes/template-packages qubes-template-*

Unfortunately, this did not result in a successful installation of the templates.

  • I tried installing the templates with the command:
$ sudo dnf install -v /var/lib/qubes/template-packages/qubes-template-fedora-37-4.0.6-202302271646.noarch.rpm 
Failed to set locale, defaulting to C.UTF-8
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.6.0
cachedir: /var/cache/dnf
User-Agent: constructed: 'libdnf (Qubes 4.1; generic; Linux.x86_64)'
repo: downloading from remote: qubes-dom0-cached
error: Curl error (37): Couldn't read a file:// file for file:///var/lib/qubes/updates/repodata/repomd.xml [Couldn't open file /var/lib/qubes/updates/repodata/repomd.xml] (file:///var/lib/qubes/updates/repodata/repomd.xml).
Qubes OS Repository for Dom0                    0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'qubes-dom0-cached':
  - Curl error (37): Couldn't read a file:// file for file:///var/lib/qubes/updates/repodata/repomd.xml [Couldn't open file /var/lib/qubes/updates/repodata/repomd.xml]
Error: Failed to download metadata for repo 'qubes-dom0-cached': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: qubes-dom0-cached
Completion plugin: Generating completion cache...
--> Starting dependency resolution
---> Package qubes-template-fedora-37.noarch 4.0.6-202302271646 will be installed
--> Finished dependency resolution
Dependencies resolved.
================================================================================
 Package                    Arch     Version               Repository      Size
================================================================================
Installing:
 qubes-template-fedora-37   noarch   4.0.6-202302271646    @commandline   1.7 G

Transaction Summary
================================================================================
Install  1 Package

Total size: 1.7 G
Installed size: 4.6 G
Is this ok [y/N]: Y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Running scriptlet: qubes-template-fedora-37-4.0.6-202302271646.noarch     1/1 
  Installing       : qubes-template-fedora-37-4.0.6-202302271646.noarch     1/1 
  Running scriptlet: qubes-template-fedora-37-4.0.6-202302271646.noarch     1/1 
fedora-37: Importing data

  Verifying        : qubes-template-fedora-37-4.0.6-202302271646.noarch     1/1 
Completion plugin: Generating completion cache...
Installed: qubes-template-fedora-37-4.0.6-202302271646.noarch

Installed:
  qubes-template-fedora-37-4.0.6-202302271646.noarch                            

Complete!

In this case, the template is correctly installed, and it is possible to launch it. The problem therefore does not come from virtualization.

  • On the other hand, if I try to install a template not installed with the previously described method, I get the same errors:

$ sudo qvm-template install -v /var/lib/qubes/template-packages/qubes-template-fedora-37-4.0.6-202302271646.noarch.rpm 
Installing template 'fedora-37'...

gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Error is not recoverable: exiting now
ERROR: Failed to extract fedora-37 template
2023-07-10 08:48:01,112 [MainProcess qvm_template.main:1704] app: Failed to extract fedora-37 template
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template.py", line 1674, in main
    install(p_args, app)
  File "/usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template.py", line 936, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template.py", line 1090, in install
    raise Exception(f'Failed to extract {name} template')
Exception: Failed to extract fedora-37 template

In this case, the ‘-v’ option provides new information. As the automatic installation is done using the ‘qvm-template’ command, this suggests that the problem comes from the process arising from this command.

This error seems to indicate that the extraction of the template archive failed for an unknown reason. It’s worth noting that if I use this command to install a template previously installed with ‘dnf’, there are no errors but the process ends because the template is already installed.

  • My computer is a ThinkPad X1 Yoga Gen 6, which is very similar to the ThinkPad X1 Carbon Gen 9 for which Qubes OS works correctly according to the HCL. I was unable to attempt to reproduce this problem on another computer as I do not have another available.

  • One last thing I noticed. After an n-th reinstallation, this time without encryption, I tried to reinstall Qubes OS again. However, this time, during the installation of Qubes OS, I get an error during the automatic disk partitioning: “Error during storage space configuration check”. Going into the Anaconda TTY, I saw the following error:
    WRN misc:/ /usr/lib64/python3.8/site-packages/gi/overrides/GObject.py:502: Warning: ../gobject/gsignal.c:2735: instance '0xXXXXXXXXXXXX' has no handler with id 'XXXXX'

    I did not attempt to delve into this further as it has already taken numerous hours and I’m tired.

At this stage, I’m stuck and I can’t understand why the automatic template installation process fails. Any help or suggestions would be greatly appreciated.

Do you think it would be better to try to manually rebuild the installations of the different templates and other VMs? Is this secure? Is it possible to manually install the templates and re-run the installation scripts to finish installing the other VMs?

Thank you in advance for your help.

I have found 10 topics for similar issue but, as a new user i can only give in this post two links. Links to similar issues:

1 Like

what language you choose when installing qubes?

French.

try using the default one, english. and see if the problem persist.

I tried. With different ISO (4.1.2 and 4.2.0-rc1). Same problem.