How does the VM storage work internally?

Hi everyone,

Sorry for this rather basic topic: I am looking for some information on how the storage of the template/app VMs is handled internally by QubesOS.

My main question is: What is happening internally from storage perspective when I’m starting/shutting down an app VM and why does the shutdown seem to take longer, the more data is inside?

I do know that the LVMs are manged automatically and I did observe through sudo lvs that their number changes when the VM is started compared to when it’s stopped.

I tried to find the relevant explanation in the documentation but wasn’t successful yet.

Thanks in advance for some more insight on this topic!

1 Like

You might find some information in #5426 as well as the qubes.storage documentation.

There is also the original architecture spec from 2009, which you might find interesting.

Ultimately you could ask the devs over at the qubes-devel mailing list. But before doing that I’d make sure you did your homework.

2 Likes

In case it helps someone: This solution worked for me to resolve the slow VM shutdowns that I was experiencing. Also large VMs are now shutting down within a few seconds.

1 Like

@qpost135 did you follow a guide? @tasket mentioned it’s an option in the installer. I am highly interested in reproducing this … shutting down my 100GB Windows 10 HVM blocks everything for a good minute.

I didn’t follow a guide but it was a simple process in the installer GUI.

Just to ensure that you are indeed experiencing the same issue, I would recommend to observe the lvs output during your large VM shutdown, as explained here. When I saw that my system behaves exactly the same (= slow deletion of the -bak), I was more confident to try out BTRFS.

What I did in the installer GUI to get a BTRFS system:

  • Select Manual Partitioning: “I will configure partitioning”
  • Delete all automatically created/previous partitions
  • Set "New mount points will use the following partitioning scheme: " to Btrfs
  • Click on “Click here to create them automatically”
  • Observe the new partition entries: The boot partition is still ext4 but the partition mounted at / is now Btrfs

Good luck!

2 Likes