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

Packer 1.8.4 not working with Virtualbox 7.0.4+ #12118

Open
breisig opened this issue Nov 18, 2022 · 13 comments
Open

Packer 1.8.4 not working with Virtualbox 7.0.4+ #12118

breisig opened this issue Nov 18, 2022 · 13 comments

Comments

@breisig
Copy link

breisig commented Nov 18, 2022

I am building Rocky Linux 9 boot iso images using packer+virtualbox[virtualbox-iso] with a kickstart file and it works great with Virtualbox 6.1.xx, However when running the latest Virtualbox 7.0.4 [and I think all Virtualbox 7.xx versions], it seems during the Rocky Linux installation where it tries to download the kickstart file from 10.0.2.2, it doesn't seem to be able to get the file anymore. It says "curl: (28) Failed to connect to 10.0.2.2 port 8235: Connection timed out"

Reproduction Steps

Upgrade from Virtualbox 6.1.xx to the latest 7.xx

Packer version

packer v1.8.4

OS Version

Windows 11 22H2 Pro

image

@breisig breisig added the bug label Nov 18, 2022
@github-actions github-actions bot removed the bug label Nov 18, 2022
@afagund
Copy link

afagund commented Nov 19, 2022

Same problem here running packer 1.8.4 and virtualbox Version 7.0.2 r154219 (Qt5.15.3)

@hswong3i
Copy link

hswong3i commented Nov 19, 2022

image

Case similar here: Ubuntu 22.10 host + packer 1.8.4 + VirtualBox 7.0.4 + Debian 11, with error message Failed to retrieve the preconfiguration file.

Working fine with Ubuntu 22.04 host + packer 1.8.4 + VirtualBox 6.1.40 + Debian 11: https://gitlab.com/alvistack/vagrant-debian/-/jobs/3345658507

My packer.json: https://github.com/alvistack/vagrant-debian/blob/a2286d4f/packer/debian-11-virtualbox/packer.json

@cedricroijakkers
Copy link

I am having the same problem with Packer 1.8.4 with VirtualBox 7.0.4r154605 on host OS Arch Linux.

As far as I can see, the problem is that the (in my case) Ubuntu 22.04 guest OS does not seem to have network connectivity, and therefore cannot download the autoinstall files from the http directory.

@etho201
Copy link

etho201 commented Nov 23, 2022

Same issue here.

I've found a prominent blog that also describes the issue: https://oracle-base.com/blog/2022/11/20/virtualbox-7-0-4-and-vagrant-2-3-3-another-virtualbox-fail/

If I attempt to use Packer, it will fail to find the kickstart file, which it attempts to access over HTTPS. Both cases seem to be network related.

Packer just doesn’t work. It fails getting the HTTP access to the kickstart file.

@noroutine
Copy link

hit this when trying to build RHEL9 image on Mac OS 13.0.1 (22A400), packer v1.8.4, vbox 7.0.2 r154219 (Qt5.15.2)

@noroutine
Copy link

noroutine commented Dec 3, 2022

After some headscratching, have found the (not ideal) workaround.

Go to Tools > Network > NAT Networks
Create any network, say NatNetwork with IPv4 prefix of 10.0.2.0/24

Screenshot 2022-12-03 at 23 12 15

While build is spinning up, quickly go to vm settings and switch network adapter from NAT to NAT Network and choose your created NatNetwork

It appears to me there is an issue with virtualbox default 'NAT' networking.

In the end i just ended up putting kickstarter config elsewhere, which luckily worked without issues

@Zotteljedi
Copy link

I just had the same issue with a Debian preseed scenario. I noticed that a VM created using the VirtualBox GUI works fine. So I compared the .vbox files and found (among others) this difference:

<NAT localhost-reachable="true"/>

