Issue: [Dom0] ERROR: Basic tab: Failed to setup autostart for VM via systemctl

316 views
Skip to first unread message

vuarnet

unread,
Nov 4, 2014, 11:52:39 AM11/4/14
to qubes...@googlegroups.com
I tried to set my TorVM to start automatically on boot, but I get the following error:

[Dom0] Error while changing settings for torvm!
ERROR: Basic tab:
Failed to set autostart for VM via systemctl
[OK]

I tried this while the VM was shut down, and I also tried it while it was running, same issue both ways. I was using the Qubes VM Manager to set this via right click --> VM Settings --> (tab) Basic

Can I set this via dom0? I can file a bug report if necessary.

Thanks!

crane...@gmail.com

unread,
Nov 9, 2014, 4:37:37 PM11/9/14
to qubes...@googlegroups.com
On Tuesday, November 4, 2014 11:52:39 AM UTC-5, vuarnet wrote:
> I tried to set my TorVM to start automatically on boot...

I have the same problem. I hope the next version will address that problem.

Marek Marczykowski-Górecki

unread,
Nov 9, 2014, 4:57:25 PM11/9/14
to vuarnet, qubes...@googlegroups.com
On Tue, Nov 04, 2014 at 08:52:39AM -0800, vuarnet wrote:
> I tried to set my TorVM to start automatically on boot, but I get the
> following error:
>
> [Dom0] Error while changing settings for torvm!
> ERROR: Basic tab:
> Failed to set autostart for VM via systemctl
> [OK]
>
> I tried this while the VM was shut down, and I also tried it while it was
> running, same issue both ways. I was using the Qubes VM Manager to set this
> via right click --> VM Settings --> (tab) Basic

Do you have any details in ~/.xsession-errors (or wherever Qubes Manager
stderr goes)?

> Can I set this via dom0? I can file a bug report if necessary.

Yes:
sudo systemctl enable qube...@torvm.service

--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

crane...@gmail.com

unread,
Nov 9, 2014, 5:16:39 PM11/9/14
to qubes...@googlegroups.com, ben.b...@gmail.com
On Sunday, November 9, 2014 4:57:25 PM UTC-5, Marek Marczykowski-Górecki wrote:
> > Can I set this via dom0? I can file a bug report if necessary.
>
> Yes:
> sudo systemctl enable qube...@torvm.service

That didn't work for me... I get
Failed to issue method call: No such file or directory

Marek Marczykowski-Górecki

unread,
Nov 9, 2014, 5:36:18 PM11/9/14
to crane...@gmail.com, qubes...@googlegroups.com, ben.b...@gmail.com
Ok, so this is probably why it wasn't working in Qubes Manager. Check if
you have this file in dom0: /usr/lib/systemd/system/qubes-vm@.service
It should be installed by qubes-core-dom0 package (the current version
is 2.1.63).

crane...@gmail.com

unread,
Nov 9, 2014, 5:45:40 PM11/9/14
to qubes...@googlegroups.com, crane...@gmail.com, ben.b...@gmail.com
On Sunday, November 9, 2014 5:36:18 PM UTC-5, Marek Marczykowski-Górecki wrote:
> Ok, so this is probably why it wasn't working in Qubes Manager. Check if
> you have this file in dom0: /usr/lib/systemd/system/qubes-vm@.service
> It should be installed by qubes-core-dom0 package (the current version
> is 2.1.63).

Yes I have that file...

Marek Marczykowski-Górecki

unread,
Nov 9, 2014, 7:37:39 PM11/9/14
to crane...@gmail.com, qubes...@googlegroups.com, ben.b...@gmail.com
That systemctl command should output something like:
ln -s '/usr/lib/systemd/system/qubes-vm@.service'
'/etc/systemd/system/multi-user.target.wants/qube...@torvm.service'

Perhaps the target file already exists and points at some stale
location? Try systemctl disable first.

crane...@gmail.com

