System libvirt control daemon for the webvirt project
To compile webvirtd, it must first be configured using meson:
## Release build
$ meson setup --buildtype release -Dtests=false builddir
## Development build
$ meson setup --buildtype debug -Db_coverage=true builddir
## Development build without binary
$ meson setup --buildtype debug -Db_coverage=true -Dbinary=false builddir
After configuration, users can build the project using ninja or samu:
$ (ninja|samu) -C builddir
To install the project, run the install target after compilation:
$ meson -C builddir install --skip-subprojects
Note: --skip-subprojects is recommended here, as subprojects are built statically and do not need to be housed within the root filesystem. In addition, these subproject installations can conflict with Linux distribution packages which install the same projects.
What the meson install target does:
- Installs systemd services to
{prefix}/lib/systemd/system
- Creates the
webvirt
user utilized by the systemd service
Before continuing, you should configure libvirt user access.
The webvirtd binary contacts libvirtd using the qemu+ssh
protocol. Therefore, libvirtd
access depends on authentication provided by SSH.
See libvirt user access for details on configuring libvirtd access control.
In development, webvirtd can be run directly by any user:
$ ./builddir/src/webvirtd --help
Users should ensure that --socket
used with webvirtd and WEBVIRTD_SOCKET
used with webvirt_api are matched,
and that webvirt_api has permission to
converse with webvirtd's socket.
In production, webvirtd should be run using the systemd services provided by install:
## Enable at boot and start the service
# systemctl enable --now webvirtd.service
The unix socket deployed by webvirtd.service resides at
/var/run/webvirtd/webvirtd.sock
. To access the unix socket, the accessing user
must be in the webvirt
group:
# gpasswd -a some_user webvirt
# sudo -u some_user curl \
--unix-socket /var/run/webvirtd/webvirtd.sock \
http://localhost/users/test/domains/
Read the API documentation at SwaggerHub: https://app.swaggerhub.com/apis-docs/kevr/webvirtd
This project operates under the Apache 2.0 LICENSE along with an Apache 2.0 NOTICE which contains attributions of work.