You are not logged in.

#1 2023-01-20 14:12:13

bachtiar
Member
Registered: 2005-02-08
Posts: 60

Autostart libvirt guests via systemd for a regular user

I have a QEMU guest managed through libvirt as a regular (non-root) user. To start/stop it manually, I run "virsh start/stop" as that user, or alternatively, I start them via virt-manager (via "qemu:///session" URI).

Now I want to autostart/autostop this guest as a systemd service at system boot/shutdown. I have read through libvirt wiki page as well as man page for libvirt-guests, but it looks to me as if it only supports system sessions (i.e. guests that run as root).

Is it possible to use this service to also start/stop guests running under regular users' accounts? If yes, how? And if not, what would be the analogous way of doing it?

Last edited by bachtiar (2023-01-20 14:16:10)

Offline

#2 2023-01-20 15:39:30

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,763

Re: Autostart libvirt guests via systemd for a regular user

Create a libvirt-guests user service...
https://wiki.archlinux.org/title/Systemd/User


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB