VirtualBox

Ticket #8765: vbox-debug-session.txt

File vbox-debug-session.txt, 9.7 KB (added by Stephen Thomas, 13 years ago)
Line 
1Here's step 1:
2
3stephen@jellyshot:~$ mkdir vboxhold
4stephen@jellyshot:~$ mv .VirtualBox/ VirtualBox\ VMs/ vboxhold/
5
6
7Then after completing GUI steps 2 through 12 to make the master VM, check the result:
8
9stephen@jellyshot:~$ vboxmanage list hdds
10UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
11Parent UUID: base
12Format: VDI
13Location: /home/stephen/VirtualBox VMs/master/master.vdi
14State: created
15Type: normal
16Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
17
18
19So far so good. Now check again after doing steps 13 through 15 to snapshot the master VM:
20
21stephen@jellyshot:~$ vboxmanage list hdds
22UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
23Parent UUID: base
24Format: VDI
25Location: /home/stephen/VirtualBox VMs/master/master.vdi
26State: created
27Type: normal
28Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
29
30UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
31Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
32Format: VDI
33Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
34State: created
35Type: normal
36Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
37
38stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
39 <MediaRegistry>
40 <HardDisks>
41 <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
42 <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
43 </HardDisk>
44 </HardDisks>
45 <DVDImages/>
46 <FloppyImages/>
47 </MediaRegistry>
48
49
50That's all making sense. After steps 16 through 21, things are still looking OK:
51
52stephen@jellyshot:~$ vboxmanage list hdds
53UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
54Parent UUID: base
55Format: VDI
56Location: /home/stephen/VirtualBox VMs/master/master.vdi
57State: created
58Type: normal
59Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
60
61UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
62Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
63Format: VDI
64Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
65State: created
66Type: normal
67Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
68
69UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
70Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
71Format: VDI
72Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi
73State: created
74Type: normal
75Usage: slave (UUID: 5bc28a02-31de-47ac-91a7-d1b54448f3da)
76
77stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
78 <MediaRegistry>
79 <HardDisks>
80 <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
81 <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
82 <HardDisk uuid="{8c4c95d3-fd3c-42dc-8424-3148315f1f07}" location="/home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi" format="VDI"/>
83 </HardDisk>
84 </HardDisks>
85 <DVDImages/>
86 <FloppyImages/>
87 </MediaRegistry>
88stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/slave/slave.vbox
89 <MediaRegistry>
90 <HardDisks/>
91 <DVDImages/>
92 <FloppyImages/>
93 </MediaRegistry>
94
95
96Interesting. The slave VM's .vbox file contains an empty HardDisks media registry section, and the differencing disk created inside the slave's Snapshots folder to let the slave VM attach master.vdi is listed in the *master* VM's media registry.
97
98Anyway, press on with steps 22 through 24 to snapshot the slave, then check again:
99
100stephen@jellyshot:~$ vboxmanage list hdds
101UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
102Parent UUID: base
103Format: VDI
104Location: /home/stephen/VirtualBox VMs/master/master.vdi
105State: created
106Type: normal
107Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
108
109UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
110Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
111Format: VDI
112Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
113State: created
114Type: normal
115Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
116
117UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
118Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
119Format: VDI
120Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi
121State: created
122Type: normal
123Usage: slave (UUID: 5bc28a02-31de-47ac-91a7-d1b54448f3da) [Snapshot 1 (UUID: 19daf6b0-b7d7-43b6-9f98-8dde42c967cc)]
124
125UUID: 9ffed033-c605-4bdd-ae84-bc87af9af57b
126Parent UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
127Format: VDI
128Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{9ffed033-c605-4bdd-ae84-bc87af9af57b}.vdi
129State: created
130Type: normal
131Usage: slave (UUID: 5bc28a02-31de-47ac-91a7-d1b54448f3da)
132
133
134OK, the slave is now using a new differencing disk {9ffe...} which is a child of its old one {8c4c...} which is itself still in use by slave Snapshot 1. All good so far. Let's check the on-disk media registries:
135
136stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
137 <MediaRegistry>
138 <HardDisks>
139 <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
140 <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
141 <HardDisk uuid="{8c4c95d3-fd3c-42dc-8424-3148315f1f07}" location="/home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi" format="VDI"/>
142 </HardDisk>
143 </HardDisks>
144 <DVDImages/>
145 <FloppyImages/>
146 </MediaRegistry>
147stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/slave/slave.vbox
148 <MediaRegistry>
149 <HardDisks/>
150 <DVDImages/>
151 <FloppyImages/>
152 </MediaRegistry>
153
154
155DANGER, WILL ROBINSON - they are exactly as before; neither one contains any information about {9ffe...}.
156
157So, let's shut down the GUI, wait long enough for the service to exit, and then see what we have:
158
159stephen@jellyshot:~$ vboxmanage list hdds
160UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
161Parent UUID: base
162Format: VDI
163Location: /home/stephen/VirtualBox VMs/master/master.vdi
164State: created
165Type: normal
166Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
167
168UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
169Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
170Format: VDI
171Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
172State: created
173Type: normal
174Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
175
176UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
177Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
178Format: VDI
179Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi
180State: created
181Type: normal
182
183
184Here is my sad face :(
185
186All we have left is what got written out to the <MediaRegistry> tags in the .vbox files; {9ffe...} has just been forgotten entirely, and there is nothing there to say that any of the remaining disks are in use by the slave.
187
188Check the <MediaRegistry> tags in the .vbox files again, just to see if anything changed as the service was shutting down:
189
190stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
191 <MediaRegistry>
192 <HardDisks>
193 <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
194 <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
195 <HardDisk uuid="{8c4c95d3-fd3c-42dc-8424-3148315f1f07}" location="/home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi" format="VDI"/>
196 </HardDisk>
197 </HardDisks>
198 <DVDImages/>
199 <FloppyImages/>
200 </MediaRegistry>
201stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/slave/slave.vbox
202 <MediaRegistry>
203 <HardDisks/>
204 <DVDImages/>
205 <FloppyImages/>
206 </MediaRegistry>
207stephen@jellyshot:~$
208
209
210No. They look the same as they did last time.
211
212This media registry organization strikes me as a rather half-hearted way to go about decentralizing the formerly central registry. It seem to me that if the decentralizing was done to allow a VM to be completely represented inside a single folder, then the slave VM should always have all the disks it's attached to listed in its *own* .vbox file.
213
214Given that the registry's XML format uses nesting to represent parent/child relationships, this would require at least one redundant entry for an ancestral .vdi file outside the slave's folder. Perhaps any such entry could be a stub with only a uuid attribute, to distinguish it from an erroneous duplication?
215
216This would also be enough information to allow a future "VBoxManage uprootvm" command to cut free a VM based on a disk image outside its own folder while keeping all its snapshots intact. For each stub entry found in the .vbox file, it would call "VBoxManage clonehd" internally to make a new, self-contained ancestral disk inside the folder, then replace the stub entry with a full one for the new disk.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy