canonical / canonical/workshop
feat: Support LXD virtual machines as a workshop backend
- Dominant language
- Go
- Stars
- 108
- Forks
- 17
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 40
Description
Workshop currently creates development environments exclusively as LXD containers. This issue proposes adding support for LXD virtual machines (VMs) as an alternative backend, enabling use cases that require stronger isolation, a full kernel, or hardware-level features not available in containers.
Motivation
Some workflows require capabilities that containers cannot provide:
- Kernel module development or custom kernel testing
- Nested virtualisation (e.g. running KVM inside the workshop)
- Stronger isolation guarantees (e.g. security-sensitive workloads)
- Testing OS-level behaviour that differs between container and VM environments
Current behavior
The instance type is hardcoded to [api.InstanceTypeContainer](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) in multiple places across the LXD backend. There is no way for users to request a VM-backed workshop.
Proposed change
Introduce a type field in [workshop.yaml](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) (defaulting to container) that users can set to vm:
```
name: dev
base: ubuntu@24.04
type: vm
limits:
cpu: 4
memory: 4GiB
```
Contributor guide
Assessment
This issue has not been assessed yet.