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

VirtualBox 6.x using Hyper-v (for WSL2) backend breaks SSH/SCP comms #5

Open
ghost opened this issue Apr 16, 2021 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Apr 16, 2021

This issue was originally opened by @ciarancourtney as hashicorp/packer#9411. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

Not saying this is a packer issue, just a placeholder in case anyone else encounters it and is flummoxed like I was.

Getting error Error uploading guest additions: ssh: disconnect, reason 2: Packet corrupt.

Trying to SCP same file (or any file of significant size) on command line fails with same error.

Guest OS is CentOS 6.10

Tread here mentions similar issues incl segfaults and issues computing SHA256 sums.

Turning off Hyper-V resolves issue:

bcdedit /set hypervisorlaunchtype off
** reboot **

Reproduction Steps

Do a virtualbox-iso build incl guest upload on Windows 10 with the new WSL2 hyper-v features enabled.

Packer version

1.5.6 & 1.6.0 tested

Simplified Packer Buildfile

      "type": "virtualbox-iso",
      "guest_os_type": "RedHat_64",
      "guest_additions_mode": "upload",
      "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
      "virtualbox_version_file": ".vbox_version",

Operating system and Environment details

  • Windows 10 2004 (20H1)
  • VirtualBox v6.1.8 (hyper-v not mentioned in v6.1.10 changelog)
    • WSL2 installed, so vbox is using the hyper-v backend (green turtle in status bar)

Log Fragments and crash.log files

2020/06/11 17:13:27 packer.exe plugin: [INFO] Attempting SSH connection to 127.0.0.1:3041...
2020/06/11 17:13:27 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2020/06/11 17:13:27 packer.exe plugin: [DEBUG] handshaking with SSH
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] handshake complete!
2020/06/11 17:13:28 packer.exe plugin: [ERROR] could not connect to local agent socket: C:/Users/ciara/AppData/Local/Temp/ssh-nOvGQ9u9tR2s/agent.744
==> virtualbox-iso: Connected to SSH!
2020/06/11 17:13:28 packer.exe plugin: VBoxManage --version output: 6.1.8r137981
2020/06/11 17:13:28 packer.exe plugin: VirtualBox version: 6.1.8
==> virtualbox-iso: Uploading VirtualBox version info (6.1.8)
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Opening new ssh session
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Starting remote scp process:  scp -vt .
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Started SCP session, beginning transfers...
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Copying input data into temporary file so we can read the length
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] scp: Uploading .vbox_version: perms=C0644 size=5
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] SCP session complete, closing stdin pipe.
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Waiting for SSH session to complete.
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] scp stderr (length 28): Sink: C0644 5 .vbox_version
2020/06/11 17:13:28 packer.exe plugin: VBoxManage --version output: 6.1.8r137981
2020/06/11 17:13:28 packer.exe plugin: VirtualBox version: 6.1.8
==> virtualbox-iso: Uploading VirtualBox guest additions ISO...
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Opening new ssh session
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Starting remote scp process:  scp -vt .
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Started SCP session, beginning transfers...
2020/06/11 17:13:28 packer.exe plugin: [DEBUG] Copying input data into temporary file so we can read the length
2020/06/11 17:13:29 packer.exe plugin: [DEBUG] scp: Uploading VBoxGuestAdditions_6.1.8.iso: perms=C0644 size=59832320
==> virtualbox-iso: Error uploading guest additions: write tcp 127.0.0.1:19925->127.0.0.1:3041: wsasend: An existing connection was forcibly closed by the remote host.
==> virtualbox-iso: Step "StepUploadGuestAdditions" failed
==> virtualbox-iso: [c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succeeds)?
@ciarancourtney
Copy link

This is no longer an issue in later versions of VirtualBox, most hyper-v issues were resolved in v6.1.14 & v6.1.16 https://www.virtualbox.org/wiki/Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant