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 VirtualBox SSH timeout. #1560

Closed
karcaw opened this issue Mar 29, 2024 · 16 comments
Closed

Ubuntu 22.04 VirtualBox SSH timeout. #1560

karcaw opened this issue Mar 29, 2024 · 16 comments
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@karcaw
Copy link

karcaw commented Mar 29, 2024

Version

bento main/292fdc63dafc8244a792221960273ec921daa4e7
Packer v1.10.2

Environment

Ubuntu 22.04

Scenario

Build the ubuntu20.04 bento box

Steps to Reproduce

bin/bento build -o virtualbox-iso.vm os_pkrvars/ubuntu/ubuntu-20.04-x86_64.pkrvars.hcl

Expected Result

A built .box in the builds directory

Actual Result

==> Starting build for templates:
==> Installing packer plugins
    Shelling out to run packer init -upgrade os_pkrvars/ubuntu/../../packer_templates
- os_pkrvars/ubuntu/ubuntu-20.04-x86_64
==> [ubuntu-20.04-x86_64] Building: 'packer build -timestamp-ui -force -var headless=false -only=virtualbox-iso.vm -var-file=ubunt
u-20.04-x86_64.pkrvars.hcl ../../packer_templates'
virtualbox-iso.vm: output will be in this color.
   
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: Retrieving Guest additions
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: Trying /usr/share/virtualbox/VBoxGuestAdditions.iso
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: Trying /usr/share/virtualbox/VBoxGuestAdditions.iso
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: /usr/share/virtualbox/VBoxGuestAdditions.iso => /usr/share/virtualbox/VBoxGuestAdditions.iso
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: Retrieving ISO
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: Trying https://releases.ubuntu.com/focal/ubuntu-20.04.6-live-server-amd64.iso
2024-03-29T15:46:54-07:00: ==> virtualbox-iso.vm: Trying https://releases.ubuntu.com/focal/ubuntu-20.04.6-live-server-amd64.iso?checksum=sha256%3Ab8f31413336b9393ad5d8ef0282717b2ab19f007df2e9ed5196c13d8f9153c8b
2024-03-29T15:47:00-07:00: ==> virtualbox-iso.vm: https://releases.ubuntu.com/focal/ubuntu-20.04.6-live-server-amd64.iso?checksum=sha256%3Ab8f31413336b9393ad5d8ef0282717b2ab19f007df2e9ed5196c13d8f9153c8b => /home/efelix/.cache/packer/74137c86f91d35e79617069ca73ab76607b2949f.iso
2024-03-29T15:47:00-07:00: ==> virtualbox-iso.vm: Starting HTTP server on port 8410
2024-03-29T15:47:00-07:00: ==> virtualbox-iso.vm: Creating virtual machine...
2024-03-29T15:47:02-07:00: ==> virtualbox-iso.vm: Creating hard drive ../../builds/packer-ubuntu-20.04-x86_64-virtualbox/ubuntu-20.04-amd64.vdi with size 65536 MiB...
2024-03-29T15:47:02-07:00: ==> virtualbox-iso.vm: Mounting ISOs...
2024-03-29T15:47:02-07:00:     virtualbox-iso.vm: Mounting boot ISO...
2024-03-29T15:47:03-07:00: ==> virtualbox-iso.vm: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2629)
2024-03-29T15:47:03-07:00: ==> virtualbox-iso.vm: Executing custom VBoxManage commands...
2024-03-29T15:47:03-07:00:     virtualbox-iso.vm: Executing: modifyvm ubuntu-20.04-amd64 --audio none --nat-localhostreachable1 on
2024-03-29T15:47:03-07:00: ==> virtualbox-iso.vm: Starting the virtual machine...
2024-03-29T15:47:05-07:00: ==> virtualbox-iso.vm: Waiting 5s for boot...
2024-03-29T15:47:10-07:00: ==> virtualbox-iso.vm: Typing the boot command...
2024-03-29T15:47:19-07:00: ==> virtualbox-iso.vm: Using SSH communicator to connect: 127.0.0.1
2024-03-29T15:47:19-07:00: ==> virtualbox-iso.vm: Waiting for SSH to become available...
2024-03-29T16:17:19-07:00: ==> virtualbox-iso.vm: Timeout waiting for SSH.
2024-03-29T16:17:20-07:00: ==> virtualbox-iso.vm: Cleaning up floppy disk...
2024-03-29T16:17:20-07:00: ==> virtualbox-iso.vm: Deregistering and deleting VM...
2024-03-29T16:18:20-07:00: ==> virtualbox-iso.vm: Deleting output directory...
2024-03-29T16:18:20-07:00: Build 'virtualbox-iso.vm' errored after 31 minutes 26 seconds: Timeout waiting for SSH.

