流浪者在哪里保存对虚拟机的更改?

我只是从流浪汉开始,我有点难以理解一些细节。我已经通读了文件,但仍然缺少一个基本的概念。当我想启动一个“流浪者”框时,我会运行:

vagrant up

这将“构建基于盒子的虚拟机”我知道盒子存储在 ~/。事实上,我已经从一个基本的 Ubuntu 盒子中打包了我自己的盒子。然而,当我运行漂泊并开始向 vm 添加文件时,存储 vm 的虚拟硬盘在哪里?例如,当我运行 apt-get install apache2并修改根系统时,在哪里修改了它?

当我在我的工作目录上做“ du”时,我没有看到任何变化。我也没有在 ~/中看到任何变化。D 目录。但是,我可以做流浪停止,重新启动我的本地机器,然后再次运行流浪和变化是持久的地方。

流浪汉也上报了

[default] VM already created. Booting if its not already running...

谁能告诉我虚拟机是在哪里创建的,修改是在哪里进行的?

40566 次浏览

Vagrant imports the base box which is located at ~/.vagrant.d/boxes/, like you said. This is where the base boxes are kept. It uses it to start a VM from the clean state. When importing a VM, the responsibility of where to store data files and VM state is up to VirtualBox itself. This is a configurable location but typically defaults to ~/VirtualBox\ VMS for Mac OS X and Linux. In Windows the boxes are kept in %userprofile%\.vagrant.d\boxes

It is easy to find the place where they are getting created, regardless of what platform you happen to be using.

1. Start VirtualBox.
2. Go to the VM that shows as running instance.
3. Check out the Settings ->Storage.
4. You can find the path to location where VMs are created and stored in your file system.

I always change the directory that Virtualbox uses by default for VMs. Normally it is in your profile folder in Windows.

I change it to something like "D:\VHDs\VBox\" and there I found my vagrant test vm: "test01_1347456065". It was called test01, so I guess vagrant adds the numbers to keep things unique.