1

What's the best way of sharing an existing running VM with another user?

To clarify: I don't mean sharing the screen. I mean packaging the maching up, and sending it to someone else so they can import it in their VirtualBox software.

I'm a little confused about whether I should be using Snapshots (is this possible?) or Exporting an Appliance.

And it needs to be a running VM.

The docs seem to say that to Export an Appliance you need to stop the VM.

and when I try and Export a Virtual Appliance it says:

The following virtual machine is currently in a save state: <name of machine>

If you continue the runtime state of the exported machine will be discarded. Other machines will not be changed.

i.e. this Sharing VirtualBox snapshots mentions Exporting but this means stopping the VM.

I'm specifically wanting to capture the runtime state of someone's VM so I can debug a problem within the VM.

Snowcrash
  • 393
  • 2
  • 4
  • 16
  • 1
    You can't share a running VM with Virtualbox. You might be able to grant the other user access to your desktop (e.g. using TeamViewer) or let him access the running VM though (again e.g. by using TeamViewer or similar from within the VM). – Seth Sep 08 '17 at 13:05
  • 1
    @Seth VirtualBox has a build-in RDP server. You need the extension pack installed, but once done, any user can RDP into this server and continue to see the server's output even between boots. They cannot control the VM that way though in the sense: add a harddisk, stop the VM without shutdown, that sort of thing. But they can use the desktop and perform a reboot without being disconnected. They can even perform an OS install this way. – LPChip Sep 08 '17 at 14:19
  • Not sharing via RDP. I mean packaging the maching up, and sending it to someone else so they can import it in their VirtualBox software. – Snowcrash Sep 08 '17 at 14:30
  • You need to export an appliance. Snapshots just allow you to return the VM to a previous state. – Tesseract Sep 08 '17 at 14:35
  • @SpiderPig but that means stopping the VM. And exporting an appliance does not seem to store any snapshots (e.g. of the running system). – Snowcrash Sep 08 '17 at 15:38
  • Why not just send them the VM folder? Or have Virtual Box make a copy with the VM powered down and send the copy, mostly to have a new MAC address associated with the VM. – Damon Sep 11 '17 at 07:47

2 Answers2

1

I think when you talk about sharing you talk about allowing remote access or something similar.

Configure your virtual machine to an interface that allows "Port forwarding":

Your virtual machine must be in a network interface that allows "Port forwarding"...

https://www.virtualbox.org/manual/ch06.html, "Table 6.1. Overview"

https://www.virtualbox.org/manual/ch06.html, "Table 6.1. Overview"

To configure a suitable network interface ("Settings..." -> "Network" -> "Attached to:")...

enter image description here

Configure a "Port forwarding":

You can configure a "Port forwarding" ("Settings..." -> "Network" -> "Advanced")...

"Settings..." -> "Network" -> "Advanced"

... in the interface (NAT/NAT Network) that your virtual machine is for a Remote Desktop Protocol (RDP) (port 3389) or a Secure Shell (SSH) port 22, for example.

TIP: Do not forget to open access in your firewall rules (iptables, if your OS is a Linux or similar) if it is enabled.

Eduardo Lucio
  • 1,194
  • 2
  • 24
  • 48
0

I found out how to do that. First you need to select save the machine state when closing the VM. Then you send your friend the .sav file from the Snapshot folder plus the ova file you get when creating an appliance. Next your friend imports the .ova, runs it and then closes it, saving the machine state as well. Finally he has to replace his .sav file with yours and restart his VM.

edit: Small improvement to prevent problems: After importing the .ova your friend should not start the VM but instead create a Snapshots folder in the folder containing the VM. Next he copies the .sav file into Snapshots and then edits the .vbox file. Near the top of that file there is a line that reads <Machine uuid=... name=... OSType=... snapshotFolder="Snapshots" lastStateChange=...> In that line he needs to add stateFile="Snapshots/[filename].sav" after OSType=... You can send him your .vbox file for comparison.

Tesseract
  • 1,882
  • 1
  • 12
  • 10