Skip to content

Initial support for VMs - #911

Draft
jonathan-conder wants to merge 8 commits into
mainfrom
feature/vm
Draft

Initial support for VMs#911
jonathan-conder wants to merge 8 commits into
mainfrom
feature/vm

Conversation

@jonathan-conder

@jonathan-conder jonathan-conder commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

TODO

  • Add an internal reverter to start-workshop task
  • Improve test coverage
  • Test workshop info and other commands that might have issues without a system SDK

Self-review quick check

  • Make decisions that cost a lot to reverse explicit in the PR description.
  • Avoid nested conditions.
  • Delete dead code and redundant comments.
  • Normalise symmetries by sticking to doing identical things identically.
// one way to handle errors
if err := f(); err != nil {
   ...
}

// one way to handle multiple returns
val, err := f()
if err != nil {
   ...
}
...
  • Check that coupled code elements, files, and directories are adjacent. For example, test data is stored as close as possible to a test.
  • Put variable declaration and initialisation together.
  • Divide large expressions into digestable and self-explanatory ones. Use multiple variables if required.
  • Put a blank line between two logically different chunks of code.
  • Follow the style guide for new error messages.

Docs

Procedure:

  • I have checked and added or updated relevant documentation.
  • I have checked and added or updated relevant release notes.
  • I have included the technical author in the review.

Content:

  • Headings and titles accurately describe the content.
  • New and updated pages include correct metadata.
  • Documentation tests are added or updated where applicable (for tutorial/ and how-to/ sections).
  • Documentation follows the style guide.
  • If needed, docs/.coverage.yaml updated, coverage tags added (.. artefact).

Or:

  • I confirm the PR has no implications for documentation.

@jonathan-conder jonathan-conder self-assigned this Jul 3, 2026
@jonathan-conder
jonathan-conder force-pushed the feature/vm branch 4 times, most recently from 5129f33 to c5ebeb3 Compare July 20, 2026 00:16
@jonathan-conder
jonathan-conder force-pushed the feature/vm branch 8 times, most recently from 194cc9f to fdc3922 Compare July 28, 2026 07:05
Initially this field doesn't do much; optionally users can add
`confinement: container` to their workshop definition files. But soon
we'll add support for `confinement: virtual-machine`.
@canonical canonical deleted a comment from Copilot AI Aug 2, 2026
Add support for LXD VMs in the backend, but keep them disabled in
workshop definition files for now.

VMs don't currently support SDKs, due to [1], so we even disable the
system SDK.

[1] canonical/lxd#18686
VM instance templates are applied by the LXD agent, which is a systemd
service and therefore can't modify the machine ID. When /etc/machine-id
is missing, systemd creates one based on the SMBIOS UUID. For us, this
means launchOrRebuildFromImage works fine.

However, launchOrRebuildFromSnapshot doesn't. Since VMs only support
SFTP while running, it's not easy to just delete /etc/machine-id after
taking the snapshot. Instead we can tell systemd to always use the UUID
via a kernel parameter. Since VM images use GRUB as a bootloader, the
kernel command line needs to be configured through GRUB. We accomplish
this with a custom GRUB script and drop-in config file.
@jonathan-conder
jonathan-conder force-pushed the feature/vm branch 2 times, most recently from 90f81aa to ba3ac38 Compare August 3, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant