Why is Qubes OS booting slow?

One of the significant downside is that Qubes OS boots show and shutdowns slow.

I kind of understand why Qubes OS shutdowns slow - that is because Qubes OS want to shut down the remaining appVMs (what I do not understand is that why a VM using 10GB ram spends ~2 minutes shutting down, and ~5 minutes if it has 20GB ram; I suspect that the VM spends their time flushing the memory cache).

I does not understand why Qubes OS boots slow. Usually it takes more than 5 minutes to boot up. By pressing F1 I can see that Qubes OS spending nearly most of the booting time (when I looked at the journalctl -r it seems to be around 4 minutes) playing with LVM (like it takes 4 minutes to “Finish LVM event activation on device ‘/dev/dm-0’”). btw I installed my Qubes OS on HDD.

I bet that the slow boot time can be one meme about Qubes OS. Every time why anyone asks why I like to “suspend” my computer I can only say that the OS boots as slow as a snail.

Anyone knows better about the question?

  1. Why is Qubes OS booting slow?
  2. Why is AppVM with large memory shutdowns show?

maybe you want to take a look in this thread for my benchmark, btw it’s a fresh qubes.

Mostly that you have big files in there? try run systemd-analyze in dom0, and examine what makes booting take so long.

I’m not sure in my answer, but i do have a appvm that use for qubes-builder, it has 50gb storage space and 10gb ram, i don’t see any difference between the minimal and this vm.

That is probably the issue.

I’m using nvme and I don’t have any issues.

3 Likes

My main programming VM has 400GB private storage max size (300GB used) and 20GB ram, I am using HDD, and it boots fast (default qrexec timeout suffices) but shutdowns slowly (may be that docker stops slow, since docker starts that slow as well).

3min 57.613s lvm2-monitor.service                                                                     
3min 50.666s lvm2-pvscan@253:0.service                                                                
1min 16.355s qubes-vm@sys-firewall.service                                                            
1min 11.776s qubes-vm@sys-audio.service                                                               
     57.505s qubes-vm@sys-net.service                                                                 
     43.258s qubes-vm@sys-usb.service                                                                 
     37.370s qubesd.service                                                                           
     30.220s plymouth-quit-wait.service                                                               
     14.569s systemd-journal-flush.service                                                            
     14.241s dracut-initqueue.service      

This is what systemd-analyze blame tells.
One major problem come from lvm2; another major problem come from qubes-vm@sys-firewall.service - Why will this service take so much time despite sys-firewall is not booted at that time (this service starts BEFORE I enter dom0 login password)

try upgrading to nvme if possible, even ssd would do.

actually, qubes-vm service is started after qubesd service, and qubesd service is started before user session, nothing wrong.

The bigger the storage, the longer it takes to shut the VM down:

I’ll have to study your suggestion. It seems to be a common issue in Qubes OS. On nvme m2 ssd it takes about 6 minutes before the login:
@dom0 ~]$ systemd-analyze blame
1min 57.881s qubes-vm@sys-whonix.service
1min 28.729s qubes-vm@sys-firewall.service
55.223s plymouth-quit-wait.service
52.833s qubes-vm@sys-net.service
42.687s qubes-vm@sys-usb.service
35.099s dracut-initqueue.service
34.080s systemd-cryptsetup@luks\x…>
30.254s systemd-cryptsetup@luks\x…>

I have not done any optimization, and it takes me around 40 sec to boot and automatically start the first qube, not including the time it takes the bios to load.

It takes around 10 sec to get from the boot menu to the LUKS password, and it takes another 20 sec to get to the login screen, and after login it takes around 10 sec to load the first qube.

I’m using the standard installation on a fast nvme.

1 Like

I had to do a lot to get Qubes working on an NH5x_NH7xHP laptop. First had to wait for Qubes 4.1 to be released because 4.0 was impossible to install. After installing 4.1 had to enable the testing and source repo’s, and installing kernel-latest to have everything working. Now it is only the slow boot. I’m happy with it; once started everything works, it only is impossible to enable the rpmfusion repositories in dom0. The only remaining problem and the extreme slow booting process. I’ll have to wait for the next stable Qubes release. That is the real problem with Qubes: dom0 is based on a very old Fedora version (fc32 in Qubes 4.1). Too old for newer hardware. After upgrading dom0 to the next version it will work even better and probably boot faster.