hashicorp / hashicorp/packer-plugin-vagrant
Builder vagrant with libvirt: "Remote connection disconnect" error to connect to a box made from the packer-built image.
- Dominant language
- Go
- Stars
- 16
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
_This issue was originally opened by @Romainj1 in https://github.com/hashicorp/packer/issues/11405 and has been migrated to this repository. The original issue description is below._
---
#### Overview of the Issue
I am trying to use the vagrant builder. I achieve creating a new image out of an existing one in my example. But the image created seems unusable: When creating a new box out of the new image, with `vagrant up`, vagrant cannot ssh: `Remote connection disconnect` ...
I tried `generic/debian10` and `generic/debian9` as base images.
#### Reproduction Steps
Run:
```bash
cat > box.json < default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default: -- Name: devops-scripts_default
==> default: -- Description: Source: /home/rjacquier/dev/devops-scripts/Vagrantfile
==> default: -- Domain type: kvm
==> default: -- Cpus: 1
==> default: -- Feature: acpi
==> default: -- Feature: apic
==> default: -- Feature: pae
==> default: -- Clock offset: utc
==> default: -- Memory: 512M
==> default: -- Management MAC:
==> default: -- Loader:
==> default: -- Nvram:
==> default: -- Base box: box
==> default: -- Storage pool: default
==> default: -- Image(): /home/.libvirt_images/devops-scripts_default.img, 128G
==> default: -- Disk driver opts: cache='default'
==> default: -- Kernel:
==> default: -- Initrd:
==> default: -- Graphics Type: vnc
==> default: -- Graphics Port: -1
==> default: -- Graphics IP: 127.0.0.1
==> default: -- Graphics Password: Not defined
==> default: -- Video Type: cirrus
==> default: -- Video VRAM: 9216
==> default: -- Sound Type:
==> default: -- Keymap: en-us
==> default: -- TPM Backend: passthrough
==> default: -- TPM Path:
==> default: -- INPUT: type=mouse, bus=ps2
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.121.13:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
...
```
until it timeouts
### Packer version
```bash
$ packer version
Packer v1.7.8
```
### Simplified Packer Template
Json template:
```json
{
"builders": [
{
"communicator": "ssh",
"source_path": "generic/debian10",
"provider": "libvirt",
"type": "vagrant"
}
]
}
```
### Operating system and Environment details
```bash
$ uname -a
Linux rjr-port 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
$ vagrant --version
Vagrant 2.2.19
$ virsh --version
7.0.0
$ libvirtd --version
libvirtd (libvirt) 7.0.0
```
Contributor guide
Assessment
This issue has not been assessed yet.