VirtualBox 快照

发布于 2024-08-15 09:48:14 字数 265 浏览 5 评论 0原文

这就是发生的事情。

我有一个在 Linux 虚拟机中工作的快照。一位朋友请求一个干净的虚拟机作为我的克隆。因此,我关闭/关闭正在运行的虚拟机,制作了 Disk1.vdi 的副本以及快照 ({uuid}.vdi)。然后我重新启动虚拟机并合并快照,删除我的主目录并为我的朋友制作一个 tar+bz2 。

然后,在恢复备份后,我无法安装快照。虚拟机似乎从我的快照之前的版本启动。我似乎无法找到一种方法来安装回我的快照。

知道如何让 VirtualBox 看到快照并挂载它吗?

Heres what happened.

I had a snapshot on which I was working from within a linux VM. A friend requested a clean VM as a clone of mine. So I closed / shutdown my running VM, made a copy of the Disk1.vdi along with the snapshots ({uuid}.vdi). Then I restarted the VM and did merged snapshots, deleted my home directory and made a tar+bz2 for my friend.

Then after I restored my backups, I am not able to mount my snapshot. The VM seems to boot from my version before snapshot. I cant seem to find a way to mount back my snapshot.

Any idea how to make VirtualBox see the snapshot and mount it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

呆° 2024-08-22 09:48:14

我不是专家,但碰巧对这个话题做了一些调查。您表示在进行更改之前备份了磁盘(VDI 和快照),但没有备份虚拟机本身(XML 文件)。因此,您通过将 VDI 和快照恢复到已更改的虚拟机(仍然认为只有合并磁盘而没有快照)而造成了不兼容性。如果没有原始 VM 文件本身的备份,您可能会运气不好。 (请参阅使用多个快照克隆虚拟机以获取支持证据。)

I am not an expert but have coincidentally done some investigation into just this topic. You indicated that you backed up your disks (VDI and snapshots) before making changes but you did not back up the VM itself (the XML file). So you have created an incompatibility by restoring VDI and snapshots to the changed VM (that still thinks there is only a merged disk with no snapshots). Without a backup of the original VM file itself you may be out of luck. (Please see Cloning a VM With Multiple Snapshots for supporting evidence.)

久随 2024-08-22 09:48:14

您可以继续处理快照,这很棘手,但可以尝试以下操作(没有运行虚拟机):

  • 打开 VirtualBOX GUI
  • 转到管理磁盘
  • 将主 VDI 与虚拟机分离。
  • 将其设置为不可变。
  • 从虚拟机重新附加主 VDI
  • 退出所有 virtualbox 进程
  • 使用 VBoxManage showhdinfo 获取快照 VDI 的 uuid,您要使用的不是主 VDI 不可变时创建的 UUID
  • 现在使用文本编辑器编辑 VBOX 文件并查看对于创建的快照的路径,以便您知道在哪里删除该小文件,不要关闭文本编辑器
  • 删除该小快照 vdi 文件
  • 现在,在文本编辑器上,将快照的 uuid 和路径替换为将快照 vdi 指向快照 vdi 文件
  • 保存 VBOX 文件并关闭文本编辑器。

为了将来:请记住也备份 VBOX 文件。

这个技巧是基于让 VirtualBox 创建一个假的快照文件(您将手动删除的文件),并用您的快照替换添加到 vbox 文件的引用,但还要将快照文件的 uuid 替换为正确的 uuid ,为此您可以使用 showhdinfo 获取它。

请注意,VBOX 文件上的快照 uuid 出现在寄存器(靠近开头)和附加部分(靠近结尾)的部分中,您必须替换两者,您可以使用搜索和搜索。将新的 uuid 替换为您的 uuid。

希望它对你有用;我从不制作虚拟机的快照,我更喜欢不可变的方式(但这仅适用于一个级别)。

You can get back to work the snapshot, tricky but may try this (with no Virtual Machine running):

  • Open VirtualBOX GUI
  • Go to manage disks
  • Detach your main VDI from your Virtual machine.
  • Set it as INMUTABLE.
  • Reattach the main VDI from your Virtual machine
  • Exit from ALL virtualbox processes
  • Get the uuid of your snapshot VDI with VBoxManage showhdinfo, the one you want to use not the one created when making immutable the main VDI
  • Now edit the VBOX file with text editor and look for the path of the snapshot that was created so you know where to go to delete that small file, do not close the text editor
  • Delete that small snapshot vdi file
  • Now, on the text editor, replace the uuid of the snapshot and the path to the snapshot vdi to point to your snapshot vdi file
  • Save the VBOX file and close the text editor.

For future times: Remember to also backup the VBOX files too.

The trick is based on making VirtualBox create a fake snapshot file (a file that you will manually delete) and replace the references added to the vbox file with your snapshot, but take take to also replace the uuid of the snapshot file with the correct one, for that you can get it with showhdinfo.

Be warned, the snapshot uuid on the VBOX file appears on to sections, the register (near the beginning) and the attached section (near the end), you must replace both, you can use search & replace the newly uuid with yours.

Hope it will work for you; i never do snapshots of a virtualbox, I prefer the immutable way (but that is only for just one level).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文