VM has become 'inaccessible' - Vagrant no longer working

后端 未结 12 2167
礼貌的吻别
礼貌的吻别 2021-01-30 13:24

For some reason this morning when I run \'vagrant up\' I get the following error (this has worked absolutely fine for over a year)

Your VM has b         


        
相关标签:
12条回答
  • 2021-01-30 13:38

    You can simply delete the .vagrant folder from your project folder and run vagrant up again.

    0 讨论(0)
  • 2021-01-30 13:42

    This worked for me

    After some digging through the debug output, I discovered that even though the actual VM is intact (I can load and run it from the VirtualBox GUI app), somewhere in its guts, VirtualBox flagged this VM as "". Vagrant, rightly believing what it's told, spits out the error message.

    After looking at VBoxManage's help, I found that one its commands, list vms, unsurprisingly lists all of the VMs registered with VirtualBox:

    $ /cygdrive/c/Program\ Files/Oracle/VirtualBox/VBoxManage.exe list vms
    "precise64" {3613de48-6295-4a91-81fd-36e936beda4b}
    "<inaccessible>" {2568227e-e73d-4056-978e-9ae8596493d9}
    "<inaccessible>" {0fb42965-61cb-4388-89c4-de572d4ea7fc}
    "<inaccessible>" {c65b1456-5771-4617-a6fb-869dffebeffffd}
    "<inaccessible>" {9709d3d5-ce4d-42b9-ad5e-07726823fd02}
    

    One of those VMs flagged as inaccessible is my lost VM! Time to fix VBoxManage's wagon, by unregistering the VM as inaccessible, then re-registering it with the correct name:

    1. Open the configuration file for your lost VM. Mine was saved to C:\cygwin\home\Philip\VirtualBox VMs\rails-vm-v2\rails-vm-v2.vbox
    2. Find and copy the value of the uuid attribute of the Machine node. Mine was 9709d3d5-ce4d-42b9-ad5e-07726823fd02.
    3. In a Windows command prompt (or Cygwin terminal), unregister the VM with the unregistervm command, using the [uuid] value from step 2:

      $ C:\Program Files\Oracle\VirtualBox\VBoxManage.exe unregistervm [uuid]
      
    4. Now register the VM using the registervm command, with the path to the VM configuration file:

      $ C:\Program Files\Oracle\VirtualBox\VBoxManage.exe registervm C:\cygwin\home\Philip\Virtual VMs\rails-vm-v2\rails-vm-v2.vbox
      

      Now you should be able to start the VM as expected.

    Source : http://www.psteiner.com/2013/04/vagrant-how-to-fix-vm-inaccessible-error.html

    0 讨论(0)
  • 2021-01-30 13:47

    I also had this problem. when change directory of virtualBox after restart macOS virtualbox get inaccessible to all vms.

    my solution worked.

    just move virtual box to default directory. remove all inaccesible vms from gui, then register vms from default path next run it.

    or

    vagrant up
    
    0 讨论(0)
  • On Linux the following will unregister the machines:

    VBoxManage list vms
    VBoxManage unregistervm <inaccessible machine UID>
    

    After that you may want to restart VB services:

    sudo /sbin/vboxconfig
    

    Deleting .vagrant folder may help but you had to rebuild the machines.

    0 讨论(0)
  • 2021-01-30 13:50

    VirtualBox Manager will likely give you a bit more useful information, for example in my case it reported that the .vbox file did not exist.

    After taking a look the problem was indeed that the file didn't exist - something had renamed it to x.vbox-tmp (shutting the PC down with the VM still running maybe?)

    I copied the x.vbox-prev file to x.vbox and tried booting the VM again and everything worked fine.

    0 讨论(0)
  • 2021-01-30 13:53

    I had to rename [vm-id].vbox-tmp (on VirtualBox VMs) to [vm-id].vbox. After that, without delete the .vagrant folder, I could run vagrant up and it worked very well.

    0 讨论(0)
提交回复
热议问题