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

Ubuntu 22.04 bento virtual box build fails when curtin errors out (despite netplan fix) #1564

Open
agafonoo opened this issue Apr 10, 2024 · 6 comments
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@agafonoo
Copy link

Version

ubuntu-22.04-x86_64

Environment

The host OS is Ubuntu also.

Scenario

I am using Bento to build an Ubuntu 22.04 box with virtualbox as a provider.

Steps to Reproduce

bento build --only virtualbox-iso.vm --gui os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl

Expected Result

The build should finish normally.

Actual Result

Instead, I get the following curtin error:

Screenshot from 2024-04-10 10-58-34

I already fixed my user-data file with the netplan fix, so that's not the issue:

image

@agafonoo agafonoo added the Status: Untriaged An issue that has yet to be triaged. label Apr 10, 2024
@Stromweld
Copy link
Collaborator

what version of packer and virtualbox are you running? Currently this is building fine on github hosted runners wich is running ubuntu 22.04 and latest packer/virtualbox versions https://github.com/chef/bento/actions/runs/8622371120/job/23633406501

@agafonoo
Copy link
Author

I have Packer v1.10.2 and VirtualBox version 7.0.12 r159484. Let me upgrade to 7.0.14 and see what happens.

@agafonoo
Copy link
Author

image

After upgrade to VirtualBox version 7.0.14, confirmed that I am getting the same error.

@Sn0wCrack
Copy link

Sn0wCrack commented May 10, 2024

I had this same issue in building for qemu.

I edited packer_templates/http/ubuntu/user-data and replaced the first late-commands that has the if statement in it and replaced it with a previous version of this command:

- 'sed -i "s/dhcp4: true/&\n      dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'

I get past the initial netplan provisioning, but some networking features don't work post reboot and the provision fails as the VM can't resolve DNS for raw.githubusercontent.com

EDIT:

Got it working in the end by removing the netplan fix instead, image built without issues in the end and also worked without issues after importing it into vagrant, provisioning the VM and using it as normal.

@svpernova09
Copy link
Contributor

EDIT:

Got it working in the end by removing the netplan fix instead, image built without issues in the end and also worked without issues after importing it into vagrant, provisioning the VM and using it as normal.

Confirming that removing

    - |
      if [ -f /target/etc/netplan/00-installer-config.yaml ]; then
        'sed -i "s/dhcp4: true/&\n      dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'
      fi

from packer_templates/http/ubuntu/user-data allows the image to be built successfully. Tested with Vagrant and the VM boots and runs as expected.

Tested on Packer 1.9.4 Parallels Version 19.3.1 (54941)

@Stromweld
Copy link
Collaborator

unfortunately removing that line causes other issues for bringing up multiple ubuntu boxes and them getting the same IP address. This netplan line is supposed to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants