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

vagrant halt fails with hotplug error #88

Open
2opremio opened this issue Feb 6, 2018 · 9 comments
Open

vagrant halt fails with hotplug error #88

2opremio opened this issue Feb 6, 2018 · 9 comments

Comments

@2opremio
Copy link

2opremio commented Feb 6, 2018

$ vagrant halt
==> default: Attempting graceful shutdown of VM...
    default: Guest communication could not be established! This is usually because
    default: SSH is not running, the authentication information was changed,
    default: or some other networking issue. Vagrant will force halt, if
    default: capable.
==> default: ** Detaching persistent storage **
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["storageattach", "4599eed9-a463-49ba-af86-e34d39f1c17d", "--storagectl", "SCSI", "--port", "15", "--device", "0", "--type", "hdd", "--medium", "none"]

Stderr: VBoxManage: error: Controller 'SCSI' does not support hotplugging
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachDevice(Bstr(pszCtl).raw(), port, device)" at line 403 of file VBoxManageStorageController.cpp
$ vagrant --version
Vagrant 2.0.2        
$ VBoxManage --version
5.2.6r120293
$ vagrant plugin list
vagrant-bindfs (1.1.0)
vagrant-persistent-storage (0.0.41)
@2opremio
Copy link
Author

2opremio commented Feb 6, 2018

Related: #42 (but in this case it's with SCSI)

@2opremio
Copy link
Author

2opremio commented Feb 6, 2018

These are the options I am using (ubuntu/xenial64 box)

  config.persistent_storage.enabled = true
  config.persistent_storage.location = "~/home-vagrant/build.vdi"
  config.persistent_storage.size = 20000
  config.persistent_storage.mountname = 'build'
  config.persistent_storage.filesystem = 'ext4'
  config.persistent_storage.mountpoint = '/mnt/build'
  config.persistent_storage.volgroupname = 'myvolgroup'
  config.persistent_storage.mountoptions = ['uid=vagrant', 'gid=vagrant']

@kusnier
Copy link
Owner

kusnier commented Feb 17, 2018

The options uid and gid in this version of ubunut are only suppor the number values of user and group. Howsoever this is not the problem. I have done some vagrant up and vagrant halt and it seems that i get the problem too.

But this seems as a problem from the guest system. After i enabled the gui of virtual box i can see that the boot up is hanging and so vagrant is not able to connect to the guest.

screen shot 2018-02-17 at 21 44 23

The startup is halt on Started Journal Service.

Maybe this could be a problem of this version of the linux image.
I have not time to investigate this in details but maybe you have some.

Best regards

Sebastian

@2opremio
Copy link
Author

But this seems as a problem from the guest system. After i enabled the gui of virtual box i can see that the boot up is hanging and so vagrant is not able to connect to the guest.

For me it boots without problems. I can also mount the disk and use it, it only gets stuck when tryiing to shutdown the VM.

@2opremio
Copy link
Author

OK, the uid/gid options seems to be a problem. I would had sworn it worked when I created the volume.

screen shot 2018-02-19 at 11 50 02

@2opremio
Copy link
Author

2opremio commented Apr 2, 2018

I gave up and resorted to create and mount the disk using ruby scripting directly on the Vagrant file.

@barrkel
Copy link

barrkel commented May 22, 2018

I see this also. After a suspend and resume, the networking stack on my Virtualbox instance is unresponsive, so I need to do a vagrant halt -f && vagrant up to bring it back. But vagrant halt -f fails due to this plugin trying to detach the persistent storage, with the SCSI hotplug error quoted above.

I'm not sure why it's trying to detach on vagrant halt -f. I just want the VM to come down hard. My workaround is to power off the VM with the Virtualbox UI, but I'd prefer it to work in script.

@kusnier
Copy link
Owner

kusnier commented May 31, 2018

The detach have to processed. If the detach will be bypassed a destroy or manual delete will kill your attached drive and all data is gone.

Unfortunately i have currently no time to investigate this problem.

@devopstales
Copy link

Still an issue with IDE too:

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

Command: ["storageattach", "630f5d12-94a3-4b01-959d-280dc730ef40", "--storagectl", "IDE Controller", "--port", "1", "--device", "0", "--type", "hdd", "--medium", "none"]

Stderr: VBoxManage: error: Controller 'IDE Controller' does not support hotplugging
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachDevice(Bstr(pszCtl).raw(), port, device)" at line 403 of file VBoxManageStorageController.cpp
vagrant version
Installed Version: 2.2.6

vagrant plugin list
vagrant-cachier (1.2.1, system)
vagrant-hostmanager (1.8.9, system)
vagrant-libvirt (0.0.45, system)
vagrant-lxc (1.4.3, global)
vagrant-lxd (0.4.3, global)
vagrant-persistent-storage (0.0.48, global)
vagrant-timezone (1.3.0, global)
vagrant-vbguest (0.22.1, global)

 vboxmanage --version
6.1.4r136177

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

No branches or pull requests

4 participants