<div dir="ltr"><div dir="ltr"><div>Thanks Michal!</div><div><br></div><div>See comments in line<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 17, 2020 at 9:23 AM Michal Privoznik <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/16/20 10:20 PM, Yuri Weinstein wrote:<br>
> I used to have QEMU/KVM and Virtual Machine Manager running on ubuntu <br>
> 16.04 and used to start my VM from crontab as:<br>
> <br>
> @reboot sleep 30 && virsh start WINDOWS10<br>
<br>
Libvirt has an autostart feature, which can start your domain on the <br>
first time libvirtd is started (i.e. during boot).<br>
<br>
virsh autostart WINDOWS10<br>
<br>
> <br>
> After upgrading to ubuntu 18.04 this stopped working, with error:<br>
> <br>
> error: failed to get domain 'WINDOWS10'<br>
> error: Domain not found: no domain with matching name 'WINDOWS10'<br>
> <br>
> Running command as "virsh start WINDOWS10" works fine.<br>
> <br>
<br>
This is probably because cron doesn't run the command as root and hence <br>
the virsh is no longer connecting to 'qemu:///system' but <br>
'qemu:///session'. Change it to:<br>
<br>
virsh -c qemu:///system start WINDOWS10<br></blockquote><div><br></div><div>I managed to force austart via Startup App as:</div><div>sh -c "sleep 30 && /usr/bin/virsh start WINDOWS10"</div><div><br></div><div>See your point about using root and/or 'qemu:///system' and will try it.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
But I suggest using the autostart feature instead.<br>
<br></blockquote><div><br></div><div>This is the main issue - it does not work! :(  Tried via command line and UI</div><div>You can see =><br></div><div>Autostart:      enable</div><div><br></div><div>How can this be fixed and/or troubleshooted? <br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> I am trying to use Virtual Machine Manager to autostart my VM and it <br>
> simply does not work.<br>
> <br>
> Here is more info on the VM:<br>
> <br>
> virsh dominfo WINDOWS10<br>
> Id:             2<br>
> Name:           WINDOWS10<br>
> UUID:           32faf348-f54e-445a-90cc-e64d28d9d396<br>
> OS Type:        hvm<br>
> State:          running<br>
> CPU(s):         4<br>
> CPU time:       4846.0s<br>
> Max memory:     8192000 KiB<br>
> Used memory:    8192000 KiB<br>
> Persistent:     yes<br>
> Autostart:      enable<br>
> Managed save:   no<br>
> Security model: apparmor<br>
> Security DOI:   0<br>
> Security label: libvirt-32faf348-f54e-445a-90cc-e64d28d9d396 (enforcing)<br>
> <br>
> Sounds like a bug to me.<br>
> Any help appreciated.<br>
<br>
Michal<br>
<br>
</blockquote></div></div>