The backup copied data/secret_key, which does not exist when SECRET_KEY
comes from the environment (Docker then makes none) and can differ from
the key in use: a restored panel signed everyone out and could not read
what it had signed. The backup now writes settings.SECRET_KEY.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The README offered "edit webvirtcloud/settings.py" as a place for the
environment variables, but settings.py reads them from the environment:
WEBVIRTCLOUD_HTTPS = 1 written there changes nothing. It now says so and
names the setting to change instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The services read their environment from /etc/default/webvirtcloud, but
a re-run of the installer and the README's update and rollback steps ran
manage.py migrate without it: with WEBVIRTCLOUD_DB_HOST set there, the
migrations went to the fallback sqlite file and PostgreSQL kept the old
schema. All three now load the file first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
send_mail got no sender, so the OTP mail went out from Django's default
webmaster@localhost, which relays that take mail only from their account
refuse. DEFAULT_FROM_EMAIL is now read from the environment, defaulting to
EMAIL_HOST_USER.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Docker builds settings.py from the template, whose TIME_ZONE was fixed to
UTC: TZ in docker-compose moved the container's clock and its backup time
but not the panel's dates, and Django then reset the process's TZ to UTC.
TIME_ZONE is now TZ, or UTC; the installer still writes the server's
zone into settings.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
WEBVIRTCLOUD_LOG_FILE=panel.log made os.makedirs("") raise while the
settings loaded: the panel did not start. A relative path is now taken
from the panel's directory, like the default data/webvirtcloud.log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Django matches the request's host with each ALLOWED_HOSTS entry as a name:
192.0.2.0/24 was accepted and matched nothing, so requests to the
addresses in it got 400 with no sign why. Such an entry now raises
ImproperlyConfigured, naming it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
WEBVIRTCLOUD_DEBUG, WEBVIRTCLOUD_HTTPS, WEBVIRTCLOUD_SERIAL_CONSOLE and
EMAIL_USE_TLS compared their value with "1": EMAIL_USE_TLS=true turned
STARTTLS off, and WEBVIRTCLOUD_HTTPS=true left the cookies insecure,
without a word. env_flag takes 1 or 0 (unset is the default, empty is 0
as before) and raises
ImproperlyConfigured, naming the variable, on anything else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
DEBUG was fixed to False in the template, and Docker builds settings.py
from it in each container: debug mode could only be had by editing the
file inside a running container. It is now read from the environment like
the other options; off unless the variable is 1.
The toolbar's URLs follow settings-dev, which installs the toolbar, not
DEBUG: with the dev packages present, DEBUG alone imported them without
the app and every URL lookup failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
nginx answers /static/ from staticfiles/ before a request reaches gunicorn,
so WhiteNoise never served a file in an installed panel. It only answered
under runserver with DEBUG off, from staticfiles/ as the last collectstatic
left it: a stale copy without the themes broke the page. The dev server
serves the sources itself with DEBUG on, or with --insecure, which the
README now says.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
socketiod refused a request without a signed-in session, but took a
token from anyone's session: a token read from a log or a URL opened
another user's serial console for 120 s. As novncd does, the session
must be the token's user's; the refusal is the page's "not allowed".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Creating, cloning, migrating and deleting VMs are jobs: with the dev
server alone they stay queued. The step starts run_worker with the dev
settings in another terminal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The datasource names the VM by the reverse DNS name of the request's
address and sends keys only when its first label is one VM's name. On
the console settings, the listen address and removing the password of
a console listening beyond localhost are a superuser's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
An API request with invalid fields answers DRF's field errors, not
{"detail": ...}. The new VM's machine is chosen on a page before the
details form. The Logs page records 401 and 403 answers; a VM hidden
from a user answers 404 and is not logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
webvirt-backup.timer has RandomizedDelaySec=10min and Persistent=true:
it runs up to 10 minutes after 03:15, and at the next boot when the
server was off then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The serial console refuses a request without a signed-in session before
it reads the token, and noVNC accepts a token only in its user's
session: the token alone does not open a console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Only a queued job or a running clone, migration, disk move or ISO upload
can be cancelled (the other kinds are not cancellable once running).
Freezing the guest's file systems is an option of a snapshot without
memory. instances.view_instances shows every VM read-only, besides the
VMs assigned to a user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The RHEL family 10 computes run libvirt's modular daemons (the bootstrap
enables virtqemud.socket), where no libvirtd is there to restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
docker stop -t 95 without a container fails with "requires at least 1
argument"; compose names it webvirtcloud.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Both blocks of Moving to a new machine restore $b/db.sqlite3, which a
backup of a PostgreSQL panel does not have, so the chain stopped there.
The section says to restore PostgreSQL by hand and leave that line out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The installer block copied the backup's SSH keys with cp "$b"/ssh/*:
a backup of a panel without keys has an empty ssh/ directory, the glob
stays unexpanded, cp fails and the rest of the && chain is skipped. It
copies the directory's contents as the pki line does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
The password reset and the behaviour changes' session and lockout
commands ran a bare python3 manage.py, which on an installer host fails
with "Couldn't import Django" (the packages are in the venv) and had no
Docker form. They name the venv's python as the web service user, and
the Docker exec form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
gunicorn.conf.py starts 2 x CPUs + 1 workers, at most 8, about 140 MB
each: 1.1 GB on the deployed host for a panel. The image now runs 4,
which still sends up to 8 requests at a time to one compute and leaves
threads for the others when one hangs. GUNICORN_CMD_ARGS in
docker-compose.override.yml sets another number; installs outside
Docker keep their default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
phusion/baseimage brought sshd, syslog-ng, my_init and runit's per
service scripts, and an nginx log forwarder tailing a file. The image
is now ubuntu:26.04 with Ubuntu's supervisor: conf/docker holds the
start script (settings, secret key, ownership, migrations as www-data),
one supervisord.conf for the six processes, nginx's config with errors
to docker logs, the backup's cron line and the health check. A stop
signals every process at once, so the worker keeps its 60 s drain
within the 95 s grace. The same volumes and container name work as
before; README runs commands with exec -u www-data in place of
/sbin/setuser. The image goes from 805 MB to 642 MB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
Python 3.14 starts processes with forkserver, which Django 5.2's parallel
runner does not support: its workers import the tests before
django.setup() and fail (AppRegistryNotReady), and `--parallel` without a
number falls back to one process. The project's test runner sets the
start method to fork, as it was up to 3.13. The production image runs
Python 3.14 (Ubuntu 26.04): CI adds it, and the parallel run moves to that
leg.
Tried on Ubuntu 26.04's Python 3.14: `test --parallel 4` and `--parallel`
(8 processes) pass; before, both hung.
The newest noble tag is noble-1.0.3; the image now starts from the 26.04
LTS one: Python 3.14 and libvirt 12. Tried: the image builds, starts
healthy with every service, connects a compute over TCP, and the main
pages, the VM page with its graphs and the new VM form render without
errors; the test suite passes on Python 3.14 (Ubuntu 26.04).
- The root password's SHA-512 crypt hash comes from libpass (the maintained
passlib fork, pure Python) instead of crypt-r, a copy of the stdlib crypt
module gone in Python 3.13: crypt-r ships no wheels and its build needs
crypt.h, which Ubuntu 26.04 no longer brings with python3-dev, so the
installer and the manual installation failed there. The hash is the same
format ($6$, now with libpass's 656000 rounds), checked with glibc's crypt.
- The README's RHEL compute packages left out python3-libguestfs, which
gstfsd imports with the system python: setting the password or key of a
shut-off VM failed there.
- The tests read YAML themselves and had PyYAML only through
drf-spectacular.
Adding a Compute Node told the panel's side of TLS only and nothing of the
SASL login the bootstrap script makes libvirt ask for over TCP: a host set
up as written refused the panel. It now gives the saslpasswd2 step and the
compute's CA, server certificate and TLS socket (tried on a test compute).
- libvirt errors all answered 400. A VM, pool or volume the host does not
have now answers 404, a volume in use 409 (vrtManager.util.InUse) and a
host that cannot be reached 503, which a client may retry.
- A template's power on or cycle and a stopped pool answered
{"status": ...} with 409; they answer {"detail": ...}, as every other
refusal. The schema documents these 409s (ErrorSerializer).
- The volume list and a volume of a stopped pool answered 200 with an
empty list or a made-up volume; they answer 409.
- An API URL that names nothing answered the HTML error page; it answers
a JSON 404 after the API's authentication.
- A session that must change its password was redirected to the HTML
form; an API request of it gets the JSON 403 a token gets.
Restoring only the database on newer code copied the backup's old
settings.py back and ran no migrations: a backup from v4.3.0 brought back
RemoteUserMiddleware and left the password validators and WAL out, with
seven migrations pending. The restore runs migrate, which changes nothing
on a rollback, and the text names every line that takes a file from the
backup.
Since the VM create became a job (6f0c7300) every new VM was defined with
no VNC password, and a clone copied its source's password (or its lack
of one) exactly: every clone of a template shared it. Computes listen
for VNC on all their addresses (dev/libvirt-bootstrap.sh), so anyone who
could reach a compute's VNC ports opened any of these consoles directly,
without the panel; the README's firewall rule was the only guard.
The create job asks for create.py's random 8-character password again,
and a clone's VNC graphics get a new random one. The console page sends
the password to a user with passwordless_console, which the user create
form now ticks by default next to change_password; a user without it is
asked for the password, as the permission intends. Existing VMs keep
their settings.
Live create, clone and VM page tests pass on a TCP compute.
An administrator resets a password to close an account someone else
took over, but the API tokens stayed valid: a stolen token kept working
with the new password, for as long as it was made to last. Setting a
password on the user's Password page now deletes that user's tokens,
and the page says so. A user who changes their own password keeps their
tokens (scripts keep working); they can delete them on their profile.
Step 2 rebuilds settings.py from the template, whose DATABASES is sqlite
unless WEBVIRTCLOUD_DB_HOST is set; its list of values to put back did
not name DATABASES. An installation that set PostgreSQL in settings.py
(the only way before the WEBVIRTCLOUD_DB_* variables) would have migrate
make a new, empty sqlite database and the panel start on it.
Checked by upgrading an installation of the upstream release of
September 2026 on PostgreSQL 16 with DATABASES put back: every user,
permission, owner, compute, VM and log row came through.
Installers up to September 2026 wrote SECRET_KEY into settings.py and
made no data/ directory. Step 2 said that leaving the key out signs every
user out; in fact the template then has no key at all: migrate in step 3
stops with "The SECRET_KEY setting must not be empty" and every page
answers 500. The step now says to create data/ first and what happens
without the key.
Checked on an installation of the upstream release of September 2026
upgraded to this version, with data/secret_key moved away and back.
Every upstream release and this fork's up to v2.0.0 created the first
user as admin/admin. The first-login password change only covered the
password the panel generates itself (data/admin_password), so an upgraded
installation whose admin never changed the default kept a working
admin/admin login with no prompt, on the pages and through API tokens.
Migration accounts.0013 marks a user named admin whose password is
"admin" with must_change_password: the next login goes to the password
change form, and the API refuses the user's tokens until then. Only that
one name is checked, so the migration hashes one password at most.
Found by upgrading an installation of the upstream release of
September 2026 (installer and Docker) to this version: admin/admin still
signed in.
Installers up to September 2026 ran collectstatic into the tracked static/
(which changed static/drf-yasg and static/rest_framework files) and deleted
the tracked install.sh and webvirtcloud.sh. Step 1 put back only
static/css and dev/scss, so `git pull` refused with "Your local changes
would be overwritten" on every such installation, and the later steps ran
on the old code. Step 1 now puts back every tracked file under static/ and
the two installer scripts.
Checked by installing the upstream release of September 2026 with its own
installer on Debian 12, Ubuntu 24.04 and AlmaLinux 10, and following the
update steps to this version.
- Deleting VMs and moving disks are jobs too (Features, Behavior
changes, architecture), and the API's delete answers 202.
- Docker keeps the TLS client certificates in webvirtcloud-pki.
- The manual installation covers Ubuntu 26.04 and Debian 13, says lxml
is reused like libvirt-python, and adds the service user to the
libvirt and kvm groups, as the installer does, for a socket compute.
- Moving to a new machine starts in the clone's directory (Docker) and
copies secret_key only when the backup has it (installer); the
off-site steps run in the panel's checkout; an update's backup also
holds /etc/default/webvirtcloud and local-migrations.tar.
- A kept settings.py is rebuilt from the template instead of patched by
a list that had fallen behind (knox, axes, four middlewares).
- gstfsd on 127.0.0.1 serves a panel that adds its compute as localhost;
LOGIN_TRUSTED_PROXIES matters only for a proxy on another machine;
socket computes reach a localhost console too.
- New passwords pass Django's validators (Behavior changes).
- permissions: a VM an administrator paused stays paused for owners.
- architecture: nginx listens on 80, on 443 only with your TLS.
- Running tests: the libvirt layer's tests are in vrtManager/tests.
- create_admin had a branch for `"test" in sys.argv` that gave the admin
the password "admin"; 17 places signed in with it, and failed silently
with ADMIN_PASSWORD set in the environment. The tests now make their
own superuser and force_login it, and the shipped code has no test
branch: the test runner gives migrate a password (also when
ADMIN_PASSWORD is set but empty), so no data/admin_password is written
into the checkout.
- AccountsTestCase builds its rows in setUpTestData instead of
setUpClass and deleting them by hand.
- accounts tests set OTP_ENABLED with override_settings instead of
assigning settings (one assignment was never undone, so later tests in
the process ran with OTP on), and undo their app_settings change. The
OTP login class reloads the URLs again only after the setting is off.
- computes/tests/test_views.py reached the machine's own libvirt
(localhost over the socket) when TEST_LIBVIRT_HOST was unset; its live
tests now run only with TEST_LIBVIRT_HOST, like the other live tests,
as the README says.
The delete ran in the request: undefine, then the VM's record, then its
disk files. A request that died in between (a gunicorn worker past its
timeout, OOM, a restart), or a database write that failed after the
undefine, left a record that later showed as removed outside the panel,
and the disk files the user asked to delete were never deleted.
Deleting a VM is now an instance.delete job. It holds the compute
exclusively, as the request did, so no other VM attaches a file it is
about to delete. The job chooses the files before it stops the VM (a host
that cannot be checked still stops nothing) and records them first. It
then stops and undefines the VM, removes its record, and deletes the
files, each with its own Logs row. Recovery decides from libvirt: a VM
still on its host means the delete failed; a VM gone means libvirt did
it, so recovery removes the record and deletes the recorded files that
are still there.
The page queues the job and returns to the VM page, where the job panel
follows it and opens the VM list when it ends; disks that were kept are
the result's warning. The API's delete answers 202 with the job and
needs a submission_key. backing_path moves to wvmConnect, as recovery
has no domain to ask.
The update steps wrote the copy straight to $b/db.sqlite3: the shell
creates the file before the copy runs, so a copy that failed left an
empty or partial db.sqlite3 next to the commit, which looks like a good
backup. Restoring from it put an empty database in place, and the panel
came back with no users, computes or VMs. The copy is now written to
db.sqlite3.part and renamed when it succeeds, in the Docker and the
installer steps.
A panel that takes SECRET_KEY from its environment has no data/secret_key,
so its backup has none. The Docker moving steps copied it
unconditionally: the copy failed after the database had already been
replaced, and the chain stopped before node_id, the SSH keys and `up -d`.
The copy is now skipped when the backup has no key, and the section
says to set the same value on the new machine. It also says to stop the
old panel first when both use one PostgreSQL database: the moved worker
id would let both workers take each other's lease and jobs.
libvirt reads a TLS compute's client certificate from the panel user's
~/.pki/libvirt. In Docker that was /var/www/.pki inside the container,
so `docker compose up -d --build` dropped it and every TLS compute
stopped connecting; no backup held it on either install type, although
"Moving to a new machine" says the backup carries what the computes
accept, and the README never said where the certificates go.
Docker keeps /var/www/.pki in a webvirtcloud-pki volume, owned by
www-data and private like ~/.ssh; the backup copies ~/.pki into pki/;
the moving steps put it back; and "Adding a Compute Node" says where the
files go.
The Lost OTP? page, open without a login, and the admin's Email OTP QR
code mailed the QR code itself: the TOTP secret then stayed in the
mailbox and on every server the mail passed. The mail now carries a
signed link, good for an hour, to a page that shows the QR code (not
cached); the page shows nothing for an old or altered link or a user
without a device. tr and zh too.
Each 401 or 403 answered to a signed-in user or to a request with
credentials (an API token) writes "Access denied (status): method path"
with the user and the address. Anonymous refusals are left out, so a
scanner cannot fill the table.
On an AlmaLinux 10 host with SELinux enforcing, the installer finished
with exit 0 but the panel's four services never started: chcon labelled
the virtualenv httpd_sys_rw_content_t, which systemd may not execute
(status 203/EXEC, Permission denied), and the login page answered 502.
The README's manual steps did the same with httpd_sys_content_t. chcon
labels also went on a relabel, after which nginx got 403 for the
static files.
Now the installer writes file context rules, httpd_sys_content_t for
the panel and bin_t for venv/bin, restores the labels from them, and
does so whenever SELinux is enabled, not only when it enforces. The
manual steps add the bin_t rule and policycoreutils-python-utils (for
semanage).
The README said external snapshots need libvirt 9.9 or newer. The live
suite against an openEuler 24.03 LTS compute (libvirt 9.10) showed that
reverting a snapshot taken without memory of a running or paused VM is
refused there ("Invalid target domain state 'disk-snapshot'"); libvirt
11.10 on the test computes reverts it.
The compute bootstrap found openEuler but had no install function for
it, so it stopped. Now it installs qemu, libvirt, python3-libguestfs
and cyrus-sasl (openEuler's names; it has no EPEL), applies the RHEL
family's qemu.conf, SASL and gstfsd steps, and runs the monolithic
libvirtd with its TCP socket: openEuler 24.03 ships modular daemons
only for qemu and the proxy.
Tested in an openEuler 24.03 container with /dev/kvm: the full live
suite over TCP (SASL) ran 2145 tests. What failed is libvirt 9.10's
(reverting a running VM's external snapshot, live clone needs 11.10),
the test host's (no pool named default), and its SeaBIOS, which
prints no banner on the serial port.
The removed openEuler branch only took 20.03, whose Python 3.7 cannot
run the panel. 24.03 LTS has Python 3.11: it installs like the RHEL
family, with the packages under their openEuler names (iproute holds
tc, cyrus-sasl the MD5 mechanism) and the RHEL family's main nginx
config. Other openEuler versions are refused with the supported one.
Tested on Ubuntu 22.04, 24.04 and 26.04, Debian 12 and 13, AlmaLinux 10
and openSUSE Leap 15.6. On Leap the panel did not start: the secret key
was written with python3 before the installer looked for Python 3.10+,
and Leap has only python3.11, so the key was empty. The installer still
said "Finished!" and exited 0, as it did for any failed step.
Now Python is found first. The package list update, each package, the
clone, the key, pip, migrate and collectstatic stop the installer with
a message when they fail (pipefail makes a logged step's status count).
Also:
- Ubuntu 26.04 is installed; Ubuntu 18/20 and Debian 9-11 are refused
up front (their Python is older than 3.10, so they failed later).
- The uos and openEuler branches are gone: untested, and their Python
is too old as well.
- Only `apt-get update`, no upgrade of the whole system.
- Debian no longer asks for smbios-utils (gone in Debian 13) and uuid,
which nothing uses; Debian and Ubuntu take python3-libvirt.
- RHEL reads the time zone like the others, and installs hostname for
ALLOWED_HOSTS.
- The unused wvcuser account is no longer created.
- The end of the run says where the admin password is.