==> Wait completed after 31 minutes 26 seconds

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso.vm: Timeout waiting for SSH.

==> Builds finished but no artifacts were created.
==> Not writing metadata file since no boxes exist
==> [ubuntu-20.04-x86_64] Finished building in 31m31.29s.
==> Build finished in 31m35.86s.
>>> Failed Builds:
 ubuntu-20.04-x86_64
 exited

@karcaw karcaw added the Status: Untriaged An issue that has yet to be triaged. label Mar 29, 2024
@karcaw
Copy link
Author

karcaw commented Mar 29, 2024

shot-2024-03-29_09-55-38
Looks like a crash on the console.

I poked around in the shell and found that the DNS config is not getting copied in into the /tmp/tmpXXXX/mount directories, such that chrooting in there and running apt-get is failing.

@Stromweld
Copy link
Collaborator

did you build and install the latest version of bento?

@karcaw
Copy link
Author

karcaw commented Mar 29, 2024

I have bento 3.0.0, running it directly out of the repository. is there a newer version?

@karcaw
Copy link
Author

karcaw commented Mar 29, 2024

trying bento 4.0.2 now

@Stromweld
Copy link
Collaborator

yes it's up to bento 4.0.2 now. If you checkout main and run gem build bento.gemspec then gem install bento-4.0.2.gem that'll install it. There is also a version command now bento version to verify version installed.

@karcaw
Copy link
Author

karcaw commented Mar 29, 2024

The install has the same issue. There just seems to be no DNS config in the chroots under /tmp/tmp*/mount. any idea what part of the installer is supposed to put something there?

@karcaw
Copy link
Author

karcaw commented Mar 29, 2024

VirtualBox_ubuntu-20
it seems there are resolv.conf files, but they point at a stub version, and not a useful one, as it is empty

@Stromweld
Copy link
Collaborator

the command you posted shows trying to run it for vitrualbox-iso.vm only but the output says it's running for qemu.vm? When I run the command you posted for virtualbox everything works as expected. libvirt or qemu are still experimental and may still need extra work to get them working for many OS's.

@karcaw
Copy link
Author

karcaw commented Mar 29, 2024

doh.. I'm having the same issue with both of them, I can get you a log from the VirtualBox one as well... the console logs look a little different now that i have installed the new bento:
shot-2024-03-29_15-50-47

@Stromweld
Copy link
Collaborator

build log would help

@karcaw
Copy link
Author

karcaw commented Apr 3, 2024

This Build log?
ubuntu.build.log

@Stromweld
Copy link
Collaborator

I'm not sure what's going on there. It works on my intel mac mini and on Ubuntu 22.04 github actions machine. https://github.com/chef/bento/actions/runs/8540903336/job/23399029339

@karcaw
Copy link
Author

karcaw commented Apr 3, 2024

what version of virtualbox is on that machine?

@Stromweld
Copy link
Collaborator

vbox: 7.0.14
vagrant: 2.4.1
packer: 1.10.2

@karcaw
Copy link
Author

karcaw commented Apr 3, 2024

Ok, I've moved over to a Rocky9 based system to attempt building on, with a fresh git checkout. Seems to be failing in a different place now. Looks like it time related:
2024-04-03T09:02:02-07:00: ==> virtualbox-iso.vm: E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 6h 21min 11s). Updates for this repository will not be applied.

So it may just be something about my host box, or VirtualBox config that is causing the timeout

@Stromweld
Copy link
Collaborator

sounds like it. I'm going to close this issue then.

@Stromweld Stromweld closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
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

2 participants