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

Error removing floppy controller #2401

Closed
mealingr opened this issue Jul 7, 2015 · 71 comments · Fixed by #3952
Closed

Error removing floppy controller #2401

mealingr opened this issue Jul 7, 2015 · 71 comments · Fixed by #3952
Labels
builder/virtualbox stage/waiting-on-upstream This issue is waiting on an upstream change

Comments

@mealingr
Copy link

mealingr commented Jul 7, 2015

Hi all,

At the end of a packer build, just before the post-processor (vagrant) is started, packer fails to remove the floppy drive.

The exact error is:

virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxMana
ge.exe: error: The machine 'packer-virtualbox-iso-1436168056' is already locked
for a session (or being unlocked)
==> virtualbox-iso: VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_S
TATE (0x80bb0007), component Machine, interface IMachine, callee IUnknown
==> virtualbox-iso: VBoxManage.exe: error: Context: "LockMachine(a->session, Loc
kType_Write)" at line 1011 of file VBoxManageStorageController.cpp
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error removing floppy controller: VBoxManage err
or: VBoxManage.exe: error: The machine 'packer-virtualbox-iso-1436168056' is alr
eady locked for a session (or being unlocked)
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), c
omponent Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at lin
e 1011 of file VBoxManageStorageController.cpp

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxMana
ge.exe: error: The machine 'packer-virtualbox-iso-1436168056' is already locked
for a session (or being unlocked)
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), c
omponent Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at lin
e 1011 of file VBoxManageStorageController.cpp

==> Builds finished but no artifacts were created.

The strange thing is the error only happens about 50% of the time. Typically the first build will fail with this error and then the next build will succeed with nothing changed in between.

My packer json is:

{
  "builders": [
    {
      "type": "virtualbox-iso",
      "iso_url": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
      "iso_checksum_type": "md5",
      "iso_checksum": "458ff91f8abc21b75cb544744bf92e6a",
      "headless": false,
      "boot_wait": "2m",
      "ssh_username": "vagrant",
      "ssh_password": "vagrant",
      "ssh_wait_timeout": "4h",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "guest_os_type": "Windows2012_64",
      "disk_size": 61440,
      "floppy_files": [
        "./floppy_files/Autounattend.xml",
        "./floppy_files/microsoft-updates.bat",
        "./floppy_files/win-updates.ps1",
        "./floppy_files/openssh.ps1",
        "./floppy_files/oracle-cert.cer",
        "./floppy_files/setenv.bat",
        "./floppy_files/setdnssuffix.wsf",
        "./floppy_files/hosts"
      ],
      "vboxmanage": [
        [
          "modifyvm",
          "{{.Name}}",
          "--memory",
          "2048"
        ],
        [
          "modifyvm",
          "{{.Name}}",
          "--cpus",
          "2"
        ]
      ]
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "remote_path": "/tmp/script.bat",
      "execute_command": "{{.Vars}} cmd /c C:/Windows/Temp/script.bat",
      "scripts": [
        "./packer_scripts/vm-guest-tools.bat",
        "./packer_scripts/vagrant-ssh.bat",
        "./packer_scripts/enable-rdp.bat",
        "./packer_scripts/disable-auto-logon.bat",
        "./packer_scripts/chef.bat",
        "./packer_scripts/chocolatey.bat",
        "./packer_scripts/chocopacks.bat",
        "./packer_scripts/tomcat6.bat",
        "./packer_scripts/copyHosts.bat",
        "./packer_scripts/setdnssuffix.bat",
        "./packer_scripts/setPerlPath.bat"
      ]
    },
    {
      "type": "shell",
      "inline": [
        "rm -rf /tmp/*"
      ]
    }
  ],
  "post-processors": [
    {
      "type": "vagrant",
      "keep_input_artifact": false,
      "output": "windows_2012_r2_{{.Provider}}.box",
      "vagrantfile_template": "vagrantfile-windows_2012_r2.template"
    }
  ]
}

Any idea how to fix this?

Thanks

@cbednarski
Copy link
Contributor

@mealingr I think this is a timing issue similar to #1193. We can likely fix it in packer with a retry.

@mealingr
Copy link
Author

mealingr commented Jul 8, 2015

I forgot to mention I was running version 0.8.0, i've heard that it may be fixed in later versions (perhaps because packer does more retries as you suggest?).

@mealingr
Copy link
Author

mealingr commented Jul 9, 2015

This seems to be fixed in version 0.8.1.

@mwrock
Copy link

mwrock commented Jul 14, 2015

I just ran into this same error with 0.8.1. Its definitely intermittent. I've built successfully about 10 times and this is the first time I have hit this.

@pahunt1978
Copy link

