I have an error and I don’t know how I can get around it. I can’t connect to Linux from a Windows 10 machine.
Packer version v1.9.1
virtual box version 7.0
My json of configuration packer
{
“variables”: {
“version”: “7”
},
“provisioners”: [
{
“type”: “shell”,
“execute_command”: “echo ‘vagrant’ | {{.Vars}} sudo -S -E bash ‘{{.Path}}’”,
“script”: “scripts/ansible.sh”
},
{
“type”: “shell”,
“execute_command”: “echo ‘vagrant’ | {{.Vars}} sudo -S -E bash ‘{{.Path}}’”,
“script”: “scripts/setup.sh”
},
{
“type”: “ansible-local”,
“playbook_file”: “…/shared/main.yml”,
“galaxy_file”: “…/shared/requirements.yml”
},
{
“type”: “shell”,
“execute_command”: “echo ‘vagrant’ | {{.Vars}} sudo -S -E bash ‘{{.Path}}’”,
“script”: “scripts/cleanup.sh”
}
],
“builders”: [
{
“type”: “virtualbox-iso”,
“boot_command”: [
“”,
“install ”,
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
“debian-installer=en_US.UTF-8 ”,
“auto ”,
“locale=en_US.UTF-8 ”,
“kbd-chooser/method=us ”,
“keyboard-configuration/xkb-keymap=us ”,
“netcfg/get_hostname={{ .Name }} ”,
“netcfg/get_domain=vagrantup.com ”,
“fb=false ”,
“debconf/frontend=noninteractive ”,
“console-setup/ask_detect=false ”,
“console-keymaps-at/keymap=us ”,
“grub-installer/bootdev=/dev/sda ”,
“”
],
“boot_wait”: “1m”,
“disk_size”: 81920,
“guest_os_type”: “Debian_64”,
“headless”: false,
“http_directory”: “http”,
“iso_urls”:“https://cdimage.debian.org/cdimage/archive/10.11.0/amd64/iso-cd/debian-10.11.0-amd64-xfce-CD-1.iso”,
“iso_checksum”: “sha256:3e8a66c0fc0fdcec8692a59c0f53fe1a888b18e07e28de53d794f757c43aa360”,
“ssh_username”: “vagrant”,
“ssh_password”: “vagrant”,
“ssh_host_port_min”: 2222,
“ssh_host_port_max”: 2229,
“ssh_port”: 2223,
“ssh_wait_timeout”: “1800s”,
“shutdown_command”: “echo ‘vagrant’|sudo -S shutdown -P now”,
“guest_additions_path”: “VBoxGuestAdditions_{{.Version}}.iso”,
“virtualbox_version_file”: “.vbox_version”,
“vm_name”: “packer-debian-10-amd64”,
“vboxmanage”: [
[
“modifyvm”,
“{{.Name}}”,
“–memory”,
“1024”
],
[
“modifyvm”,
“{{.Name}}”,
“–cpus”,
“1”
]
]
}
],
“post-processors”: [
[
{
“output”: “builds/{{.Provider}}-debian10.box”,
“type”: “vagrant”
}
]
]
}
My Preceed.cfg
choose-mirror-bin mirror/http/proxy string
d-i apt-setup/use_mirror boolean true
d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc boolean true
d-i clock-setup/utc-auto boolean true
d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i keymap select us
d-i mirror/country string manual
d-i mirror/http/directory string /debian
d-i mirror/http/hostname string httpredir.debian.org
d-i mirror/http/proxy string
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i passwd/root-login boolean false
d-i passwd/root-password-again password vagrant
d-i passwd/root-password password vagrant
d-i passwd/user-fullname string vagrant
d-i passwd/user-uid string 1000
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/username string vagrant
d-i pkgsel/include string sudo bzip2 acpid cryptsetup zlib1g-dev wget curl dkms make nfs-common net-tools
d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select none
d-i pkgsel/upgrade select full-upgrade
Prevent packaged version of VirtualBox Guest Additions being installed:
d-i preseed/early_command string sed -i
‘/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}’
/usr/lib/pre-pkgsel.d/20install-hwpackages
d-i time/zone string UTC
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
d-i preseed/late_command string sed -i ‘/^deb cdrom:/s/^/#/’ /target/etc/apt/sources.list
apt-cdrom-setup apt-setup/cdrom/set-first boolean false
apt-mirror-setup apt-setup/use_mirror boolean true
popularity-contest popularity-contest/participate boolean false
tasksel tasksel/first multiselect standard, ssh-server
and My log of the build
2023/06/22 17:26:22 [INFO] Packer version: 1.9.1 [go1.20.4 windows amd64]
2023/06/22 17:26:22 [TRACE] discovering plugins in C:\ProgramData\chocolatey\lib\packer\tools
2023/06/22 17:26:22 [TRACE] discovering plugins in C:\Users\Quentin\AppData\Roaming\packer.d\plugins
2023/06/22 17:26:22 [DEBUG] Discovered plugin: docker = C:\Users\Quentin\AppData\Roaming\packer.d\plugins\github.com\hashicorp\docker\packer-plugin-docker_v1.0.8_x5.0_windows_amd64.exe
2023/06/22 17:26:22 [DEBUG] Discovered plugin: vmware = C:\Users\Quentin\AppData\Roaming\packer.d\plugins\github.com\hashicorp\vmware\packer-plugin-vmware_v1.0.8_x5.0_windows_amd64.exe
2023/06/22 17:26:22 [INFO] found external [iso vmx] builders from vmware plugin
2023/06/22 17:26:22 [INFO] found external [-packer-default-plugin-name-] builders from docker plugin
2023/06/22 17:26:22 [INFO] found external [import push save tag] post-processors from docker plugin
2023/06/22 17:26:22 [TRACE] discovering plugins in .
2023/06/22 17:26:22 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/22 17:26:22 [INFO] PACKER_CONFIG env var set; attempting to open config file: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 [WARN] Config file doesn’t exist: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 [INFO] Setting cache directory: C:\Users\Quentin\Desktop\Packer\packer-boxes\debian10\packer_cache
e: cannot determine if process is in background: Process background check error: not implemented yet
2023/06/22 17:26:22 [TRACE] Starting internal plugin packer-builder-virtualbox-iso
2023/06/22 17:26:22 Starting plugin: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe string{“C:\ProgramData\chocolatey\lib\packer\tools\packer.exe”, “plugin”, “packer-builder-virtualbox-iso”}
2023/06/22 17:26:22 Waiting for RPC address for: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe
2023/06/22 17:26:22 packer.exe plugin: [INFO] Packer version: 1.9.1 [go1.20.4 windows amd64]
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [WARN] Config file doesn’t exist: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [INFO] Setting cache directory: C:\Users\Quentin\Desktop\Packer\packer-boxes\debian10\packer_cache
2023/06/22 17:26:22 packer.exe plugin: args: string{“packer-builder-virtualbox-iso”}
2023/06/22 17:26:22 packer.exe plugin: Plugin port range: [10000,25000]
2023/06/22 17:26:22 packer.exe plugin: Plugin address: tcp 127.0.0.1:10000
2023/06/22 17:26:22 packer.exe plugin: Waiting for connection…
2023/06/22 17:26:22 Received tcp RPC address for C:\ProgramData\chocolatey\lib\packer\tools\packer.exe: addr is 127.0.0.1:10000
2023/06/22 17:26:22 packer.exe plugin: Serving a plugin connection…
2023/06/22 17:26:22 [TRACE] Starting internal plugin packer-provisioner-shell
2023/06/22 17:26:22 Starting plugin: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe string{“C:\ProgramData\chocolatey\lib\packer\tools\packer.exe”, “plugin”, “packer-provisioner-shell”}
2023/06/22 17:26:22 Waiting for RPC address for: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe
2023/06/22 17:26:22 packer.exe plugin: [INFO] Packer version: 1.9.1 [go1.20.4 windows amd64]
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [WARN] Config file doesn’t exist: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [INFO] Setting cache directory: C:\Users\Quentin\Desktop\Packer\packer-boxes\debian10\packer_cache
2023/06/22 17:26:22 packer.exe plugin: args: string{“packer-provisioner-shell”}
2023/06/22 17:26:22 packer.exe plugin: Plugin port range: [10000,25000]
2023/06/22 17:26:22 packer.exe plugin: Plugin address: tcp 127.0.0.1:10000
2023/06/22 17:26:22 Received tcp RPC address for C:\ProgramData\chocolatey\lib\packer\tools\packer.exe: addr is 127.0.0.1:10000
2023/06/22 17:26:22 packer.exe plugin: Waiting for connection…
2023/06/22 17:26:22 packer.exe plugin: Serving a plugin connection…
2023/06/22 17:26:22 [TRACE] Starting internal plugin packer-provisioner-shell
2023/06/22 17:26:22 Starting plugin: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe string{“C:\ProgramData\chocolatey\lib\packer\tools\packer.exe”, “plugin”, “packer-provisioner-shell”}
2023/06/22 17:26:22 Waiting for RPC address for: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe
2023/06/22 17:26:22 packer.exe plugin: [INFO] Packer version: 1.9.1 [go1.20.4 windows amd64]
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [WARN] Config file doesn’t exist: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [INFO] Setting cache directory: C:\Users\Quentin\Desktop\Packer\packer-boxes\debian10\packer_cache
2023/06/22 17:26:22 packer.exe plugin: args: string{“packer-provisioner-shell”}
2023/06/22 17:26:22 packer.exe plugin: Plugin port range: [10000,25000]
2023/06/22 17:26:22 packer.exe plugin: Plugin address: tcp 127.0.0.1:10000
2023/06/22 17:26:22 packer.exe plugin: Waiting for connection…
2023/06/22 17:26:22 Received tcp RPC address for C:\ProgramData\chocolatey\lib\packer\tools\packer.exe: addr is 127.0.0.1:10000
2023/06/22 17:26:22 packer.exe plugin: Serving a plugin connection…
2023/06/22 17:26:22 [TRACE] Starting internal plugin packer-provisioner-ansible-local
2023/06/22 17:26:22 Starting plugin: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe string{“C:\ProgramData\chocolatey\lib\packer\tools\packer.exe”, “plugin”, “packer-provisioner-ansible-local”}
2023/06/22 17:26:22 Waiting for RPC address for: C:\ProgramData\chocolatey\lib\packer\tools\packer.exe
2023/06/22 17:26:22 packer.exe plugin: [INFO] Packer version: 1.9.1 [go1.20.4 windows amd64]
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/22 17:26:22 packer.exe plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [WARN] Config file doesn’t exist: C:\Users\Quentin\AppData\Roaming\packer.config
2023/06/22 17:26:22 packer.exe plugin: [INFO] Setting cache directory: C:\Users\Quentin\Desktop\Packer\packer-boxes\debian10\packer_cache
2023/06/22 17:26:22 packer.exe plugin: args: string{“packer-provisioner-ansible-local”}
…
2023/06/22 17:35:55 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:35:55 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:35:55 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49183->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:02 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:02 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:02 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:02 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49187->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:09 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:09 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:09 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:09 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49189->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:16 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:16 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:16 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:16 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49191->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:23 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:23 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:23 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:23 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49193->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:30 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:30 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:30 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:30 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49195->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:37 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:37 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:37 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:37 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49200->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:44 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:44 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:44 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:44 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49203->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:51 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:51 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:51 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:51 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49205->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:36:58 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:36:58 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:36:58 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:36:58 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49207->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
2023/06/22 17:40:48 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:2228…
2023/06/22 17:40:48 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/22 17:40:48 packer.exe plugin: [DEBUG] handshaking with SSH
2023/06/22 17:40:48 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49250->127.0.0.1:2228: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
can you help me or give me some issue because i’m totaly lost