Hyper-V, how to install it, how you get it going, that's the easy part.
How to install using nested virtualization on a virtual machine that's not so easy.
I'm going to show you how to do just that and more coming up now.
Hello everybody , my name is Adam Gordon
Edutainer here at ITProTV, coming at you with another fun and exciting conversation
about how you can optimize your Windows server experience.
Remember, you can check out our YouTube channel and subscribe for this,
as well as all of our conversations around this topic.
And if you want more in-depth information about Microsoft
or any of the areas
that we focus on,at ITProTV, well, just come check us out directly
and we'll go as in-depth as you want to go,
and we'll spend as much time with you as we need to.
We're going to be talking about how to install Hyper-V, but hold on.
It's not quite the conversation you're thinking
we're going to have installing Hyper-V.
Not that hard.
Most people can do that with no trouble
installing Hyper-V inside of a virtual Windows server
that's going to become your host to host virtual machines,
but it's already virtualized itself now that that might be something cool,
and that is what we call nested virtualization and installing Hyper-V
inside of an on a virtual server 2022 VM to then use it to create
virtual machines is actually a lot easier than you may think it is.
But you got to know the tricks and you got to know how to get the job done.
Let's take a look at what I'm talking about.
We're going to start on Windows eleven.
Believe it or not, you may be saying Windows 11
is supposed to be about installing Hyper-V on Server Adam.
Well, you're right, but I run Server 2022 as a virtual machine on top of my Windows 11
environment, and I've got that VM set up,
but we're going to show how to install and configure Hyper-V there.
But we got to start using Windows 11 or Windows 10 or wherever you're creating
and running your virtual machines
to create the capability for the nested virtualization.
Now this is specific to windows and specific to how Microsoft supports
virtualization.
If you're running virtualization on VVMware ESXi
I or you're running it on Oracle or anywhere else,
there is an equivalent path to use nested virtualization.
But it will vary.
And you're going to have to figure out from the vendor documentation
how to do the initial steps.
And I'm going to show you here
now I'm using Windows 11
in order to be able to enable virtualization
specifically nested virtualization support.
I've got to use PowerShell.
I've got a fire off to PowerShell command.
Let's to turn on and enable certain functionality
in the installation of Hyper-V in Windows eleven
that will then allow me to support virtualization in the nested environment,
using Hyper-V and using the Server 22 virtual machine to install
a secondary instance of Hyper-V there.
So let me show you what those PowerShell command would look like.
Let me quickly explain to you
why they're important, and then we'll go ahead
and we'll actually get into the installation of Hyper-V.
Now I'm in PowerShell, I'm using one of the more
recent versions of PowerShell version seven 1.3, I believe,
and I've already typed in and executed the two command lets that I need.
I broken the mat into notepad. I'll show them to you separately.
You can easily see what they are going to point them out here.
Z set VM processor is the command that we use.
first, I'll explain what that does in a minute.
Once that is successful,
we then use the Get
VM Network Adapter Command that we target
the name of the virtual machine in question.
I'll show you where to find that.
And then we pipe that to a second command that set VM network adapter,
and we use a specific parameter in this case, Mac address spoofing,
and we provide a value that turns that on.
Let's go ahead, and let's take a look at exactly what those command.
Let's do got them here.
So they're all a bit easier to work with and see the set VM processor command.
That allows me to specify that the VM processor is going to be set
and turned on to enable
and expose virtualization extensions to support nested virtualization,
but only for the targeted virtual machine that I want to work with.
So in other words, this command lit is instance specific,
and we must use a parameter parameter is called VM name
and that parameter, we highlight that there we go.
VM name simply tells the set VM processor command that hey, turn on
and expose these virtualization extensions,
but only for the following virtual machine.
Now, this would normally be a variable
we would have to
parentheses are brackets open with nothing there, and we would insert
whatever the name of the virtual machine is we want to target.
In this case, my virtual machine is called Win SVR 2022.
I know that because I can go to Hyper-V on my Windows 11 system
as I'm doing here
and I can see that that virtual machine has already created, it's running
and I have it up and running is simply grab
the name of that VM and I inserted into my PowerShell commandment.
Now this VM is a VM of configuration type version 10.2 the newest version.
Realization capabilities that are supported in Hyper-V,
and so I have what I need with this virtual machine
sort of got an operating system installed and configured.
It looks just like this because this is what we're going to use.
Do our demo in just a minute.
So it's up and running. Everything is good, but there's a little gotcha here.
I have to run these two PowerShell command.
That's while the virtual machine is turned off or this will not work.
So I've done that ahead of time.
You want to make sure you run them with the virtual machine turned off.
And then once you're done, enable the virtual machine.
Turn it on and we'll be good to go.
So we're using the name VM name parameter and then we're using the expose
virtualization extensions parameter and a PowerShell dollar sign true
value statement, which says Yes, enable
the exposed virtualization extensions capability.
Dollar sign false would be turn that off.
So the first command that enables these capabilities on a
targeted individual virtual machine, the next command to get VM network adapter,
get the current virtual machine
adapter for the VM name parameter and the value that we provide.
In this case, the same value for the virtual machine named up above
get means go grab the existing configuration and PowerShell
and make it available so I can make choices or work with it.
So this initial part of the command syntax right here gets the virtual machine
network adapter configuration
for the virtual machine named Windows Server 2020 to loads it in a memory.
And then we use something very powerful and PowerShell called the pipe
and the pipe allows me to take whatever is on the left
and the output of that
and move it to the right of the pipe and use it as the input
for whatever command that comes next.
In other words, I'm taking everything I do right here loading in in memory.
And then I'm giving it to the set network VM Network Adapter Command that to use.
So I'm giving it the current configuration
and I'm saying, Hey, I want you to modify that current configuration
by using the set VM network adapter command.
Let Mac address spoofing is the parameter I want you to, in this case,
turn on Mac address spoofing.
It's turned off by default, and by doing so,
I'm going to allow something very important for virtual machines.
Once I install Hyper-V,
I'm going to be able to allow them to bind to the network switch
that is created in the host and have a secondary capability
to move traffic through the host network switch,
as well as through the virtual machine
in its network adapter so we can connect to the outside world
and can actually act as a normal machine would.
So this second command that allows the virtual machine
to work and to operate in that nested environment
and to behave as if it is normal and sitting racked
and stacked in our data center and it doesn't know the difference.
So with these two command, let's together remember virtual
machine must be turned off as you execute these mallets.
Everything is set and the stage is ready for us to now
actually go and enable Hyper-V, and we're going to go ahead and do that right now.
We're going to go into our virtual machine. Let me just bring that up.
It's there we go, and we're going to go ahead, load our server manager up.
It's already up and running. If you're not familiar with how to get there.
We can go to the start menu.
We can go to our navigation area
right here at the upper left hand corner, as you can see up under Windows Server.
The tile for server manager is going to be pinned there.
You can load that up if you need to.
And what we're going to do is install or add a feature, a role for Hyper-V.
It's not currently installed on the system, so it's easy to do.
Go to our manage area right over here.
We're going to load up
or grab that opportunity to load up a roll or a feature from our shortcut menu.
And when we do that, we'll get our little wizard here
and just bring this down and put this nice and centered for us.
We can skip over the before you begin screen.
Really nothing of value that we need to know they are.
Just some guidance from Microsoft can read through that at any point.
We're then going to select our installation type.
In this case, we're going to go with the default of roll based
or feature based installation,
allowing us to add and configure roll services, features, et cetera.
Hyper-V is going to be a roll feature, excuse me, a roll service,
and we'll install it from there.
I also have the option to enable remote desktop services and configured
if I choose to,
enabling remote access to the system in the provisioning
of resources for remote users up to me. We'll accept our default.
We then are asked to select our destination server.
The default is to select from the list down below in
what's called the server pool.
Local machine is listed and highlighted,
so I'll be able to operate on the server in this case.
The Server 2022 virtual machine I'm running,
I have more than one server listed
reserve to pay attention to make sure I know which server or servers
I want to operate on and then choose the appropriate machine.
And I have an option there to select a virtual hard disk and configure that.
If I choose to, I can select that there's
some additional steps I'd have to go through to work with it.
And I do need to provide a path
to where that virtual Hargis, that ADHD or V.X hard drive will be found.
And I have to be aware of that.
Allowing me to reconfigure these settings in the video or video file
means when I attach and use that hard drive.
It'll come up already installed and ready to go.
So it's a nice capability, but we're going to stick with
configuring the local machine we're working on in real time
when I highlight that and click next. I then can select my server role.
Now Hyper-V is going to be a server role. The list is alphabetical.
It's going to be approximately halfway down the list.
And as we zoom in, we could see it right there
between the host guardian service and the network controller.
We're going to select that
we get our pop up around adding features that are required for Hyper-V,
a remote server, admin tools role administration tool.
Hyper-V management tool sets are provided.
We have to add those in to complete the installation.
Microsoft's doing this to make sure we get the right resources.
We have no issues,
no missed dependencies and or issues that would lead to Hyper-V not working.
This is all good. We're going to click Add features.
That selection has already been made
on the following screen where features will be available.
Hyper-V is there now.
We have to wait a second. We might see that bar.
Let's just go in across the top here for a minute with a little red x.
Nothing wrong, by the way, we didn't do anything wrong.
As a matter of fact, everything is just perfect.
But what was happening
is that the system was checking the prerequisite configuration,
making sure we meet the requirements to install Hyper-V in this case.
Since this is a virtual machine, have we enabled nested virtualization
while we got a big checkmark next to that one?
Because we've just done that through PowerShell?
Or at least you can do that now because you know how to.
And as a result, that pre configuration check comes back and allows me to
now get some additional menu options that I'm going to have to move through
to configure Hyper-V setting up virtual switches, migration for live migration.
And as you can see, default stores
and then confirmation and ultimately installations.
Let's take a look at what happens from here.
We'll click next and you'll see we have our feature area.
We don't have to make any selections, as you remember,
we were just told, Hey, install these features,
we said, Yes, Microsoft done all that for us .
When we come down here, we can see evidence of that
under remote server administration tools.
We open that up under roll service administration tools
and you'll see under the Hyper-V
management tools area that they're already selected.
For us, Microsoft did all that.
All we need to do is simply keep going if we don't know where they are or we do.
It doesn't matter. Sort of configured for us. We'll click next.
We get a little overview screen explaining what Hyper-V is, things to be aware of.
We're good with all that. You could certainly read that on your own.
Then we have to choose
how we're going to enable and bind our network adapter or adapters
to the virtual switches that will be created.
So we're going to go ahead and click that to enable that binding,
and then we'll go ahead and click next. We then.
Have to deal with how migration will take place
so that live migrations can be supported if we choose to use them in the Hyper-V
configuration, that's up to us.
And you'll see that we then have to choose how we're going to use
authentication, specifically what authentication protocol will be used.
Are we using what's called CredSSP or credential security support provider?
That is the default, by the way.
And or are we going to go ahead and use Kerberos?
Kerberos is more secure
and requires a little bit of additional configuration,
so it's up to us to decide we can select between either of those.
It's up to us depending on what supported and how we want to do this.
You'll notice when I check off, allow this server to send or receive
live migrations that enables the use of live migration,
then I can change that selection if I choose not to do this.
We're not enabling the feature right now can always go back and turn it on later
after I configure it totally up to me
and then I don't have to worry about the selection that I make there
because it's not going to be used until we start to support live migration.
So we'll leave that off. For right now, we're not going to worry about that.
We'll click next.
We have our default locations for both our virtual hard drive files
as well as our virtual machine configuration files.
You can accept the defaults or modify them totally up to you.
Browse at the lower rather, at the far right hand corner
allows you to make a change. If you choose to, we're then going to click next.
We get our confirmation of what's about to happen.
We can restart if necessary, automatically.
We get our prompt to be able to do that.
And so we just want to hit yes, there
and then can go ahead and we can click install.
Now I'm
going to actually not restart automatically on this one just to show you
what's going on, but you'll see we can go through the install here
once we are done.
Remember, installs
may take a little bit of time, maybe 30 seconds, several minutes,
depending on the nature of the services, the roles, the features were installing,
how complicated they may be,
and if there's a whole bunch of supporting and dependencies
supporting characters and dependencies we have to deal with.
It may take several minutes, so you're going to have to be patient with.
It usually will jump to the three quarter,
maybe halfway to three quarter mark fairly quickly.
And then from there, hopefully very fairly soon finish up its configuration.
Once this is done,
we can actually then go in and open up the Hyper-V manager
and it will look exactly like it did in Windows eleven,
except it's now running on my virtual machine in Server 2022.
Now you'll see here feature installation complete, but a restart is pending.
I know this particular installation requires a restart in order to finalize,
but we're running a virtual machine.
We don't want to restart the VM, have it pop out of the window
and have to wait for it to come back up in order simply to log back in to see this.
But I'm just showing you that that is the case. We're going to click close.
We're going to go ahead and minimize this.
What we're going to do
is the following I'm going to restart the VM just to show you
that it will come up and be ready to go,
but it's going to take a couple of minutes .
So what we're going to do is start that process.
We're going to speed that up using what we call YouTube magic.
You're not going to see it all happen.
You're just going to see us come back and it's going to be ready to go.
But keep your seatbelts fastened, keep your arms inside the ride at all times.
And remember, in the real world when you do this,
it'll take just a couple of minutes for the restart to take place.
All right, so we're back, everybody. Poof, YouTube magic. Everything is good.
All you missed was about two or minutes at the restart.
Remember, you'll see some configuration going on.
The system is adding those features for Hyper-V and configuring the roll.
And as a result, it's going to do a couple of things.
You'll get back to log on, prompt to log in,
get your server manager back up and running.
We spared you all of that.
And now you can see
we've got a Hyper-V shortcut in our navigation bar right there,
indicating the Hyper-V role has been installed.
If we click, we'll see that it looks like everything seems to be good.
We can right click right here
and we can actually choose to load the Hyper-V manager
right from here, or we can go up to the tools menu.
The upper right hand corner do the same thing.
Let's just open that up just so you can see that.
Indeed, we did really install Hyper-V,
and sure enough, we have our Hyper-V manager
running on our server as a virtual machine using nested virtualization.
And if we wanted to, we could right click, create a brand new virtual machine
or anything else we want to do with Hyper-V is available to us.
All right, here.
Just like it would be in my case, running on Windows eleven,
where I created the Hyper-V virtual machine that we're working with,
and we use nested virtualization
to make this additional installation and configuration of Hyper-V possible.
So there you have it the ability to install Hyper-V
with a twist using nested virtualization.
Not necessarily the traditional way you would do this.
Probably not the way you would do this going into production.
But guess what?
Certainly important if you want to be able to use Hyper-V
if you're going to be studying for exams.
Do you want to practise..
Is those hands on skills or whatever it is
you're looking to do now, you know how to get the job done?
I'm going to go get ready
for more fun and exciting opportunities in conversations
to show you how to optimize your Windows server experience.
But until I come back with another one, I'm going to wish you happy servering
And I'll see you soon.