StefanScherer / packer-windows

Windows Templates for Packer: Windows 11, Windows 10, Windows Server 2022, 2019, 2016, also with Docker
MIT License
1.29k stars 434 forks source link

VirtualBox 6.1 renamed --clipboard to --clipboard-mode #240

Closed aucampia closed 4 years ago

aucampia commented 4 years ago

There is no more --clipboard in VirtualBox 6.1 - it is now --clipboard-mode:

https://www.virtualbox.org/manual/UserManual.html#vboxmanage-cmd-overview

This causes the following to fail: https://github.com/StefanScherer/packer-windows/blob/2020.01.15/vagrantfile-windows_10.template#L25

With this error:

==> default: Running 'pre-boot' VM customizations...
A customization command failed:

["modifyvm", :id, "--clipboard", "bidirectional"]

The following error was experienced:

#<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "cb2b1fff-eaa6-45a6-8007-c5b488865b1f", "--clipboard", "bidirectional"]

Just a heads up - I guess since VirtualBox 6.1 is not supported yet by vagrant this can technically not be considered a bug yet.

StefanScherer commented 4 years ago

Thank you. I’ll take a look when vagrant supports it and adjust the templates. What‘s your experience? No other issues?

alysov commented 4 years ago

The latest version of vagrant, 2.2.7, supports virtualbox 6.1.x. Looking forward to removing the temporary fix. 😉

StefanScherer commented 4 years ago

Thanks @alysov I'll take a look soon.

alexhaydock commented 4 years ago

I am having this issue also on macOS, but I can't help but wonder what will happen if the templates are updated to use the new --clipboard-mode flag. Surely this will just cause everything to break in the same way for users still on VirtualBox <6.1? Seems like that could affect a lot of LTS Linux distro users.

basictheprogram commented 4 years ago

https://github.com/briancain says:

Hey all - This is an issue with the Vagrant box you are using. Please contact the box 
maintainerfor a fix, Vagrant does not use the --clipboard option any where in its 
codebase. <snip>
As a temprorary fix, you can always go directly into the Vagrantfile embedded inside the 
box and fix up the flag and its arguments. Mine was located at: 
~/.vagrant.d/boxes/peru-VAGRANTSLASH-ubuntu-18.04-server-amd64/20200104.02/virtualbox/Vagrantfile

https://github.com/hashicorp/vagrant/issues/11288#issuecomment-571231282

StefanScherer commented 4 years ago

I've created #242 to rename the parameter. Sooner or later users update their VirtualBox, so I'm fine with that change.