Microsoft Azure AZ-800 — Section 11: Manage Hyper-V and guest virtual machines
81. Installing Hyper-V on a server and using nested virtualization
It’s now time for us to learn about installing Hyper-V on a Windows server now in my little lab environment. I’ve actually got a client machine that is running Hyper-V, which you can have Windows 10. You could have Windows 11 that you’ve installed Hyper-V on. Keep in mind, I don’t provide any support for VirtualBox or any of that you. If you want to use VirtualBox to set some of this initial stuff up and you’ve done that in the lab, that’s fine. But I can’t really provide a whole lot of instruction on that because we’re here to learn Hyper-V. This Microsoft’s product and this what they want us to learn here. Ultimately, though, I’ve got a couple of servers that I’ve set up in my practice. Lab NYC DC one NYC server one.
OK? And right now, if you go into one of the virtual machines, if you right click one of the virtual machines and you go to connect, that’s going to bring you in the server. And then at that point, what we ultimately would like to do is install Hyper-V on our server so that we can host virtual machines and learn Hyper-V for the server side of things. Right now, though, if I go into a virtual machine. And I go to this my this my server, if I go to manage, I go to admirals and features and I go Next, next, next. You’re going to notice that I have Hyper-V right here, and I’m just going to try to install that and I’m going to get an error. All right, So, it’s going to attempt to install it, and there you go. You can see that we now get an error when we try to install Hyper-V on this virtual machine.
Now the reason for this because I am trying to do what’s called virtual machine nesting. Nesting is where you have Hyper-V running on a host computer and then you try to install Hyper-V onto one of your guest operating systems. And So, it’s obviously not going to let me do that now. I can do that, but I’m going to have to run a special command that’s going to let me do it. All right. This called nesting virtualization.
OK, so to do that, if I jump back over to Hyper-V here, I’m just going to I need to shut down the servers that I’m going to do this on. Right? So, I’m just going to connect back in. I’m going to shut the server down so much, so shut down. All right, I’m going to wait on that server to shut down. And then at that point, we’re going to run a little command against the server. We want to remember the name of the server, the name of the virtual machine, which as you can see, this what I’ve named it.
So, it shut down, and the next thing I’m going to do is I’m going to open up PowerShell and I’m going to run the following command. This a command. You’re also going to want to try to remember. It’s very important. You got to also make sure the virtual machine is shut down before you can run this command or you will get an error.
So here’s the command set -VM processor, -and VM name and then the name of the virtual machine. All right, and then -exposed virtualization extensions, true dollar sign, true, that’s going to activate that’s we’re going to go ahead and hit Enter. And no news is good news. If we don’t get an error, that means that it worked successfully.
So now we’re ready to start this virtual machine backups. We’re going to go ahead and right click it and start it and then I’ll pull the video. While that’s restarting now with the server restarted and I’m connected into the virtual machine, I’m going to open up server manager. And go to manage admirals and features, go to the roles page and click Hyper-V, and hopefully we won’t get an error this time. And we did not get an error, so that means that the nested virtualisation feature did get enable like it was supposed to.
So, we’re going to now click next. Next, next. This all right. Do you want to implement a virtual switch for your network adapter? I’m going to go ahead and say, Yes, we’re going to do that. Next, it says, are we going to allow for what is known as live migrations, which I’m not really getting into right now, but I can say I would like to allow what is called live migrations on here.
OK, then it says, Where do you want the default location for your virtual machines and all that to be stored? As you can see, these are the default, but I’m going to click Browse and I’ll expand this out and go to my C drive and is going to create a folder on my C drive that I’m going to call. I’m going to call the DS. And for my virtual machine configuration files, I’m going to create a different folder on my C drive and I’m just going to call it the MS. All right.
So make a new folder VMS just a little easier to get to these two folders in demonstrations, for example.
So, I’m going to click next and then I’m going to click to install it. If it needs to restart, it can click install and it’s going to officially install on a McGloin Impulse video while that’s happening. All right now, after a few minutes, the installation rebooted and this popped back up and the installation is complete, so, I should be able to now hit close. Go to the tools menu here on Server Manager and you’ll see I have Hyper-V manager and I should be able to load that up and have all the available features that server is going to offer for usage in Hyper-V.
OK, so right over here is my server in one C server one. Obviously, I don’t have any virtual machines installed on this server yet because my original host, which was a client machine, is what had the virtual machines. This actually server, which is what the server Hyper-V, which is what we’re trying to learn here.
So as you can see, I can click to create new virtual machines, virtual hard drives, even floppy disks. All that stuff is available, and a Hyper-V is officially set up on N.Y.C. server one. By the way, while I was waiting on this to get installed on Server one, I went ahead and did all the same process on DC one.
So my DC one machine now has Hyper-V on it as well, and I should be able to go to ols and then open up Hyper-V Manager. And so, we have the exact same setup over on NYC DC one.
So, I now have Hyper-V installed on both of my servers in one CDK1, as well as NYC Server one and Hyper-V is officially set up. We’ve got nested virtualization configured and everything is ready to go.
82. Enable VM enhanced session mode
So now I want to talk about a concept that we have in Hyper-V, known as the enhanced session mode feature. This feature has been around for quite a while in Hyper-V, and what it allows us to do is with our virtual machines, we are able to utilize local resources on our physical host machine within our virtual machine.
OK, now this something you do have to turn on before you can use it. But let me just show you what it is, and it’s pretty easy to understand when you see it.
So right now, I’m just doing this on my host computer that has my two virtual servers. I’m not doing with this within my server, I’m just doing it on my host computer.
So within Hyper-V here, all my virtual machines. But if I look over to the right here, I’ve got an option, says Hyper-V settings. And I’m going to go ahead and click on that. And then here it is right here. Enhanced session mode.
So, I’m just going to turn that on and you can see I’ve already got it turned on. But if you were doing this as well, you would just need to turn that on. And it tells you that this going to allow local devices and resources to work within your virtual machine with your physical computer.
Now that’s for the server itself. And then also down here under this user area. We want to make sure that this turned on so that it works in what’s called user mode as well. And you can see here says How do you want to configure a virtual machine connection to operate with enhanced session mode? What that basically means is when a when a user such as an administrator connects into a virtual machine or a regular user. If you’re allowing regular users to get into a virtual machine, you’re wanting to allow session mode for those users as well, not just when you’re physically sitting at the machine, but when you’re reloading into the machine. That’s what this doing.
So this already turned on for me also. And then at that point, I can click, OK, if I hit Start, I can search for VM Connect, and this how it connected to a VM.
So, I would and I want to do this as an administrator, someone right click and say, run as administrator. And then from there, I can specify the name of the machine I’m connecting it to which in this case is C.P. surface, and then I’m going to click a virtual machine and I can choose the machine I want to connect into, like NYC server one. And then from there, I can click OK to that. All right. And so as I connect in, here it is right here. This enhanced session mode.
So, it’s going to let me go ahead and adjust my resolution to whatever I want my resolution to be.
OK. I can also click show options and I can click on local resources and I can have audio play so, I could have sound play either through the physical machine or through the virtual machine. I can also make it where I could have a printer hooked into my physical host computer. And within that guest virtual machine, I could use that printer that’s connected to the physical machine and also clipboard mapping, which essentially means I can copy and paste between the physical machine in the virtual machine.
So these are all nifty little things you can do. You can also click more and have smart cards supported. You can have your drives linked to like C Drive Connected if you want. Other other plug and play devices that you’ve got on your machine can also be linked to it as well.
So then from there, all you got to do is in hit connect and it’s going to start connecting into that virtual machine and you would be able to utilize that virtual machine using the enhanced session.
So then I just going to log on and I’m officially using the enhanced session mode and can copy and paste and use the printer and all that ultimately enhanced session mode is a pretty simple feature. You just need to be aware of what it is. You know, for the testers, really a whole lot to know about it other than it’s going to bring local resources from your physical machine connected into your virtual machine.