Skip to content

Build a custom Linux Vagrant box#3423

Merged
ipspace merged 2 commits into
devfrom
box-linux
May 21, 2026
Merged

Build a custom Linux Vagrant box#3423
ipspace merged 2 commits into
devfrom
box-linux

Conversation

@ipspace
Copy link
Copy Markdown
Owner

@ipspace ipspace commented May 21, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for building a custom libvirt Vagrant box for the generic linux device by wiring it into the existing netlab libvirt package workflow and documenting the procedure.

Changes:

  • Add NoCloud (cloud-init) ISO contents for the linux device (meta-data + user-data template).
  • Enable box-building for linux in netsim/devices/linux.yml via create_image, create_template, and create_iso.
  • Extend documentation to describe building custom Linux boxes and link it from the libvirt lab index.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
netsim/install/libvirt/linux/user-data.j2 New cloud-init user-data template used when building a Linux libvirt Vagrant box.
netsim/install/libvirt/linux/meta-data New NoCloud meta-data file used to build the bootstrap ISO.
netsim/devices/linux.yml Enables netlab libvirt package linux by defining create_* settings for libvirt packaging.
docs/labs/linux.md Documents the custom Linux Vagrant box build workflow.
docs/labs/libvirt.md Adds a link to the new Linux box-building documentation.
Comments suppressed due to low confidence (1)

netsim/install/libvirt/linux/user-data.j2:24

  • Inside the vagrant user definition, ssh_authorized_keys list items are not indented under the key (the - entries need to be further indented). This makes the YAML invalid and will break cloud-init processing of the user config.
  lock_passwd: true
  ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
  - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1YdxBpNlzxDqfJyw/QKow1F+wvG9hXGoqiysfJOn5Y vagrant insecure public key

Comment on lines +8 to +10
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1YdxBpNlzxDqfJyw/QKow1F+wvG9hXGoqiysfJOn5Y vagrant insecure public key
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not true 🤷‍♂️

Comment on lines +15 to +21
# Create Vagrant user with disabled password
- name: vagrant
plain_text_passwd: vagrant
doas: ["permit nopass vagrant"]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/sh
lock_passwd: true
Comment on lines +4 to +6
ssh_pwauth: true
disable_root: false
datasource_list: [ NoCloud, None ]
ssh_pwauth: true
disable_root: false
datasource_list: [ NoCloud, None ]
ssh_pwauth: true
@ipspace ipspace merged commit 94389b8 into dev May 21, 2026
5 checks passed
@ipspace ipspace deleted the box-linux branch May 21, 2026 16:17
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.

2 participants