unread,
Nov 10, 2014, 3:32:42 AM11/10/14
to qubes...@googlegroups.com, crane...@gmail.com, ben.b...@gmail.com
On Sunday, November 9, 2014 7:37:39 PM UTC-5, Marek Marczykowski-Górecki wrote:
> > Yes I have that file...
> Perhaps the target file already exists and points at some stale
> location? Try systemctl disable first.

Tried that - disable which didn't produce anything on the command line. Then retried enable which produced the same error previously mentioned.

vuarnet

unread,
Nov 10, 2014, 3:10:25 PM11/10/14
to qubes...@googlegroups.com, crane...@gmail.com, ben.b...@gmail.com

I got the same issue -- I tried:

sudo systemctl disable qube...@torvm.service (no output)
sudo systemctl enable qube...@torvm.service
And I got the same output as described above: "Failed to issue method call: No such file or directory"

I can confirm the /usr/lib/systemd/system/qubes-vm@.service file *does* exist and it appeared OK with a quick look.

So as a workaround I just looked at the qubes-vm@.service file and the qubes-netvm.service (since I know it works) and copied the contents of qubes-vm@.service to qube...@torvm.service and replaced "%i" with "torvm". Hardcoded hack that I'll probably regret later but it worked for now. Just issue:

(Assuming you're in the /usr/lib/systemd/system/ directory)
sudo cp qubes-vm\@.service qubes-vm\@torvm.service
sudo nano qubes-vm\@torvm.service
(change where it says "ExecStart=/usr/bin/qvm-start --no-guid %i" to "ExecStart=/usr/bin/qvm-start --no-guid torvm"
sudo systemctl enable qube...@torvm.service

Then reboot and it should start on boot as intended.

Still not sure what's causing the error but at least there's a temporary workaround that's not too messy. It just creates another .service file.

Thanks Marek for helping get this straightened out. Should I file a bug report?

Also, nothing useful that I could find in .xsession-errors, journalct or dmesg when I tried to generate the error in the Qubes VM manager GUI.

Marek Marczykowski-Górecki

unread,
Nov 10, 2014, 7:06:55 PM11/10/14
to vuarnet, qubes...@googlegroups.com, crane...@gmail.com
Simpler workaround would be manually making the symlink
/etc/systemd/system/multi-user.target.wants/qube...@torvm.service -> /usr/lib/systemd/system/qubes-vm@.service

Do you have similar problem with other VMs, or just torvm? Maybe there
is something special about this name (some name conflict or so...).
Check also "systemctl list --all", perhaps there is already defined such
service. Try also "sudo systemctl daemon-reload", just in case...

> Then reboot and it should start on boot as intended.
>
> Still not sure what's causing the error but at least there's a temporary
> workaround that's not too messy. It just creates another .service file.
>
> Thanks Marek for helping get this straightened out. Should I file a bug
> report?

Yes, that would be helpful.

> Also, nothing useful that I could find in .xsession-errors, journalct or
> dmesg when I tried to generate the error in the Qubes VM manager GUI.
>

crane...@gmail.com

unread,
Nov 10, 2014, 8:15:54 PM11/10/14
to qubes...@googlegroups.com, crane...@gmail.com, ben.b...@gmail.com
On Monday, November 10, 2014 3:10:25 PM UTC-5, vuarnet wrote:

> So as a workaround I just looked at the qubes-vm@.service file and the qubes-netvm.service (since I know it works) and copied the contents of qubes-vm@.service to qube...@torvm.service and replaced "%i" with "torvm". Hardcoded hack that I'll probably regret later but it worked for now. Just issue:
>
> (Assuming you're in the /usr/lib/systemd/system/ directory)
> sudo cp qubes-vm\@.service qubes-vm\@torvm.service
> sudo nano qubes-vm\@torvm.service
> (change where it says "ExecStart=/usr/bin/qvm-start --no-guid %i" to "ExecStart=/usr/bin/qvm-start --no-guid torvm"
> sudo systemctl enable qube...@torvm.service
>


This might be a better solution for me since I also want lighttpd, php, and dnsmasq to all auto-start after reboot... Tor in one domain (fedora-net) and the others in another domain (fedora-web). I am still having problems with port forwarding - it has been suggested to add sleep 2 to all scripts...

I really don't understand a symbolic link "named" qube...@torvm.service pointing to qubes-vm@.service. Is it like windows' shortcuts? Whereas you can name the shortcut anything you want, but the target is still the target... I guess I just don't get that one. Perhaps someone could explain...

Marek Marczykowski-Górecki

unread,
Nov 10, 2014, 8:35:22 PM11/10/14
to crane...@gmail.com, qubes...@googlegroups.com, ben.b...@gmail.com
On Mon, Nov 10, 2014 at 05:15:54PM -0800, crane...@gmail.com wrote:
> On Monday, November 10, 2014 3:10:25 PM UTC-5, vuarnet wrote:
>
> > So as a workaround I just looked at the qubes-vm@.service file and the qubes-netvm.service (since I know it works) and copied the contents of qubes-vm@.service to qube...@torvm.service and replaced "%i" with "torvm". Hardcoded hack that I'll probably regret later but it worked for now. Just issue:
> >
> > (Assuming you're in the /usr/lib/systemd/system/ directory)
> > sudo cp qubes-vm\@.service qubes-vm\@torvm.service
> > sudo nano qubes-vm\@torvm.service
> > (change where it says "ExecStart=/usr/bin/qvm-start --no-guid %i" to "ExecStart=/usr/bin/qvm-start --no-guid torvm"
> > sudo systemctl enable qube...@torvm.service
> >
>
>
> This might be a better solution for me since I also want lighttpd, php, and dnsmasq to all auto-start after reboot... Tor in one domain (fedora-net) and the others in another domain (fedora-web). I am still having problems with port forwarding - it has been suggested to add sleep 2 to all scripts...

Regarding starting the services, the right place for it is in
/rw/config/rc.local, just add "systemctl --no-block start
lighttpd.service" and so on.

> I really don't understand a symbolic link "named" qube...@torvm.service pointing to qubes-vm@.service. Is it like windows' shortcuts? Whereas you can name the shortcut anything you want, but the target is still the target... I guess I just don't get that one. Perhaps someone could explain...

Symlink is just a (sort of) file, with information "content of this file
is in ...". It can have totally different name than the target. Systemd
uses this to handle similar services. The above link means that
qube...@torvm.service is described in qubes-vm@.service file.
If you want details, take a look at systemd.unit(5) man page (paragraph
starting with "Optionally, units may be instantiated from a template
file at runtime.").

crane...@gmail.com

unread,
Nov 10, 2014, 9:15:18 PM11/10/14
to qubes...@googlegroups.com, crane...@gmail.com, ben.b...@gmail.com
On Monday, November 10, 2014 8:35:22 PM UTC-5, Marek Marczykowski-Górecki wrote:
> Regarding starting the services...
> /rw/config/rc.local, just add "systemctl --no-block start
> lighttpd.service"...
>

You are referring to the domain /rw/config/rc.local? Which doesn't run until you start the domain (the services start ok once I start the domain)... I thought what we were doing was in dom0 to auto-start the domain?

Marek Marczykowski-Górecki

unread,
Nov 10, 2014, 9:38:14 PM11/10/14
to crane...@gmail.com, qubes...@googlegroups.com, ben.b...@gmail.com
Right, you need to auto-start the domain first. Then you can use
rc.local to start the services there.

crane...@gmail.com

unread,
Nov 10, 2014, 9:43:48 PM11/10/14
to qubes...@googlegroups.com, crane...@gmail.com, ben.b...@gmail.com
On Monday, November 10, 2014 9:38:14 PM UTC-5, Marek Marczykowski-Górecki wrote:
> Right, you need to auto-start the domain first. Then you can use
> rc.local to start the services there.


Got it! Thanks for clearing that up.

vuarnet

unread,
Nov 13, 2014, 4:17:57 PM11/13/14
to qubes...@googlegroups.com
I just submitted a bug report here: https://wiki.qubes-os.org/ticket/925#ticket

Let me know if you need me to test or do anything to help.

Alex Dubois

unread,
Dec 14, 2014, 10:35:58 AM12/14/14
to qubes...@googlegroups.com

I confirm that the synlink solution worked:
sudo ln -s /usr/lib/systemd/system/qubes-vm\@.service /etc/systemd/system/multi-user.target.wants/qubes-vm\@MyVMName.service

For whom will look into the patch if of any use...
Please note that after a reboot: Qubes VM Manager does *NOT* show "Start VM automatically on boot" as ticked.
However ticking it and clicking OK "accept" the change.

Alex

J.M. Porup

unread,
Jan 20, 2015, 5:32:11 PM1/20/15
to qubes...@googlegroups.com
On 12/14/14 10:35, Alex Dubois wrote:
>
>
> On Thursday, 13 November 2014 21:17:57 UTC, vuarnet wrote:
>
> On Tuesday, November 4, 2014 10:52:39 AM UTC-6, vuarnet wrote:
>
> I tried to set my TorVM to start automatically on boot, but I
> get the following error:
>
> [Dom0] Error while changing settings for torvm!
> ERROR: Basic tab:
> Failed to set autostart for VM via systemctl
> [OK]
>
> I tried this while the VM was shut down, and I also tried it
> while it was running, same issue both ways. I was using the
> Qubes VM Manager to set this via right click --> VM Settings -->
> (tab) Basic
>
> Can I set this via dom0? I can file a bug report if necessary.
>
> Thanks!
>
>
> I just submitted a bug report here:
> https://wiki.qubes-os.org/ticket/925#ticket
> <https://wiki.qubes-os.org/ticket/925#ticket>
>
> Let me know if you need me to test or do anything to help.
>
>
> I confirm that the synlink solution worked:
> sudo ln -s /usr/lib/systemd/system/qubes-vm\@.service
> /etc/systemd/system/multi-user.target.wants/qubes-vm\@MyVMName.service

This solution doesn't work with VMs containing a hyphen,
e.g. My-VM-Name

cheers
JMP

Marek Marczykowski-Górecki

unread,
Jan 20, 2015, 6:16:05 PM1/20/15
to J.M. Porup, qubes...@googlegroups.com
What do you mean by "doesn't work"? The VM isn't started? Perhaps you've
made a typo in VM name? Note that VM name is case-sensitive. Check this
for details:
systemctl status qubes-vm\@My-VM-Name.service

J.M. Porup

unread,
Jan 20, 2015, 6:48:50 PM1/20/15
to Marek Marczykowski-Górecki, qubes...@googlegroups.com
By "doesn't work" I mean the VM does not autostart. This does not happen
with the regular fedora-20-x64 template, but does affect
fedora-20-x64-minimal.

How to reproduce.

1. create new vm My-Test-VM
2. right click in VM Manager, try to select autostart, get above
reported error
3. go to dom0 console, ln -s [...] as above
4. right click in VM Manager, select autostart
5. reboot
6. VM My-Test-VM does not autostart

I used this documentatation to create my test proxy vm:

https://wiki.qubes-os.org/wiki/Templates/FedoraMinimal

Zero idea what might be causing this, but pretty confident in my
results. See if you can reproduce.

cheers
JMP







J.M. Porup

unread,
Jan 20, 2015, 6:55:50 PM1/20/15
to qubes...@googlegroups.com
ah, here we are, systemctl reports (copying by hand)

ERROR: [Errno 2] No such file or directory:
'/var/lib/qubes/servicevms/torvm/volatile.img'
...
Failed to start Qubes VM My-Test-VM
Unit qube...@My-Test-VM.service entered failed state


So the problem has something to do with My-Test-VM using torvm as its
netvm (but vms with hyphens in their name seem to be fine !?)

JMP







Marek Marczykowski-Górecki

unread,
Jan 20, 2015, 7:07:08 PM1/20/15
to J.M. Porup, qubes...@googlegroups.com
VM manager steps are redundant when you create the symlink manually.

> 5. reboot
> 6. VM My-Test-VM does not autostart

What is the output of "sudo systemctl status qubes-vm\@My-VM-Name.service"?
Do you have "enabled" there? Any startup errors reported?

> I used this documentatation to create my test proxy vm:
>
> https://wiki.qubes-os.org/wiki/Templates/FedoraMinimal
>
> Zero idea what might be causing this, but pretty confident in my
> results. See if you can reproduce.
>
> cheers
> JMP
>
>
>
>
>
>
>

Marek Marczykowski-Górecki

unread,
Jan 20, 2015, 7:08:08 PM1/20/15
to J.M. Porup, qubes...@googlegroups.com
Try to start that VM manually and see if the error persists.

J.M. Porup

unread,
Jan 21, 2015, 4:55:50 AM1/21/15
to Marek Marczykowski-Górecki, qubes...@googlegroups.com
On 01/20/15 19:07, Marek Marczykowski-Górecki wrote:
> What is the output of "sudo systemctl status qubes-vm\@My-VM-Name.service"?
> Do you have "enabled" there? Any startup errors reported?

yes, qubes-vm@.service is enabled

error messages (copied by hand)

libxl: error: libxl.c:163:libxl_domain_rename with name "torvm" already
exists
cannot make domainL -6
qube...@My-Test-VM.service: main process exited, code=exited,
status=1/FAILURE
Failed to start Qubes VM My-Test-VM


Note that this error is not reproducible with a standard appvm (I've
tried). I am testing with a proxyvm based on minimal template with torvm
as netvm.

I can manually start the VM with no problem, and it works fine. But
since this is a proxyvm, autostart would be a good thing.

Workaround I found is to create a new vm with no hyphens in the name.

JMP




inf...@gmail.com

unread,
Mar 4, 2015, 10:00:42 AM3/4/15
to qubes...@googlegroups.com, marm...@invisiblethingslab.com
Just wondered if this was ever fixed?

Am still finding

ERROR: Basic tab
Failed to set autostart for VM via systemctl

when I try to check "Start VM automatically on boot" in Qubes VM Manager for my VM called USBVM (which in case relevant grabs one USB controller)

--
CB

inf...@gmail.com

unread,
Mar 21, 2015, 6:03:48 AM3/21/15
to qubes...@googlegroups.com, marm...@invisiblethingslab.com

Just wondering any news - it means the "Creating and Using a USBVM" instructions (https://www.qubes-os.org/wiki/SecurityGuidelines/) won't work (for me)

       qvm-prefs -s usbvm autostart true 

giving error message in dom0

Failed to issue method call: No such file or directory
ERROR: failed to set autostart for VM via systemctl

--
CB

Marek Marczykowski-Górecki

unread,
Mar 21, 2015, 7:01:55 AM3/21/15
to inf...@gmail.com, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is systemd bug... Details here:
https://github.com/QubesOS/qubes-issues/issues/925

I have an idea for a workaround, maybe its time to give up on systemd
folks and implement that.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVDU+bAAoJENuP0xzK19csSrkH+gLziBBEny5+oM9bSzhqDaaa
l38C8mdpKMoafddz2vHA49Wz83ZyZTvJ77ll+o7JbFMi5H4HQgMaIrdWDb/eWPmJ
Yw5BCQgQ//OxcKQv6RiyehkeRTEXbeKQGrp0/sVZd2WFnUJ84KbiPTz0f3KWILaa
pkje9OrMKYjukmDfqZ2ziXvLcb5jk+dDmTUwJiL4M0MZ1DAh1/kqBaJpj5uWsqZ9
hJOVYM4oLTKfmGe4jLSrPmI69np4q1zukdjQy0RmdXxIu+en70N5o2WVUcH9fUzN
K2KODHoP9+l7d+pydA8RzKbwaSCT36TiW7hvG430z42271nr8zYBRO6pUWEZdrE=
=sZNu
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages