1 00:00:01,540 --> 00:00:05,920 In this demonstration, we're going to do a general introduction to Hyper‑V, 2 00:00:05,920 --> 00:00:09,750 paying particular attention to 2 of the AZ‑800 objectives, 3 00:00:09,750 --> 00:00:12,800 enhanced session mode and nested virtualization. 4 00:00:12,800 --> 00:00:14,670 We're looking at one of my local machines, 5 00:00:14,670 --> 00:00:17,860 but this just as well could be a machine in Azure, 6 00:00:17,860 --> 00:00:21,740 an Azure VM that's enabled for nested virtualization. 7 00:00:21,740 --> 00:00:25,530 Okay, so in that sense from a hybrid administrator perspective, 8 00:00:25,530 --> 00:00:26,380 we're good to go. 9 00:00:26,380 --> 00:00:27,940 Let me bring out VS Code. 10 00:00:27,940 --> 00:00:32,400 This Configure‑hyperv.ps1 script file is in the exercise 11 00:00:32,400 --> 00:00:34,460 files for your reference if you want it. 12 00:00:34,460 --> 00:00:38,580 So, on the Hyper‑V host, my so‑called hardware host, 13 00:00:38,580 --> 00:00:41,870 I'll want to make sure to install the Hyper‑V feature first. 14 00:00:41,870 --> 00:00:46,890 Let me and my VS Code console do a Get‑Windows‑Feature hyperv. Whoops, 15 00:00:46,890 --> 00:00:50,220 I always tend to forget about that hyphen. Yeah, 16 00:00:50,220 --> 00:00:54,050 so I've already installed the server role on this machine, but you can see up 17 00:00:54,050 --> 00:00:59,220 here on line 5 Install‑WindowsFeature Hyper‑V IncludeManagementTools Restart, 18 00:00:59,220 --> 00:01:03,500 and you've got yourself a Hyper‑V host. Because I used the 19 00:01:03,500 --> 00:01:07,600 IncludeManagementTools switch parameter, that means that after the reboot, I 20 00:01:07,600 --> 00:01:11,050 have access to the Hyper‑V Manager MMC console. 21 00:01:11,050 --> 00:01:14,500 And so next we'll go through the process of setting up our 22 00:01:14,500 --> 00:01:17,010 network and creating a new virtual machine. 23 00:01:17,010 --> 00:01:21,880 We can right‑click our host and go to Virtual Switch Manager, and we can 24 00:01:21,880 --> 00:01:26,980 create a new external switch that I will call External Switch. 25 00:01:26,980 --> 00:01:31,420 I'm creating an external switch that's bound to my machine's network 26 00:01:31,420 --> 00:01:36,340 adapter because I want my virtual machines to join the same physical 27 00:01:36,340 --> 00:01:40,300 network that my host is on and get out onto the internet. And you can 28 00:01:40,300 --> 00:01:43,200 see some connection options down below. 29 00:01:43,200 --> 00:01:48,540 We'll talk more about SR‑IOV and some other settings in future lessons. 30 00:01:48,540 --> 00:01:52,740 Let me click Yes that I'm willing to deal with some momentary 31 00:01:52,740 --> 00:01:56,480 network connectivity disruption as Azure creates this. 32 00:01:56,480 --> 00:02:00,960 Now if I open up the hardware host's network properties sheet, 33 00:02:00,960 --> 00:02:06,200 we can see that I have my hardware network interface on the host, and then 34 00:02:06,200 --> 00:02:11,920 Hyper‑V created a virtual network adapter for my external switch. And if I 35 00:02:11,920 --> 00:02:18,310 come in and look at the details, this 10.1.10 I know happens to fall in my 36 00:02:18,310 --> 00:02:21,250 network ID range on my physical network. 37 00:02:21,250 --> 00:02:26,750 So, this interface received an IP address from my network's DHCP 38 00:02:26,750 --> 00:02:30,540 server just like the host's actual network interface card did. 39 00:02:30,540 --> 00:02:33,860 So let me right‑click and do New, Virtual Machine, and we'll 40 00:02:33,860 --> 00:02:35,090 follow this wizard here. 41 00:02:35,090 --> 00:02:36,760 I'll call it server1. 42 00:02:36,760 --> 00:02:39,120 I'll store it in the default location, but we could 43 00:02:39,120 --> 00:02:42,830 override that if we wanted to. Gen 1 versus Gen 2, we're 44 00:02:42,830 --> 00:02:44,600 going to talk more about this later. 45 00:02:44,600 --> 00:02:48,630 Azure supports Gen 1 and Gen 2, but you do have to make sure that your 46 00:02:48,630 --> 00:02:53,510 virtual hard disk is using the VHD and not the VHDX extension. 47 00:02:53,510 --> 00:02:55,910 I'm going to go with Gen 1 here. Scratch that. 48 00:02:55,910 --> 00:02:57,640 I'm going to go with Gen 2. 49 00:02:57,640 --> 00:02:59,950 Here's where we have the memory allocation. 50 00:02:59,950 --> 00:03:02,570 I'm going to go with 1 GB of memory. 51 00:03:02,570 --> 00:03:08,750 I know that's really low, but I can use dynamic memory to create a range to 52 00:03:08,750 --> 00:03:12,360 better or more efficiently assign memory to the machine. 53 00:03:12,360 --> 00:03:12,490 Now, 54 00:03:12,490 --> 00:03:16,330 startup memory is what's given to the machine at startup, and then it 55 00:03:16,330 --> 00:03:20,990 will fluctuate if we've enabled dynamic memory and the needs of that 56 00:03:20,990 --> 00:03:23,430 virtual machine need more or less RAM. 57 00:03:23,430 --> 00:03:25,840 We can connect to our external switch here. 58 00:03:25,840 --> 00:03:31,100 Next, this is where we create our virtual hard disk, 127 GB is the 59 00:03:31,100 --> 00:03:35,390 default, and because this is Gen 2, it's VHDX, and it's a dynamically 60 00:03:35,390 --> 00:03:39,420 expanding rather than fixed disk. So that's going to be better to give me 61 00:03:39,420 --> 00:03:42,000 a smaller disk footprint on my machine. 62 00:03:42,000 --> 00:03:45,880 But in the future, if I want to go to Azure with this machine, 63 00:03:45,880 --> 00:03:50,440 I'm going to need to convert it to a fixed size VHD. Actually, I'll have to 64 00:03:50,440 --> 00:03:54,210 convert it to Gen 1 VHD before uploading it to Azure. 65 00:03:54,210 --> 00:03:55,150 Let's click Next. 66 00:03:55,150 --> 00:03:58,510 I'm going to install an operating system from an ISO image 67 00:03:58,510 --> 00:04:00,760 file that I have on the local file system. 68 00:04:00,760 --> 00:04:04,060 I have a Windows Server 2022 ISO. And then let's 69 00:04:04,060 --> 00:04:06,150 click Finish to create the machine. 70 00:04:06,150 --> 00:04:08,250 I'm going to right‑click and start the machine. 71 00:04:08,250 --> 00:04:12,170 I don't want Hyper‑V to take automatic checkpoints because it can 72 00:04:12,170 --> 00:04:16,440 be too easy for me to revert to an earlier state of the VM, so I'm 73 00:04:16,440 --> 00:04:18,080 temporarily going to turn them off. 74 00:04:18,080 --> 00:04:21,290 I'll right‑click the VM and go to Settings, and we'll come down to 75 00:04:21,290 --> 00:04:24,400 Checkpoints, and I'm going to turn off Checkpoints. We'll learn 76 00:04:24,400 --> 00:04:27,950 more about that later. Now, to connect to the machine using the 77 00:04:27,950 --> 00:04:31,220 VMConnect tool, we can either double left‑click or we can 78 00:04:31,220 --> 00:04:33,000 right‑click and go to Connect. 79 00:04:33,000 --> 00:04:36,170 Now, the operating system installation process here is 80 00:04:36,170 --> 00:04:38,600 identical to any other installation. 81 00:04:38,600 --> 00:04:43,430 So, I'm going to pause the video until after I've completed this installation 82 00:04:43,430 --> 00:04:46,290 because there's certainly no point in covering that here. 83 00:04:46,290 --> 00:04:52,390 Okay, I have the server1 guest VM all running here in the VMConnect utility. 84 00:04:52,390 --> 00:04:56,910 Let me close out and cover enhanced session mode and nested virtualization. 85 00:04:56,910 --> 00:05:00,590 Now you'll have to enable enhanced session mode at the server level. 86 00:05:00,590 --> 00:05:02,370 So back in Hyper‑V Manager, 87 00:05:02,370 --> 00:05:05,460 let's right‑click the server and go to Hyper‑V Settings. 88 00:05:05,460 --> 00:05:09,970 And we'll want to make sure in Enhanced Session Mode Policy we have Allow 89 00:05:09,970 --> 00:05:12,980 Enhanced Session Mode turned on, as you can see here. 90 00:05:12,980 --> 00:05:16,650 And that gives you the opportunity when you connect to a machine to 91 00:05:16,650 --> 00:05:19,820 adjust its display configuration, as you can see here. 92 00:05:19,820 --> 00:05:24,170 And we also have the local resources where we can play or not play. 93 00:05:24,170 --> 00:05:28,950 This is a lot of the stuff that you get with the typical mstsc remote 94 00:05:28,950 --> 00:05:31,570 desktop connection client, as you can see here. 95 00:05:31,570 --> 00:05:32,860 We've got local settings. 96 00:05:32,860 --> 00:05:35,050 Very similar user interface. 97 00:05:35,050 --> 00:05:36,710 All right, now if we go to More, 98 00:05:36,710 --> 00:05:41,050 that's where it allows us to map in drives, like the C drive of the host, 99 00:05:41,050 --> 00:05:44,500 for example. Okay, go back here and click Connect, and I'll 100 00:05:44,500 --> 00:05:47,780 sign into this machine, and we're off and running. Now as 101 00:05:47,780 --> 00:05:51,880 far as nested virtualization, assuming that this machine, server1, 102 00:05:51,880 --> 00:05:56,650 this VM, will become a Hyper‑V host itself, we want to make sure 103 00:05:56,650 --> 00:06:01,170 here at the host level that we've enabled nested virtualization 104 00:06:01,170 --> 00:06:03,760 and configured MAC address spoofing. 105 00:06:03,760 --> 00:06:07,000 So let me bring up my script file again to do the nested 106 00:06:07,000 --> 00:06:11,480 virtualization online, a Set‑VMProcessor for server1 to 107 00:06:11,480 --> 00:06:13,810 expose the virtualization extensions. 108 00:06:13,810 --> 00:06:15,640 Let me right‑click and run that. 109 00:06:15,640 --> 00:06:19,780 Didn't like that confirm option, so let me get rid of that and just leave 110 00:06:19,780 --> 00:06:25,080 ExposeVirtualizationExtensions true, Run Selection. It says it cannot change 111 00:06:25,080 --> 00:06:27,720 the processor functionality while it's running. 112 00:06:27,720 --> 00:06:28,200 Okay. 113 00:06:28,200 --> 00:06:30,220 All right, so let's turn this guy off. 114 00:06:30,220 --> 00:06:31,100 Not a big deal. 115 00:06:31,100 --> 00:06:32,390 Should have remembered that. 116 00:06:32,390 --> 00:06:36,990 And then let's expose those virtualization extensions. That worked. And I 117 00:06:36,990 --> 00:06:41,600 already set MAC address spoofing on for server1 by running line 11, as you 118 00:06:41,600 --> 00:06:44,310 can see. Now let's bring the server back online. 119 00:06:44,310 --> 00:06:45,300 Let's start it. 120 00:06:45,300 --> 00:06:49,230 And we're going to simply prepare ourselves for the next demo. 121 00:06:49,230 --> 00:06:53,000 Okay, that's it for now. We'll see you in the next demo.