Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vbox builder #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output-virtualbox-iso
builds
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Build Ubuntu 22.04 (Beta) with Packer
# Build Ubuntu 22.04 with Packer

This project demonstrates usage of Packer with the new [Ubuntu autoinstaller](https://ubuntu.com/server/docs/install/autoinstall) which was introduced in Ubuntu 20.04 while the classic Debian Installer (d-i) using `preseed.conf` files has been deprecated.

Expand Down Expand Up @@ -45,7 +45,7 @@ Display `gtk` doesn't work on my system, YMMV.



## License
## License

MIT

Expand Down
62 changes: 57 additions & 5 deletions ubuntu-22.04.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
{
"type" : "qemu",
"iso_urls": [
"ubuntu-22.04-beta-live-server-amd64.iso",
"https://releases.ubuntu.com/22.04/ubuntu-22.04-beta-live-server-amd64.iso"
"ubuntu-22.04-live-server-amd64.iso",
"https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso"
],
"iso_checksum": "sha256:39fdd5f7e868ab7981b492a8887dbaec85acf798b209162a37893cb4b209a26b",
"iso_checksum": "sha256:84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f",
"headless": "{{ user `is_headless` }}",
"boot_key_interval" : "50ms",
"boot_wait": "5s",
"http_directory": "http",
"disk_size": "5000M",
"memory": 2048,
"memory": 2048,
"format": "qcow2",
"display": "sdl",
"accelerator": "kvm",
Expand All @@ -35,13 +35,65 @@
"ssh_password": "{{ user `user_pass` }}",
"ssh_timeout": "60m",
"ssh_handshake_attempts": 420
},
{
"type": "virtualbox-iso",
"boot_command": [
"e<wait>",
"<down><down><down>",
"<end><bs><bs><bs><bs><wait>",
"autoinstall ds=nocloud-net\\;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ---<wait>",
"<f10><wait>"
],
"boot_wait": "10s",
"disk_size": 81920,
"guest_os_type": "Ubuntu_64",
"headless": "{{ user `is_headless` }}",
"http_directory": "http",
"iso_urls": [
"ubuntu-22.04-live-server-amd64.iso",
"https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso"
],
"iso_checksum": "sha256:84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f",
"ssh_username": "{{ user `user_name` }}",
"ssh_password": "{{ user `user_pass` }}",
"ssh_port": 22,
"ssh_wait_timeout": "1800s",
"ssh_timeout": "60m",
"ssh_handshake_attempts": 420,
"shutdown_command": "echo '{{ user `user_pass` }}' |sudo -S shutdown -P now",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-ubuntu-22.04-amd64",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"1024"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
]
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "echo '{{ user `user_name` }}' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"execute_command": "echo '{{ user `user_pass` }}' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/cleanup.sh"
}
],
"post-processors": [
[
{
"output": "builds/{{.Provider}}-ubuntu2204.box",
"type": "vagrant"
}
]
]
}