chef / bento

Packer templates for building minimal Vagrant baseboxes for multiple platforms
Apache License 2.0
4.25k stars 1.12k forks source link

Add Ubuntu 24.04 LTS #1567

Closed fsimonis closed 7 months ago

fsimonis commented 7 months ago

Describe the Enhancement

Add support for creating boxes for Ubuntu 24.04 LTS.

Describe the Need

Newest release

Current Alternative

Latest supported release is 23.10

Can We Help You Implement This

I did some initial work on my fork: I added the necessary os_pkrvars for Ubuntu 24.04 LTS (noble). The boot command seems to work fine.

Currently, autoinstall fails during the following late_command because /target/etc/netplan/ is empty:

https://github.com/chef/bento/blob/db7858d0d0a8d58bee5778851162a9560c9cb10a/packer_templates/http/ubuntu/user-data#L17

Removing the command results in a successful build.

Testing

I tested the build using qemu:

bundle exec bento build --cpus 20 --only qemu.vm --mem 4000 --gui os_pkrvars/ubuntu/ubuntu-24.04-x86_64.pkrvars.hcl

I was able to run the libvirt and the qemu version, login, and access the network:

$ cd builds
$ vagrant init ./ubuntu-24.04-x86_64.libvirt.box
$ vagrant up --provider=libvirt
$ vagrant ssh
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-31-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

 System information as of Fri Apr 26 11:53:13 AM UTC 2024

  System load:  0.8                Processes:             111
  Usage of /:   16.1% of 30.34GB   Users logged in:       0
  Memory usage: 38%                IPv4 address for eth0: 192.168.121.117
  Swap usage:   0%

This system is built by the Bento project by Chef Software
More information can be found at https://github.com/chef/bento
vagrant@vagrant:~$ sudo apt install binutils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  binutils-common binutils-x86-64-linux-gnu libbinutils libctf-nobfd0 libctf0 libgprofng0 libsframe1
Suggested packages:
  binutils-doc gprofng-gui
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu libbinutils libctf-nobfd0 libctf0 libgprofng0 libsframe1
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,356 kB of archives.
After this operation, 19.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Testing this on noble is a bit tricky as vagrant doesn't provide packages for noble yet and the virtualbox-dkms package for noble doesn't support the kernel.

Stromweld commented 7 months ago

I just released an update now that fixes the late-command. I tested and built new Ubuntu 24.04 boxes and uploaded them to vagrant cloud.

fsimonis commented 7 months ago

@Stromweld could you please also upload a libvirt box? :pray:

Stromweld commented 7 months ago

I just pushed libvirt builds for x86_64 if you want to give them a try.

fsimonis commented 6 months ago

Works fine! Thanks a lot!

darensipes commented 6 months ago

Would it be possible to also get arm64 versions also pushed out to vagrant cloud?

Stromweld commented 6 months ago

There are https://app.vagrantup.com/bento/boxes/ubuntu-24.04. You need to use vagrant 2.4.0+ to use the new arch setting. It defaults to the cpu arch of the workstation.