[qubes-users] mounting root TemplatVM partition in dom0 fails

Hi,

I have some templates stored in a "file" pool where, for example, I
find the following files:

  private.img
  private-cow.img
  root.img
  root-cow.img

I can do this in dom0, no problem:

  sudo mount private.img /mnt

But this fails:

  sudo mount root.img /mnt

with a very common, uninformative error, ie.

  mount: wrong fs type, bad option, etc. etc.

I would dearly love to mount the root.img and modify a file in /etc file
in a broken VM. Any hints would be welcome.

rss+qubes@armor-mail.com:

I have some templates stored in a "file" pool where, for example, I
find the following files:

  private.img
  private-cow.img
  root.img
  root-cow.img

I can do this in dom0, no problem:

  sudo mount private.img /mnt

But this fails:

  sudo mount root.img /mnt

with a very common, uninformative error, ie.

  mount: wrong fs type, bad option, etc. etc.

I would dearly love to mount the root.img and modify a file in /etc file
in a broken VM. Any hints would be welcome.

It doesn't work for the 'root' volume because that contains multiple
partitions. The / filesystem is on the 3rd. You could use kpartx to
mount it, but mounting any VM or template filesystem in dom0 is
insecure! The kernel can not be assumed to be robust against a
potentially malicious filesystem. Better to attach your broken volume
to a e.g. a trusted DisposableVM for recovery:

https://github.com/QubesOS/qubes-issues/issues/4687#issuecomment-753492903

Rusty