How to use a VM (not at the same time) in two hosts?

This is for discussing general topics about how to use VirtualBox.
Post Reply
rgbtxus
Posts: 2
Joined: 20. Sep 2017, 17:57

How to use a VM (not at the same time) in two hosts?

Post by rgbtxus »

I have been happily using a WinXP VM with a legacy application in VirtualBox on my main OSX system for years. Recently I changed my portable system to a Windows 10 laptop. I wish to be able to run the legacy application from this laptop when I am on the road and from my main system when at home. The obvious solution of running the legacy application natively on the Win10 laptop seems fraught with problems since it is a Visual FoxPro application, a product that is no longer sold or supported and I am not even sure I would be able to locate the original VFP install media and if I did whether it would run in Win10. The safest course seems to be to just run the VM on the laptop when I am travelling.

I have installed VB on the new Win10 laptop and placed the legacy app VM's vdi image in a shared dropbox folder. I imagine that I can just configure an equivalent VM on the laptop, hook it up to the vdi sitting in the dropbox folder and fire it up. However, my knowledge of the internal workings of windows systems very meager and I fear I may fall into a hole I am unaware of.

Can anyone advise me as to how to accomplish my goal?
Thanks
jonha
Posts: 33
Joined: 31. Jul 2015, 19:09

Re: How to use a VM (not at the same time) in two hosts?

Post by jonha »

I do exactly that with a Windows 7 VM (32 bit) which runs on a Windows host and a Linux host, both 64 bit. The vdi files (I have two vdi files, a big one for virtual drive c: and a smaller for d:) are completely portable; the configuration files are "almost" portable. IIRC the main difference was that path names in the configuration files needed small changes, ie from \ to / and generally adapting the path names. The vdi files reside on an encrypted NTFS partition that is accessible from both hosts (encrypted with VeraCrypt).

(NB: It is also possible to copy the vdi between hosts though that opens a can of worms because they are pretty large. So I normally would not actually copy the vdi files but swap a set of snapshots around. This is pretty straightforward but it requires a clear understanding of how snapshots work and some manual editing of configuration files. I am sure the usual suspects will warn you against that dangerous practice -- and not entirely without reason. Back up your files a lot.)
rgbtxus
Posts: 2
Joined: 20. Sep 2017, 17:57

Re: How to use a VM (not at the same time) in two hosts?

Post by rgbtxus »

Thank you jonha. I will give it a go. I just read a bit about snapshots and it looks like your advice to use them to minimize the amount of data that must be moved between systems when switching host will work very well for me. Thank you again for taking the time to respond.
jonha
Posts: 33
Joined: 31. Jul 2015, 19:09

Re: How to use a VM (not at the same time) in two hosts?

Post by jonha »

Just to be absolutely clear: you don't need to copy vdi files and fiddle around with snapshots if all your hosts are able to access the vdi files, eg if you multi-boot a system with a Windows host and a Linux host where both hosts can access another partition (or possibly even the Windows partition) with the vdi files. (It is a great shame that -- even in 2017 -- Windows is still not able to read and write ext3/4 natively. There are a few 3rd party tools out there but none of them works entirely satisfactorily.)

You only need to think about copying vdi files and perhaps employing snapshots if you have to keep two separate versions of the vdi files around, for instance if your host OSes are not on the same hardware (and even then it may pay to get a fast USB3 stick (if your hardware supports USB3) and use that as an external drive -- this won't be super fast but it may work well enough). If you definitely need copies then it would be worthwhile to look into snapshots... but as I said, read up the docs, get comfortable with how snapshots work and back up everything. Good luck.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How to use a VM (not at the same time) in two hosts?

Post by socratis »

Just remember that a VDI file is not the only thing important in a VM. There's also the "recipe", the VBOX file. And if they get out of sync, I can see a new post asking for help on how to resolve the problem... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply