In this video we're going to talk about virtual machine hard drives.
If you use virtual machines for teaching and learning and development and application isolation
and all the wonderful things that you can do with virtual machines.
And if you're unsure about what I'm talking about, check out some of my other
videos where I talk about virtual machines and how to use them.
But if you're using virtual machines you'll know that one of the challenges with them is that they take up space.
When we create the virtual hard drive, it takes up space And as we get.
and more virtual machines, Start running out of space. But if we understand how virtual
machine hard drives work which is what I'm going to talk about in this video, then we can manage that process.
I'm going to show you how we can move virtual machines around.
I'm going to show you how we can duplicate a virtual machine, make a
copy of it and share it out with a whole bunch of different people.
This is especially useful. If let's say I'm teaching a class on Linux, and I want to make sure
that I have 10 exact same copies of the Linux distribution on 10 different machines.
Easily done. I'll show you how I'll also show you a secret that I use to have a huge,
basically unlimited library of virtual machines that I can have available when I need them, but
I can put away when I don't let's go take a look at virtual machine hard drives an essential
skill for managing our virtual machines and making them work for us.
To understand virtualization We look at the basics of a computer A computer has various different resources.
We have an operating system and that operating system. Controls those resources and lets us use them.
We refer to this as our host system. Now if I want to put a virtual machine on a host system,
I'm basically sharing all of the resources of the computer with a guest system.
Now when I turn off the guest system, it returns everything back to the host.
Except for the disc space it was using with the disc space every virtual machine.
will take space from my host systems resources, which can really add up.
Now I could push those out to an external drive and store virtual machines there.
But what ends up happening is I wind up with a lot of external drives to house all of my virtual
machines, and that can make it a little bit confusing as to where my virtual machines are.
Now a virtual machine is comprised of two parts There's a config file which is small.
And then there's the actual hard drive file which is quite large.
And we link those things together. Well what we can do is we
unlink the config file, move the hard drive file.
And then when we copy or move it to a new location, we can create a new config file to control it.
So great solution is to store these virtual machines in a cloud service, pull them down when we need them.
Now for myself the cloud service that I like to use is St Dot com.
So I'll bring it out to sync.com synchronized with the cloud, because sync gives me another
layer, which is called the vault and that's unlimited storage.
So I will use that vault to store lots of virtual machines.
Then I will bring them to the. Think cloud sync it with
my local machine and I can have one virtual machine at a time on my local machine.
Put him back to the cloud put him back into the vault. Let's take a look at how that works.
…Okay So let me show you how I practically manage this process.
So here I am in sync.com and I'm going to work from sync to my local machine and then create a VM.
So I have a whole bunch of virtual machines.
I have them all in directories in the volt section of
sync.com that is not synchronized to my local computer.
And that's a good thing because I have unlimited storage here and I could have terabytes and
terabytes I have virtual machines I actually have, you
know certainly I've upwards of a couple terabytes stored here.
Now That's not going to be good if it does synchronize to my local machine, because of course I
don't have that much free space on my hard drive so I can store.
Unlimited amount of virtual machines here in this vault.
So for example I have this data sandbox directory in here underneath data sandbox I have a
couple of directories For example I have an older sequel version in here.
I can look in here. go further into the directory here.
And the big file that I'm looking for is this sequel
2016 sandbox VMD K.
That's the hard drive That's my virtual hard drive.
But it's in the cloud it's in the vault. It's in that unlimited storage space.
And what I need to do is I need to bring it to my local machine.
If I want to create a virtual machine locally and start working with it.
Well what I've done and I'll go to my files. Is watching go back to the vault.
If I take that directory. And I choose that directory.
I can I move that directory to the files Section of
sync.com and the files section is synchronized with my local computer.
Now I can choose which files or folders are synchronized, but in my case I do have this VM Ubuntu.
That I did synchrony. I moved it from the vault.
To the file section and you will see.
That in my computer here. If I just go here in my file section underneath the sink
directory, I have this VM Ubuntu and there you can see, I
have this 12 gig hard drive, virtual hard drive.
That's been synchronized. To my local machine.
Now I do give myself a little bit of time So let's say for example, next week I was going to be
teaching Uh, some data tools with a boon to Linux or some Python or something.
What I could do. In anticipation of that is I could move it from the vault move the entire
directory into the file section, let it synchronize with my local computer And it could be
multiple local computers by the way, but this is my local computer here.
And then what I can do is I can open up. VMware So I'm making my virtual machines on VMware.
You could make them with other products as well. So you'll notice here I don't have any defined virtual machines.
So I'm going to create a new virtual machine.
When I create the new virtual machine I'm going to choose the custom installation.
And I'm going to accept a lot of defaults here. It's going to be a VMware workstation.
I'm not going to install an operating system Now I'm going to stop a solid later.
In fact I'm not going to. I'm just going to attach an existing virtual hard drive.
So I take the default, it'll be a Linux machine It'll be a boon to Linux.
I'll give it a name if I want to So it doesn't matter what I call it but I'll call it data for the data sandbox there.
Now this will create the configuration file that small file.
And that'll put that in my documents directory. I'll accept the
defaults for processors We're going to accept a lot of defaults here.
I might give it a little bit more Ram. So this is a nice thing as well.
So it could be that for exam. my computer has 32 gigs of Ram.
Maybe I have a different computer that only has 16 gigs or maybe one that only has eight.
When I create the virtual machine to attach the hard drive to I can adjust the resources.
So I'm gonna go into next and they'll choose network address translation.
Choose the standard bios the standard board the standard type of desk.
This is the important screen. I'm not going to create a new virtual disc.
What I am going to do is use an existing virtual disc.
And the virtual disc I'm going to use is the one that I moved from the vault.
To the file section synchronized with my computer and
now have in my local computer in that sync directory.
So I'm gonna use an existing virtual disc. I'm going to browse for it.
I'm going to browse to the sink directory. VM Ubuntu.
There's the hard drive. That's the hard drive I'm going to use.
Now when I click next, I can just start this machine and it could be that this virtual disc has
a whole bunch of different applications installed.
I've got my security on it. I don't need to re-install it.
I just need to power it on. And when it powers it on, it's going to recognize that disc.
So this is just some um devices like the CD rom So I don't need that there.
But I'll go in here This is for the…VM tools So I've finished installing those.
So now what it's going to do is take that hard drive and it's going
to use that in order to build the virtual machine.
Not really bill it just connect to it really. So as you can see, I'm not having to install anything.
I'm not having to configure anything because I did that When I created the original virtual
machine, then I saved that virtual hard drive.
Into the volt in sync.com.
And. it boon to is booting. I'm not having to install it
and any authentic location any accounts any programs?
Anything that I've created in this virtual machine will automatically be there for me.
This is the account I created. And I can just log in and even use the password Of course, that
I created…And now I'm logged into a bone toe.
Uh boon to, and now this one here I just, I just set it up for this demo So I haven't really
installed a ton of unique configuration in here, but what's really interesting is that let's
say I wanted all my students to have this exact version of a boon to running.
So let's say I did install Python and I did put sample scripts in there And I really configured that virtual machine.
What's really interesting here. Is that I could just go into.
My…Machines here Say this a boon to.
I can choose that folder and I could share that out to them.
So I could actually share out a link and it doesn't have to be a collaborational You'd just be read only.
And then the students could come there, download the virtual hard
drive, have VMware player running on their computer which is free.
And then I could show them how to connect to the that hard drive that I created.
And now everybody has the exact same machine.
Now there are licensing issues So if I'm doing that with windows, I may have to have it
Unactivated when I distributed and then they can use Their Azure for education.
Activation code in order to activate it That's that's a topic for another day, but you
Microsoft is quite generous at least in the academic world,
in terms of giving out a lot of free licenses or trials.
And certainly Linux is something that we use all the time
and it's very easy to distribute the virtual hard drive Pre-configure.