I'm having this issue intermittently using version 0.8.2. I have created a Windows Server 2012 R2 image 5 or 6 times using this template https://github.com/joefitzgerald/packer-windows/blob/master/windows_2012_r2.json (only modification is I've set headless to false) and have got the error twice.

I'm using Windows 7 Pro as a host with VirtualBox. Is there anything I can do to help diagnose the problem?

@mwrock
Copy link

mwrock commented Jul 29, 2015

BTW: it would be great if there was a way to tell packer not to delete the artifacts when an error occurs. When I see this error it is after hours of image building and then I have to start from the beginning again. If the image could be preserved I could at least do some manual salvaging.

@beporter
Copy link

I'm running into timing issues that seems similar, except in my case the issue is with detaching the OS install iso. In case it helps future googlers, here's the error output I'm occasionally seeing:

// [...snip...]
==> mybox-vbox: Connected to SSH!
==> mybox-vbox: Uploading VirtualBox version info (5.0.2)
==> mybox-vbox: Uploading VirtualBox guest additions ISO...
==> mybox-vbox: Provisioning with shell script: provisioners/shell/virtualbox-guest-additions-install.sh
// [...snip provisioner script output...]
==> mybox-vbox: Gracefully halting virtual machine...
    mybox-vbox: [sudo] password for vagrant:
==> mybox-vbox: Error detaching ISO: VBoxManage error: VBoxManage: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
==> mybox-vbox: VBoxManage: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee nsISupports
==> mybox-vbox: VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 325 of file VBoxManageStorageController.cpp
==> mybox-vbox: Unregistering and deleting virtual machine...
==> mybox-vbox: Deleting output directory...

Build 'mybox-vbox' errored: Error detaching ISO: VBoxManage error: VBoxManage: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
VBoxManage: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 325 of file VBoxManageStorageController.cpp

I just upgraded Packer from 0.6.1 to 0.8.5 and Virtualbox from 4.3.28 to 5.0.2. This same build worked (at least once) immediately beforehand and worked again with the upgraded tooling on a subsequent attempt. The speed at which the operations are processed seems to be the variable.

@chrisjsmith
Copy link

A me too on packer 0.8.6 and VirtualBox 5.0.4 on Windows 8.1 x64 as a host machine deploying Windows Server 2012 R2 as a guest.

@vvchik
Copy link
Contributor

vvchik commented Oct 26, 2015

same error on Packer 0.8.6

@mwrock
Copy link

mwrock commented Oct 26, 2015

One other data point to leave here. I only encounter this on Windows hosts. I have never seen it on my ubuntu 14 host. When I was working on this win7 template, I started to run into this 100% of the time and never reproduced on ubuntu. So if you are trying to reproduce its important to use a windows host unless someone can report experiencing this on non windows.

@vvchik
Copy link
Contributor

vvchik commented Oct 26, 2015

I using mac os x 10.10.5

@mwrock
Copy link

mwrock commented Oct 26, 2015

ah ok good to know. I have never used a mac. There might even be a headless vs. GUI element here since my ubuntu box runs as a server with no desktop.

@jglf
Copy link

jglf commented Oct 30, 2015

I also have the issue on packer 0.8.6, VirtualBox 5.0.8 on Windows 7 x64 as a host machine deploying Windows Server 2008 R2 as a guest. It happens systematically with "headless": false but never with "headless": true.

@nhlong
Copy link

nhlong commented Nov 18, 2015

The issue still happens with "headless" : true on 0.8.6

@AtwoodTM
Copy link

AtwoodTM commented Dec 3, 2015

Same issue still happening with Packer 0.8.6 on Windows 10 x64 host deploying Windows Server 2008 R2 as a guest with "headless" : "false".

@donbecker
Copy link

Same issue happened to me, Windows 7 x64 host deploying Windows Server 2012 R2 a a guest. Packer 0.8.6., running make in Cygwin, Virtual Box 5.0.10. I'd second @mwrock 's suggestion to not delete the artifacts on error.

@donbecker
Copy link

Just an update, making the changes found here I was able to get it working. I set the timeout to something really high (like 1500m) and it eventually worked (no idea how long it actually took, I was AFK).

@genebean
Copy link

genebean commented Dec 8, 2015

I am having the same issue building Windows 7 while running Linux Mint 17.2 (aka Ubuntu 14.04LTS). FWIW, I am using templates from @mwrock Here is my error:

==> virtualbox-iso: Gracefully halting virtual machine...
    virtualbox-iso: Removing floppy drive...
==> virtualbox-iso: Error removing floppy: VBoxManage error: VBoxManage: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 326 of file VBoxManageStorageController.cpp
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error removing floppy: VBoxManage error: VBoxManage: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
VBoxManage: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 326 of file VBoxManageStorageController.cpp

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error removing floppy: VBoxManage error: VBoxManage: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
VBoxManage: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 326 of file VBoxManageStorageController.cpp

