Borked template vm

19 views
Skip to first unread message

Daniel Allcock

unread,
Feb 2, 2019, 3:08:33 PM2/2/19
to qubes...@googlegroups.com
Hello all,

I seem to have borked a template vm, to the point that no applications
will start and I can't even use qvm-run from dom0 to do anything, not
even touch a file. There is one directory in
the root of the filesystem that contains
a ton of config info that I would like to recover. I'd
appreciate any help.

If I start an app in this vm from the Q menu then
I get notification that it has started, and the vm does appear in the
system tray VM management widget, but nothing else seems to happen.
Halting the vm gives notification
that the vm is stopping, and then the vm disappears from that widget.

Here is what I have thought of so far.

(1) I imagine there is a way to mount a template vm's root filesystem,
either in dom0 or in another vm. I couldn't find docs on that.

(2) I made a backup of that vm to another vm, and then used the
emergency recovery method from
https://www.qubes-os.org/doc/backup-emergency-restore-v4/
to produce files containing the borked template's root and private
filesystems. Following the instructions there allowed me to mount
the private filesystem and access its contents. But the config
stuff that I want to recover lies in the root filesystem, and I
was unable to mount it:

$sudo mount -o loop vm1/root.img /mnt/img
mount: /mnt/img: wrong fs type, bad option, bad superblock
on /dev/loop0, missing codepage or helper program, or other error.

(This works fine with root replaced by private.) As a further
strangeness, the "file" command thinks root.img is dos:
$ file vm1/root.img
vm1/root.img: DOS/MBR boot sector, extended partition table (last)

Adding "-t vfat" to the mount command doesn't change the failure.
On the other hand, "file" recognizes private.img as an ext4
filesystem.

Am extremely confused and a bit worried! Help very much appreciated.
Daniel

19hundreds

unread,
Feb 2, 2019, 3:12:51 PM2/2/19
to Daniel Allcock, qubes...@googlegroups.com

Feb 2, 2019, 8:08 PM by dan...@allcock.org:
Hello all,

I seem to have borked a template vm, to the point that no applications
will start and I can't even use qvm-run from dom0 to do anything, not
even touch a file. There is one directory in
the root of the filesystem that contains
a ton of config info that I would like to recover. I'd
appreciate any help.

If I start an app in this vm from the Q menu then
I get notification that it has started, and the vm does appear in the
system tray VM management widget, but nothing else seems to happen.
Halting the vm gives notification
that the vm is stopping, and then the vm disappears from that widget.

turn on the appvm from dom0

   qvm-start appvm

try to connect via xen console

    sudo xl list

get the ID of appvm and connect via console

sudo xl console #ID

maybe you are able to gain root access or to understand what's wrong.

When this happens to me it usually means that I'm out of space in the appvm and I have to resize the appvm from qube manager

Stuart Perkins

unread,
Feb 2, 2019, 4:27:09 PM2/2/19
to qubes...@googlegroups.com
If all else fails, use qvm-block -A to attach the drive image to a different vm in order to recover information off of it.

unman

unread,
Feb 2, 2019, 8:11:55 PM2/2/19
to qubes...@googlegroups.com
You need to get the partitions in the root image, and then mount them
to your recovery qube, like this:
losetup -P /dev/loop1 /dev/qubes_dom0/vm-debian-9-root
qvm-block a qube dom0:loop1p3
Reply all
Reply to author
Forward
0 new messages