Running same VM image on 2 different hosts

Discussions related to using VirtualBox on Windows hosts.
Post Reply
madroots
Posts: 1
Joined: 20. Sep 2018, 14:35

Running same VM image on 2 different hosts

Post by madroots »

Hello, I am trying to figure this out. Scenario:

I am running ubuntu server on my laptop with win10 virtualbox host. Server needs to be up 24/7.
During night hours, I am without wifi connection (temporarily). Wifi is turned off while I can still use cable to connect my laptop and still get internet connection regardless wifi. Except, I have no access to the router with my laptop, I have access to the router with another PC sitting next to router.

I was thinking to run server from my laptop when on wifi, then export ubuntu server VM, and import it on another computer, have it connected using cable, turn server on during night hours, then shut it down and again run server from my laptop.

Is something like this possible?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Running same VM image on 2 different hosts

Post by mpack »

Export/Import is only necessary if it isn't VirtualBox at both ends, and anyway is undesirable because each imported VM is a clone, not a copy. A clone has new UUIDs and MAC addresses.

When moving a VirtualBox VM see Howto: Move a VM. You may have to adapt the basic technique to cater for the different targets.
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: Running same VM image on 2 different hosts

Post by Rootman »

madroots wrote: Is something like this possible?
Yes, within reason. If the 'other' intended host is also Windows you can simply COPY the entire VM to the other host and then use MACHINE -> ADD from the other hosts VB dialog. You will likely have to adjust the network binding on the second VM if the NIC is enumerated differently on the other host - this would be a one time setting.

What will NOT happen is whatever this guest is doing if it requires some sort of data to be updated and that data resides on the VM itself, it will NOT update this data from one VM to the other. Each VM when started will be in in the state it last was when shut off. If this is the case you will have to come up with some way to update the data between VMs.

You should also not run both VMs at the same time on the same network as the hostnames will be the same and this will cause an IP conflict, so shut down #1 and then start #2.
socratis
Site Moderator
Posts: 27330
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: Running same VM image on 2 different hosts

Post by socratis »

Rootman
You wouldn't copy the VM folder, you would move the VM folder, you'd only have one VM, not two. Given all the restrictions that you mentioned.
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.
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: Running same VM image on 2 different hosts

Post by Rootman »

socratis wrote:Rootman
You wouldn't copy the VM folder, you would move the VM folder, you'd only have one VM, not two. Given all the restrictions that you mentioned.
Depends on how much time he wants to spend every day swapping the host for the VM. Unless it's a tiny VM it would most likely be impractical. In that case I wouldn't move the entire folder, just the VDI files, that way the settings would still be on each host for the network bindings and whatnot.

I brought up the restrictions because some end users think that any generated data on the other host will magically appear on the original one. With the OP not explaining just what the VM did, I am not sure it's important. If it generates any kind of data he'll either have to move it to a common networked destination or come up with some way to sync it when he changes over.
socratis
Site Moderator
Posts: 27330
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: Running same VM image on 2 different hosts

Post by socratis »

Rootman wrote:I wouldn't move the entire folder, just the VDI files
Just one small note; this would fail if you were to use snapshots. If no snapshots are used, I completely agree.
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