qvm-create-default-dvm fails

97 views
Skip to first unread message

haaber

unread,
Mar 5, 2017, 4:50:55 PM3/5/17
to qubes-users
Hello,

I want to base my disp-vm's on debian-8. So I run in dom0

> [me@dom0 dvmdata]$ sudo qvm-create-default-dvm debian-8
> A VM with the name 'debian-8-dvm' does not exist in the system.

this is strange, since /var/lib.qubes/appvms/debian-8-dvm DOES exist.
Running it with "sh -x" prefix, I find the problem here:
> [me@dom0 dvmdata]$ sudo sh -x qvm-create-default-dvm debian-8
> [..]
> + /usr/lib/qubes/qubes-prepare-saved-domain.sh debian-8-dvm
/var/lib/qubes/appvms/debian- 8-dvm/dvm-savefile vm-default
> A VM with the name 'debian-8-dvm' does not exist in the system.

so the error is produced by qubes-prepare-saved-domain.sh. Prefixing
the hurting command with "bash -x" gives

>sudo bash -x qubes-prepare-saved-domain.sh debian-8-dvm
/var/lib/qubes/appvms/debian- 8-dvm/dvm-savefile vm-default
> [..]
> + qvm-start debian-8-dvm --dvm
> A VM with the name 'debian-8-dvm' does not exist in the system.

This is a python2 script. Running it with -v reveals

> [me@dom0 dvmdata]$ sudo /usr/bin/python2 -v /usr/bin/qvm-start
debian-8-dvm --dvm
> [..]
> # /usr/lib64/python2.7/gettext.pyc matches /usr/lib64/python2.7/gettext.py
> import gettext # precompiled from /usr/lib64/python2.7/gettext.pyc
> # /usr/lib64/python2.7/locale.pyc matches /usr/lib64/python2.7/locale.py
> import locale # precompiled from /usr/lib64/python2.7/locale.pyc
> # /usr/lib64/python2.7/copy.pyc matches /usr/lib64/python2.7/copy.py
> import copy # precompiled from /usr/lib64/python2.7/copy.pyc
> A VM with the name 'debian-8-dvm' does not exist in the system.

Here I am stuck. May anybody help me understand what may go wrong here?
Bernhard


Unman

unread,
Mar 5, 2017, 6:49:53 PM3/5/17
to haaber, qubes-users
Dont use sudo here - you may hit problems with permissions. The same
goes for all qube operations - qvm-clone, create etc.

Can you simply delete the /var/lib/qubes/appvms/debian-8-dvm directory
and then try 'qvm-create-default-dvm debian-8' , and report back?

haaber

unread,
Mar 6, 2017, 3:42:00 AM3/6/17
to Unman, qubes-users
Thanks for helping Unman! This happens:

[ me@dom0 ] rm -rf /var/lib/qubes/appvms/debian-8-dvm
[ me@dom0 ] qvm-create-default-dvm debian-8
--> Using TemplateVM: debian-8
--> Creating directory: /var/lib/qubes/appvms/debian-8-dvm
--> Copying the template's private image:
/var/lib/qubes/vm-templates/debian-8/private.img
--> Creating volatile image:
/var/lib/qubes/appvms/debian-8-dvm/volatile.img...
--> Creating icon symlink: /var/lib/qubes/appvms/debian-8-dvm/icon.png
-> /usr/share/icons/hicolor/128x128/devices/appvm-gray.png
Traceback (most recent call last):
File "/usr/bin/qvm-create", line 223, in <module>
main()
File "/usr/bin/qvm-create", line 201, in main
vm.create_on_disk(verbose=options.verbose, source_template=template)
File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py",
line 1308, in create_on_disk
self._update_libvirt_domain()
File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py",
line 755, in _update_libvirt_domain
raise e
libvirt.libvirtError: operation failed: domain 'debian-8-dvm' already
exists with uuid 61320a0c2-1e2a-4bff-b064-29fe587619b8

Bernhard

Unman

unread,
Mar 6, 2017, 8:55:43 AM3/6/17
to haaber, qubes-users
Look here:
www.qubes-os.org/doc/remove-vm-manually

That libvirt error sghows that you have a redundant entry in the db,
which you need to remove.
Then try creating the dvmTemplate again. Remember, no sudo!

Bernhard

unread,
Mar 6, 2017, 9:49:33 AM3/6/17
to Unman, qubes-users
On 03/06/2017 02:55 PM, Unman wrote:
>> self._update_libvirt_domain()
>> File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py",
>> line 755, in _update_libvirt_domain
>> raise e
>> libvirt.libvirtError: operation failed: domain 'debian-8-dvm' already
>> exists with uuid 61320a0c2-1e2a-4bff-b064-29fe587619b8
>>
>> Bernhard
> Look here:
> www.qubes-os.org/doc/remove-vm-manually
>
> That libvirt error sghows that you have a redundant entry in the db,
> which you need to remove.
> Then try creating the dvmTemplate again. Remember, no sudo!

Hello Unman, I looked at your link.

|1) rm -rf is done. 2) qvm-remove --just-db debian-8-dvm says "there is
no VM with this name.." (and he's right!) 3) in|||~/.local/share/applications/ there no thing such as |debian-8-dvm*
There is debian-8-gnome-terminal.desktop
debian-8-gpk-application.desktop and
debian-8-qubes-appmenu-select.desktop I won't touch these, will I ??
Still, the error persists. Find finds no debian-8-dvm* file in /var ...
I also find -type f -size -1M -exec grep -il debian-8-dvm \{} \;
verifyied my /var: no debian-8-dvm string wheresoever. However, I found
/etc/libvirt/libxl/debian-8-dvm.xml I moved it to |||/etc/libvirt/libxl/debian-8-dvm.xml|.old to see what happens, but the
error persists still. Desparate ... any ideas? Bernhard |

Unman

unread,
Mar 6, 2017, 2:45:31 PM3/6/17
to Bernhard, qubes-users
Try this:
virsh -c xen:/// undefine debian-8-dvm

Then try recreating the dvmTemplate again.

haaber

unread,
Mar 6, 2017, 3:08:06 PM3/6/17
to Unman, qubes-users
This did it, thank you! I found the command some hours ago, after your
last mail that made me google libvirt issues. I posted it immediately,
but maybe I used the wrong "from" address and the mail was eaten by
google groups. Anyhow, THANK YOU so much! Bernhard
Reply all
Reply to author
Forward
0 new messages