@chocolatewheelchair
Copy link

I am having the exact same issue as OP trying to build a Win 7 VM from a Win 7 host.

None of the workarounds suggested here or in linked answers are helping. Stumped here.
Any other pointers/suggestions?

@anuriq
Copy link

anuriq commented Jan 11, 2016

Having this issue from time to time on Windows 10 building Windows boxes. Restarting a packer task helps.

virtualbox-iso: Removing floppy drive...
==> virtualbox-iso: Error removing floppy: VBoxManage error: VBoxManage.exe: error: Failed to get a console object from the direct session (VBOX_E_INVALID_OBJECT_STATE)
==> virtualbox-iso: VBoxManage.exe: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component MachineWrap, interface IMachine, callee IUnknown
==> virtualbox-iso: VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Shared)" at line 326 of file VBoxManageStorageController.cpp

@davidsummers
Copy link

Is there a fix coming for this? Packer is 100% unusable for me because of this. I've been trying to build the vbox-2012r2.json (or any Windows VM) off and on since I discovered Packer last Summer and tried for about 3 days the first time and then retried again a couple of months later and just now tried again and it fails 100% of the time. It did fail earlier in the process with another error but now it fails with this error after it gets through building and is cleaning up.

If there is a workaround or someone else who has a patched build of Packer that fixes this, please let me know as I would really like to use Packer to build my VMs and I don't understand how others can use it as it is failing 100% of the time for me.

@chrisjsmith
Copy link

I ended up building a template image and sysprepping it by hand. So much for automation...

@chocolatewheelchair
Copy link

Not exactly sure why, but it seems setting shutdown_timeout to 1h worked for me

@rickard-von-essen
Copy link
Collaborator

@chocolatewheelchair That's a great hint. Speculating a bit but since this only happens with Windows guests it might be that Windows is really slow shutting down and don't finish within the default 5m shutdown timeout. Then VirtualBox try to remove the floppy before the machine is properly shut down.

It would be awesome if someone who get this problem allot can verify that increasing shutdown_timeout to say 1h resolves this?

@mwrock
Copy link

mwrock commented Jan 28, 2016

I'd be very sceptical that a longer shutdown_timeout really impacts this unless @chocolatewheelchair could confirm that affects this consistently over several attempts. Also it should be noted, it is not limited to windows, both mac and linux users have reported this. The only thing that I have found to consisently resolve this is running headless (regardless of OS).

@anuriq
Copy link

anuriq commented Jan 28, 2016

I have a shutdown_timeout = 15m. And OS shutdowns in 20-30 sec, max 1m. And problem occurs anyway in about 10% of tries. The most frustrating thing is that this error fires on building end, so 3-4 hours of work are cancelled in a matter of seconds =)

@donbecker
Copy link

@rickard-von-essen @mwrock I've run it about half a dozen times and it seems to work. Admittedly a small sample set.

ColinNg added a commit to ColinNg/packer-windows that referenced this issue Dec 18, 2016
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
@bsberry
Copy link

bsberry commented Jan 9, 2017

Hitting this again, this time on Windows Server 2016 host and Win10 guest.

      "post_shutdown_delay": "180s",
      "shutdown_timeout": "1h",

in the virtualbox-iso builder does not help.

taylormonacelli pushed a commit to taylormonacelli/boxcutter-windows that referenced this issue Jan 11, 2017
@synthead
Copy link

I am seeing this issue as well. This is with Packer 0.12.1 and VirtualBox 5.1.12 on Arch Linux.

==> virtualbox-iso: Gracefully halting virtual machine...
    virtualbox-iso: Removing floppy drive...
==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-iso-1484873439' is already locked for a session (or being unlocked)
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file VBoxManageStorageController.cpp
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-iso-1484873439' is already locked for a session (or being unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file VBoxManageStorageController.cpp

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-iso-1484873439' is already locked for a session (or being unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file VBoxManageStorageController.cpp

==> Builds finished but no artifacts were created.

@mwhooker
Copy link
Contributor

I've opened a new issue to track these bugs. See #4432

ColinNg added a commit to ColinNg/packer-windows that referenced this issue Feb 13, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
@jacksonp2008
Copy link

Seeing exactly same error here, anyone have a fix yet?

I am running on OSX 10.12.3
dude1$ packer -v
0.12.2

dude$ packer build -force -only virtualbox-iso eval-win7x64-enterprise-cygwin.json

Oracle VM VirtualBox Manager 5.1.14

@dayne
Copy link

dayne commented Mar 17, 2017

