Page 1 of 2

How to resume machine state from different host?

Posted: 15. Jun 2009, 09:12
by chillrobot
For portability, I need to save machine state on one host and resume it on another. I have set my HardDrives, Machines, and Snapshots dirs to the appropriate subdir of .VirtualBox on my portable external hd (from both hosts), but when I start VB on the second host, no saved state is shown and no snapshots are listed.

How can I resume a saved state on a second host?

I use 2.2.2 on XP Pro (first host) and 2.2.4 on Vista Home Premium (second host).

Re: How to resume machine state from different host?

Posted: 15. Jun 2009, 13:00
by vbox4me2
Host 2 is not looking at the same xml files as Host 1, check locations.

Re: How to resume machine state from different host?

Posted: 18. Jun 2009, 17:53
by chillrobot
The following settings are the same on both hosts, except for the drive letters:

File | Preferences | General | Default Hard Disk Folder
XP - F:\.VirtualBox\HardDisks
Vista - G:\.VirtualBox\HardDisks

File | Preferences | General | Default Machine Folder
XP - F:\.VirtualBox\Machines
Vista - G:\.VirtualBox\Machines

Settings | General | Advanced | Snapshot folder
XP - F:\.VirtualBox\Machines\Win7RCPortable\Snapshots
Vista - G:\.VirtualBox\Machines\Win7RCPortable\Snapshots

What other settings need to be coordinated?

Re: How to resume machine state from different host?

Posted: 18. Jun 2009, 18:20
by vbox4me2
There is a master xml and for each VM its own xml, you need to check them all. Currently you are looking in the GUI, you need to look inside the xml files.

Re: How to resume machine state from different host?

Posted: 21. Jun 2009, 11:35
by chillrobot
I have only one VM, and it's configured by G:\.VirtualBox\Machines\Win7RCPortable\Win7RCPortable.xml on the external drive.

The entire contents of .VirtualBox on the external drive are:

.VirtualBox\VirtualBox.xml
.VirtualBox\HardDisks\Win7RCPortable.vdi
.VirtualBox\Machines\Win7RCPortable\Win7RCPortable.xml
.VirtualBox\Machines\Win7RCPortable\Logs (log files not listed)
.VirtualBox\Machines\Win7RCPortable\Snapshots\{213cd042-edd7-4680-a998-52ae9d05a9ba}.vdi
.VirtualBox\Machines\Win7RCPortable\Snapshots{a10cb512-5f88-4bab-aa3d-eb7d73d4ba0c}.sav

The contents of Win7RCPortable.xml seem to match the Snapshots directory contents. (see attached)

In VirtualBox.xml, I updated <MachineEntry> and <HardDisks>. (see attached)

When I start VB, no snapshots are offered in the UI, nor is any saved state shown. My changes to VirtualBox.xml should have made this work, I think, but didn't.

The log files don't show any errors about bad config.

Why don't these xml files lead the UI to offer saved state and snapshots?

Re: How to resume machine state from different host?

Posted: 21. Jun 2009, 12:23
by TerryE
chillrobot wrote:For portability, I need to save machine state on one host and resume it on another.
Are you machines of the same CPU architecture. Jumping from Intel to AMD is definitely a no-no and you may have problems moving architectures within vendor. It's just that the OS latches a load of info and tuning stuff as part of the OS bootstrap and they don't expect this sort of stuff to miraculously change mid-life.

Re: How to resume machine state from different host?

Posted: 21. Jun 2009, 15:43
by vbox4me2
Your best bet is to copy all the xml files over to the other machine and start from there.

Re: How to resume machine state from different host?

Posted: 22. Jun 2009, 02:02
by chillrobot
TerryE wrote:Are you machines of the same CPU architecture.
Yes:

host1: Intel Core2 Duo T7500 (XP Pro)
host2: Intel Core2 Duo T5550 (Vista Home Premium)
vbox4me2 wrote:Your best bet is to copy all the xml files over to the other machine and start from there.
Remember, I'm using an external hd to store .VirtualBox. The two hosts have access to exactly the same xml files.

I suspect that the UI requires the "location" and "src" attributes of HardDisk, MachineEntry, etc to be absolute paths, and that if they aren't it ignores them. That would make portability difficult, since .VirtualBox is likely to be mounted under different drive letters when on different hosts.

Re: How to resume machine state from different host?

Posted: 22. Jun 2009, 18:30
by vbox4me2
Are you using the vbox_home environment variable to make sure the host is looking at the right place? see also the manual.

Re: How to resume machine state from different host?

Posted: 30. Jun 2009, 16:35
by chillrobot
I set environment variable VBOX_USER_HOME on my second host, restarted VB, and now I get an error "Premature end of data in tag VirtualBox in line 3...Location 'G:\.VirtualBox\VirtualBox.xml', line 34 (3), column 1."

Line 3 is:
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.7-windows">
and line 34 is after the last line of the file,
</VirtualBox>

The physically-same xml files work fine on my primary host, XP Pro, running the same version of VB, 2.2.4, as the secondary host. Since the versions are the same, I don't see why the xml parser would behave differently.

I have also done a VB install on a third windows host, set VBOX_USER_HOME to use the physically-same files, and got the same xml parser error.

Has anyone had luck using external storage to resume saved state across different windows hosts? I can't find anything helpful about this in the user manual.

Re: How to resume machine state from different host?

Posted: 30. Jun 2009, 22:22
by Sasquatch
chillrobot wrote:
TerryE wrote:Are you machines of the same CPU architecture.
Yes:

host1: Intel Core2 Duo T7500 (XP Pro)
host2: Intel Core2 Duo T5550 (Vista Home Premium)
That will be a problem. Those CPU's will generate a different ID. It doesn't matter if they are both Intel CPU's, or Core2Duo, they differ in hardware and that is enough to cause even one bit to be different in the identification. Restoring a saved state without a precise match of the CPU ID will fail. This ID is saved in the .sav file and therefore cannot be changed. Modifying it with a hex editor might get you to match the ID, but the file itself might get corrupted and restore will fail as well. Not to mention the possible corruption of the entire VM.

And to make the different systems show the states, you have to modify the VM xml file itself too, so it won't list G:\...\.sav, when it should look at F:\... You can use Snapshots that way, not saved states.

Re: How to resume machine state from different host?

Posted: 1. Jul 2009, 02:21
by chillrobot
Sasquatch wrote:You can use Snapshots that way, not saved states.
Thank you for the clarification. Maybe someday VB will support portability of machine state, too.

FWIW, I tried resuming a snapshot on my second and third hosts (when there was no saved state) but got the xml parse error noted above.

Re: How to resume machine state from different host?

Posted: 1. Jul 2009, 21:01
by Sasquatch
The error means that there is an open tag somewhere that isn't closed before the final close tag is noted. Like with HTML code, where you start with html, then body, but if you close html before body, then you can get errors like these.

Re: How to resume machine state from different host?

Posted: 2. Jul 2009, 02:57
by TerryE
You can also get this error if you open an XML created by, say, 3.0.0 in version 2.2.4. If you want to share the XML definitions then make sure you run the same version of VBox on all machines.

Re: How to resume machine state from different host?

Posted: 2. Jul 2009, 03:11
by chillrobot
Thanks Sasquatch and TerryE, but as I mentioned I made sure to run the same version of VB on all windows hosts before encountering this error.

And the xml is well-formed. The files are attached earlier in this thread.

If there are any VB developers who can suggest a test to help debug this situation, I'd be eager to try it.