Use same VM from different host OSes?

This is for discussing general topics about how to use VirtualBox.
Brutalizer
Posts: 76
Joined: 7. Oct 2012, 18:24

Use same VM from different host OSes?

Post by Brutalizer »

Is it possible to use the same VM from different host OSes? I have installed Solaris 11.3 and Linux Mint 18.3 as host OSes. I have a ZFS data disk with VMs that can be imported into Solaris and into Linux. Is it safe to boot the same VM from Solaris, and from Linux? I will reboot from host OS to host OS. I will also use the same VB version on both Solaris and Linux. I will install the guest additions in the VM once. I guess I do not need to reinstall guest additions when I change host OS?

1) Is it safe to use same VM from Solaris and from Linux?
2) How about guest additions in the VM? It suffices to install guest additions into the VM, once?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Use same VM from different host OSes?

Post by mpack »

The guest additions are the guest additions, they don't know or care what the host OS is.

The main problem will be that device and path names (e.g. NIC to bind to, path to an ISO) differ between hosts. There aren't many of these embedded in a .vbox file, but they do matter.
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: Use same VM from different host OSes?

Post by socratis »

Exactly what mpack said.
I don't have Linux/Solaris, I have OSX/Windows. That makes it even harder, because there is no way to store a shared folder's path in a "unified" way, and of course the host NICs don't match, if you want to use Bridged networking.

Oh, since we're on the networking front, if you use HostOnly, or NAT, or NATservice, the closest you have them set up, the less configuration you'll have to do.
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.
Brutalizer
Posts: 76
Joined: 7. Oct 2012, 18:24

Re: Use same VM from different host OSes?

Post by Brutalizer »

mpack wrote:The main problem will be that device and path names (e.g. NIC to bind to, path to an ISO) differ between hosts. There aren't many of these embedded in a .vbox file, but they do matter.
This problem will not corrupt my VMs? How can I go around these problems? Do I need to configure the VM from each host OS? Or export and import VM?

So I should try to have the configs identically between host OSes? I only need to reconfig the NIC between hostOSes, and that is all?
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: Use same VM from different host OSes?

Post by socratis »

• Copy the whole VM folder.
• Register the VM by double-clicking the .vbox file, or use the "Add..." menu.
• Fix the configuration wherever it needs fixing, i.e. shared folders, NICs.
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.
Brutalizer
Posts: 76
Joined: 7. Oct 2012, 18:24

Re: Use same VM from different host OSes?

Post by Brutalizer »

socratis wrote:• Copy the whole VM folder.
• Register the VM by double-clicking the .vbox file, or use the "Add..." menu.
• Fix the configuration wherever it needs fixing, i.e. shared folders, NICs.
Thanx for yur help. It seems it is difficult to share the same VM, as you suggest i make a separate copy? It would simplify if i could work on the same vm instead of working of different vms. Then i have to synch the VM, which would defeat the purpose
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: Use same VM from different host OSes?

Post by socratis »

Let me fix what needs fixing in your case:
socratis wrote:Place the VM in a common/shared folder. If you have no user security, even better, something like a FAT32, exFAT folder. Otherwise you'll have to adjust the file permissions every time.
• Copy the whole VM folder ".vbox" file to something like "<VM>-Solaris.vbox" (or "<VM>-Linux.vbox").
• Register the "new" VM by double-clicking the "new" .vbox file, or use the "Add..." menu in the 2nd OS, the one you haven't registered the VM yet.
• Fix the configuration wherever it needs fixing, i.e. shared folders, NICs.
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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Use same VM from different host OSes?

Post by mpack »

Brutalizer wrote:Then i have to synch the VM, which would defeat the purpose
If you mix host OSs then you must expect a certain inconvenience, you're lucky to have the same app available on both at all.

With a bit of care, and avoiding snapshots etc, it may be possible to copy the VM between hosts and fix the above problem, and after that keep them in sync by copying the hard disk image between them. There may still be problems due to the visible network changes, but those ought to be minor.
jonha
Posts: 33
Joined: 31. Jul 2015, 19:09

Re: Use same VM from different host OSes?

Post by jonha »

I'm regularly sharing VMs between Linux and Windows hosts. The guest .VDI files work OOTB on all hosts (some use guest additions, some don't) and I have never encountered any trouble with these.

The (small) problem is, as mpack said, absolute filenames in the .VBOX file(s). I would think that if you name your files and directories carefully between your Solaris and Linux hosts (and perhaps use a few symlinks in the hosts) you should be able to more or less share the .VBOX files. If that doesn't work then you will have to create separate versions, but there are only a few places to change.
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: Use same VM from different host OSes?

Post by socratis »

Whatever you end up doing, it is not "supported", but if it works (one way or another) keep us in the loop on what you ended up doing... ;)
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.
jonha
Posts: 33
Joined: 31. Jul 2015, 19:09

Re: Use same VM from different host OSes?

Post by jonha »

socratis wrote:Whatever you end up doing, it is not "supported"
Hm... what exactly in sharing VMs between hosts is "not supported"? Are there any official statements or warnings? Have I missed something?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Use same VM from different host OSes?

Post by mpack »

I think that Socratis simply means that nowhere in the documentation will you find a claim that you should be able to copy a VM between dissimilar hosts and it will work without issues.
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: Use same VM from different host OSes?

Post by socratis »

jonha wrote:Are there any official statements or warnings?
There's no official statement or warning from my computer's manufacturer that I shouldn't be using it while taking a shower. Neither for my cigarettes. That was a bummer... ;)

VirtualBox was designed according to a set of rules/specifications. That did not include sharing installations among hosts. That did not include even sharing among different users on the same host. Not in the specs.

If you want to do it fine. But you know what they say; if you want to hack something, you'd better be a good hacker or willing to learn on your own.


PS. Teleporting is a completely different concept, not to be confused with what you're trying to do.
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.
Brutalizer
Posts: 76
Joined: 7. Oct 2012, 18:24

Re: Use same VM from different host OSes?

Post by Brutalizer »

socratis wrote:Let me fix what needs fixing in your case:
socratis wrote:Place the VM in a common/shared folder. If you have no user security, even better, something like a FAT32, exFAT folder. Otherwise you'll have to adjust the file permissions every time.
• Copy the whole VM folder ".vbox" file to something like "<VM>-Solaris.vbox" (or "<VM>-Linux.vbox").
• Register the "new" VM by double-clicking the "new" .vbox file, or use the "Add..." menu in the 2nd OS, the one you haven't registered the VM yet.
• Fix the configuration wherever it needs fixing, i.e. shared folders, NICs.
Socratis, you are the man! Exactly what I needed. Thanx! :)

Jonha, thanx for your input. I will try this out and be careful about the VBOX files. The VM will be on a separate ZFS disk, which both Solaris and Linux can access, using the same path. So this should do it. I assume you are careful with using the same VB version on both hosts? It would be problematic to use different VirtualBox versions?
jonha
Posts: 33
Joined: 31. Jul 2015, 19:09

Re: Use same VM from different host OSes?

Post by jonha »

socratis wrote:There's no official statement or warning from my computer's manufacturer that I shouldn't be using it while taking a shower.
I think in today's multifaceted world it is entirely to be expected that some people might want to develop a desire to share VMs between hosts.
socratis wrote:VirtualBox was designed according to a set of rules/specifications. That did not include sharing installations among hosts. That did not include even sharing among different users on the same host. Not in the specs.
Do you actually have a link which details "the specs"? It might be an illuminating read for a blockhead like me.
Post Reply