【问题标题】:Vagrant corrupted index file C:\Users\USERNAME\.vagrant.d/data/machine-index/indexVagrant 损坏的索引文件 C:\Users\USERNAME\.vagrant.d/data/machine-index/index
【发布时间】:2014-09-14 16:03:35
【问题描述】:

我的 Windows 8.1 刚刚崩溃。现在我的 dist 上有一些文件已损坏。这包括我的 vagrant 机器索引(如果命名正确,则不 shure,但我知道它是这个文件 -> C:\Users\USERNAME.vagrant.d/data/machine-index/index)。

所以那里有很多二进制或十六进制的东西(同样不是 shure,因为我通常不处理这些东西,所以如果我错了,请纠正我!)如果我尝试,Vagrant 会吐出以下消息启动后启动一切。

vagrant up 返回此

The machine index which stores all required information about
running Vagrant environments has become corrupt. This is usually
caused by external tampering of the Vagrant data folder.

Vagrant cannot manage any Vagrant environments if the index is
corrupt. Please attempt to manually correct it. If you are unable
to manually correct it, then remove the data file at the path below.
This will leave all existing Vagrant environments "orphaned" and
they'll have to be destroyed manually.

Path: C:/Users/Username/.vagrant.d/data/machine-index/index

【问题讨论】:

    标签: virtual-machine vagrant windows-8.1


    【解决方案1】:

    当我的笔记本电脑意外崩溃时,我在第一次尝试运行 vagrant up 时遇到了同样的 vagrant 问题(索引)。

    The machine index which stores all required information about
    running Vagrant environments has become corrupt. This is usually
    caused by external tampering of the Vagrant data folder.
    
    Vagrant cannot manage any Vagrant environments if the index is
    corrupt. Please attempt to manually correct it. If you are unable
    to manually correct it, then remove the data file at the path below.
    This will leave all existing Vagrant environments "orphaned" and
    they'll have to be destroyed manually.
    
    Path: C:/Users/{user}/.vagrant.d/data/machine-index/index
    

    不幸的是,我的问题并没有通过删除 index 和 index.lock 文件来解决,因为投票最多的答案告诉我。我使用 virtualbox GUI(用作 VM 提供程序)重新启动了我的 vm,并显示了以下消息。

    Entering emergency mode. Exit the shell to continue.
    Type "journalctl" to view system logs.
    You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
    after mounting them and attach it to a bug report.
    

    我意识到崩溃会在 VM 的 FS 上产生错误。因此,经过搜索和调查,我通过执行以下命令克服了该问题。

    xfs_repair -v -L /dev/dm-0
    

    环境信息:操作系统 windows10、virtual-box 6.1、vagrant 2.2.7 和 vm-os centos7

    【讨论】:

      【解决方案2】:

      在 Windows 10 中使用 Vagrant 2.2.5 时,我必须导航到 /Users/{yourname}/.vagrant.d/data/machine-index 并删除 indexindex.lock,所以 rm index 然后是 rm index.lock

      最后我导航回 Homestead 文件夹并运行 vagrant up

      【讨论】:

      • PS:是的,我应该更新我的流浪者 - 我会在这个项目之后做,我保证! (:
      【解决方案3】:

      同样的事情也发生在我身上。所以我只是从 machine-index 文件夹中删除了索引文件和 .lock 文件,让 Vagrant 再次工作。

      【讨论】:

      • 这对我也有用。只是不要忘记删除两个文件(如果存在)index.lock 和 index。我首先只删除了 .lock 并没有用 :)
      • 对我来说并不清楚,我认为值得一提:这个修复不仅让 Vagrant 再次工作,而且还允许 Vagrant 在运行 vagrant up vm-name 等命令时再次找到你的虚拟机。(只要你有 Vagrantfile 并且所有的 .vagrant 文件都保持不变)。
      • 这拯救了我的一天。我买了一个新的mac,用superduper和rsync完成了系统还原。一切正常,但我无法启动我的流浪汉。错误消息是,我尝试启动的机器已锁定。我花了两个小时弄清楚如何解决这个问题,直到到达这里。所以只要从~/.vagrant.d中删除index、index.lock,然后去vagrant目录做vagrant up就可以完成了。
      • 最好!解决方案..!
      • 错误信息很吓人,但解决方案却很简单。谢谢
      猜你喜欢
      • 1970-01-01
      • 2015-06-20
      • 1970-01-01
      • 1970-01-01
      • 2021-05-13
      • 2014-09-26
      • 2014-02-07
      • 2018-04-03
      • 1970-01-01
      相关资源
      最近更新 更多