I ran across the same problem today and this issue is still a top result. It appears from my testing that the delay isn't the magic fix people had hoped it would be but using -var 'headless=true' does make it work more reliably.

Below is the summary of my debugging steps while trying to debug the failing build of a windows/win10x86-enterprise & windows/win2012r2-standard boxes from boxcutter/windows

  • Ubuntu 16.10
  • VirtualBox 5.1.16
  • packer 0.12.2

Decided to try one of each of the suggestions above related to headless mode and having a post_shutdown_delay.

Win2012: timeout test: -var "post_shutdown_delay=30s added to Makefile - failed - unable to remove floppy before blowing up.

Win 10: headless test: HEADLESS=true make virtualbox/eval-win10x86-enterprise - failed - removed the floppy drive then blew up exporting the virtual machine.

That blow up prompted more searching and I found an ubuntu user reporting issues exporting with rogue virtualbox processes laying about.

Shutdown all my virtualbox stuff and checked to see if any processes were still lingering: ps -Aef | grep virtualbox -- there were, so killed those, and moved back to the Win2012 combo test: headless with 30s delay.around

Win2012: headless test: HEADLESS=true make virtualbox/eval-win2012r2-standard - worked - Headless mode caused my first successful packer build of a windows VM.

Having that work I decided to go back and try Win 10 without any special delay and in display mode, default setup I had originally tried but with a pre-verification step there were no rogue virtualbox processes running before starting the build off.

Win 10: default test with clean environment: make virtualbox/eval-win10x86-enterprise - failed

So I rolled back and did Win 10 again

Win 10: headless and no delay: HEADLESS=true make virtualbox/eval-win10x86-enterprise - worked.

While debugging this I ran into a great blog post best practices with packer and windows by @MattHodge who nicely summed it like this: "When using the VirtualBox builder, using headless mode errors a lot less."


Final follow up test after request from @mwhooker to extend from 30s to 2m for the delay in display mode.:

Win 10: default mode with-var "post_shutdown_delay=2m": make virtualbox/eval-win10x86-enterprise - worked

@mwhooker
Copy link
Contributor

mwhooker commented Mar 17, 2017

@dayne thanks for the info, that's interesting. I wonder, if you wanted to test one more time, if setting something like post_shutdown_delay=2m and run with headless=false would work. I'll give it a try as well with the boxcutter boxes and see if I can reproduce. I'm working on this this week, and tracking here #4432

@dayne
Copy link

dayne commented Mar 17, 2017

@mwhooker - I went back and tried the headless=true with a post_shutdown_delay=2m and it did work. A longer delay than 30 seconds did make it work. Thanks for making me double check that - a longer delay is a viable option for a headed install on linux it appears.

ColinNg added a commit to ColinNg/packer-windows that referenced this issue May 1, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue May 1, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Jun 12, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Jul 1, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Dec 12, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Dec 28, 2017
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Feb 19, 2018
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Oct 30, 2018
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Nov 3, 2018
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Feb 14, 2019
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
ColinNg added a commit to ColinNg/packer-windows that referenced this issue Jul 16, 2019
…e modifications:

1. Installs my favorite dev tools.
2. A workaround for “Error removing floppy controller”:
	virtualbox-iso: Removing floppy drive...
	==> virtualbox-iso: Error removing floppy controller: VBoxManage error: VBoxManage: error: The machine 'packer-virtualbox-	iso-1479795526' is already locked for a session (or being unlocked)
	==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, 	interface IMachine, callee nsISupports
	==> virtualbox-iso: VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1038 of file 	VBoxManageStorageController.cpp
	==> virtualbox-iso: Unregistering and deleting virtual machine...

	References:
	GoSecure/malboxes#10
	hashicorp/packer#2401
	hashicorp/packer#3952 (comment)
	https://www.virtualbox.org/ticket/16063
Mohitsharma44 added a commit to Mohitsharma44/packer-templates that referenced this issue Sep 17, 2019
@EugenMayer
Copy link

EugenMayer commented Nov 24, 2019

Just wanted to confirm that this issue still exists with packer 1.4.6, vagrant 2.2.6 and virtualbox 6.0-r14

I can be reproduced by turning off headless:false. Adding post_shutdown_delay:2m fixes it, while headless mode is still off.

Using headless:true does also fix the issues, without any additional parameters.

Build host is a 32GB, i7, nvme SSD host, so nothing 'too slow' in that regard.

@SwampDragons
Copy link
Contributor

This is a pretty old issue; if you're facing something with similar symptoms, there's a good chance it is new. Can you please open a new issue with full steps to reproduce?

@ghost
Copy link

ghost commented Jan 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder/virtualbox stage/waiting-on-upstream This issue is waiting on an upstream change
Projects
None yet
Development

Successfully merging a pull request may close this issue.