I ended up with adding this section to my virtualbox-iso source configuration:

  vboxmanage = [
    ["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
  ]

"Works on my machine."

@breisig
Copy link
Author

breisig commented Dec 6, 2022

Interesting,

I enabled it also in my virtualbox-iso on Virtualbox 7.0.4 and it worked. I wonder why this has to be enabled where it didn't in earlier versions?

vboxmanage = [
    ["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
  ]

hswong3i added a commit to alvistack/vagrant-devel that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-fedora that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-ceph that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-centos that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-kubernetes that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-debian that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-rhel that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-ubuntu that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/vagrant-opensuse that referenced this issue Dec 6, 2022
hswong3i added a commit to alvistack/ansible-role-virtualbox that referenced this issue Dec 6, 2022
fritshoogland-yugabyte pushed a commit to fritshoogland-yugabyte/vagrant-yugabyte that referenced this issue Dec 8, 2022
oraclebase pushed a commit to oraclebase/vagrant that referenced this issue Dec 8, 2022
sei-mkaar added a commit to cmu-sei/foundry-appliance that referenced this issue Jan 12, 2023
Adds custom vboxmanage config to Packer build. Needed for VirtualBox 7
compatibility.

Source:
hashicorp/packer#12118 (comment)
sei-mkaar added a commit to cmu-sei/foundry-appliance that referenced this issue Feb 3, 2023
* Version upgrades

- Gameboard 3.7.0
- Gitea 1.17.4
- Material for MkDocs 9.0.4

* Fix VirtualBox 7 build

Adds custom vboxmanage config to Packer build. Needed for VirtualBox 7
compatibility.

Source:
hashicorp/packer#12118 (comment)

* Update gameboard.values.yaml

Bump Gameboard to v3.7.1

* Upgrade VirtualBox for CI runner

* Fix VirtualBox 6 build in GitHub Actions

* Upgrade to K3s v1.25.6+k3s1
jhajek added a commit to jhajek/packer-vagrant-build-scripts that referenced this issue Feb 9, 2023
@willieseabrook
Copy link

I can confirm this is an issue on packer 1.8.5 with VirtualBox 7.0.6 with Manjaro Sway as the host and arch as the guest trying to use packer build.

The error I was getting was that packer build would stall on: "Using SSH communicator to connect: 127.0.0.1"

Using the solution of Zotteljedi (a comment above) in my arch-template.json file solved the issues:

  vboxmanage = [
    ["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
  ]

@kristianheljas
Copy link

I stumbled across this as well and scratched my head for 2 days, since debian installer just ... hanged.

From what I gathered from the #vbox IRC channel: --nat-localhostreachable was introduced in 7.0.0 and set to "off" by default. Can also confirm that setting this to "off" will fix the issue.

I opened an issue in the virtualbox plugin repo, where the fix should be applied, see hashicorp/packer-plugin-virtualbox#104

@sbrueseke
Copy link

I encounter this issue when running packer version 1.9.4 on a server where KVM/qemu ins installed. So it looks like this is not related to virtualbox only.

@dreibh
Copy link
Contributor

dreibh commented Jun 19, 2024

The problem still occurs with Packer 1.11.0 (from HashiCorp repository) and VirtualBox 7.0.18 (from Oracle repository), tested under Ubuntu 22.04-LTS:

$ apt-show-versions | grep "^virtualbox\|packer"
packer:amd64/jammy 1.11.0-1 uptodate
packer:i386 not installed
virtualbox-7.0:amd64/jammy 7.0.18-162988~Ubuntu~jammy uptodate

The work-around solves the issue, i.e.:

  "vboxmanage": [
    [ "modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
    ...

hswong3i added a commit to alvistack/vagrant-almalinux that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-centos that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-ceph that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-debian that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-devel that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-fedora that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-kubernetes that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-opensuse that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-rhel that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-ubuntu that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-almalinux that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-debian that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-fedora that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-centos that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-rhel that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-opensuse that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-ubuntu that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-ceph that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-devel that referenced this issue Jun 19, 2024
hswong3i added a commit to alvistack/vagrant-kubernetes that referenced this issue Jun 19, 2024
@robertauer
Copy link

Confirmed, this issue still exists with Packer 1.11.0, VirtualBox 7.0.16 on Ubuntu 24.04

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

No branches or pull requests