Page 1 of 1

Is a snapshot a good idea for distributing a VM?

Posted: 15. Jan 2016, 21:13
by DonMorton
I've used VirtualBox for quite a few years, but just as a passive user who needed Linux on a Windows machine, or vice versa. So, I'm not real literate in many of the lower level details

Now, I'm teaching a course in Network Security, and I have had this vision of having students do things like setting up firewalls, using wireshark, etc. in a preconfigured version of Linux. The thought has been to build my custom machine (I'm looking at Puppy Linux right now) in Virtual Box, and then make it available to students for download to import into their own VirtualBox. What I "think" I have understood is that making a snapshot of my current machine is the path to take, but I have recently heard suggestion that maybe snapshots aren't the best approach.

I am aware of colleagues who did something similar a few months ago, building a Linux distribution with atmospheric models installed in a VirtualBox VM, and then distributing that for course use, and it apparently worked well, though I'm not sure if they used snapshots.

I wonder if somebody might be able to nudge me in the right direction here. I've already succeeded in taking a snapshot of a Puppy Linux distribution and loading it in VirtualBox on another computer (I've had some issues getting it to load in a version 4 VirtualBox, but that could easily be my own problem), so to me it seems like kind of a no-brainer. Am I missing something?

Best,

Don

Re: Is a snapshot a good idea for distributing a VM?

Posted: 18. Jan 2016, 15:52
by scottgus1
Based on this earlier conversation you had with Mpack, viewtopic.php?f=1&t=75741, I believe you're using the word "snapshot" differently than Virtualbox uses it.

In Virtualbox, a "snapshot" is a point-in-time marker for you to "time-travel" in a guest. You can bounce back and forth along the various snapshots to the times in the development of the guest when the snapshots were taken. Each snapshot consists of a list of all the settings for the guest as well as all new data written into the guest since the snapshot was taken. See section 1.10 and 5.4 to 5.6 in the manual. As pointed out by Mpack, the Virtualbox "snapshot" is an integral part of the guest and cannot be distributed on its own. They also make a guest more delicate and do not work as backups. They should only be used on guests you're experimenting with and with data you wouldn't mind losing.

But don't worry, I don't think using the official "snapshot" is what you're really wanting to do. You want to distribute copies of your already-configured guest. That is completely do-able. The easiest way is to copy the guest folder to the students' computers (the new hosts). See Moving a VM.

Keep in mind that the students will have exact copies of your guest, including MAC addresses and computer names, which may cause conflicts on a network. If you use Virtualbox's "Bridged" networking as the method to attach your guests to the network, the copies of the guest will be expecting to "bridge" to the network card in your host, which may not be the kind of card your students' PCs have. Try distributing your guests with a virtual NIC set to NAT, but with "cable disconnected" in the guest's Settings. Teach your students to refresh the MAC address on the guest's NIC then connect the "cable" the first time they connect to the network, and to change the computer name or other such possible conflicts that Linux may require. There are also command-line tools to change settings of a guest, so you could run a script that copies the guest and configures the settings. See the Vboxmanage command in the manual.