From the course: Career Essentials in System Administration by Microsoft and LinkedIn

Windows Hyper-V

- [Instructor] sysadmins should be very familiar with virtual machines such as Hyper-V. I'm on a Windows 10 client computer, and a great training exercise would be to install Hyper-V. I can click on Control Panel. I can also go into System and then click on Programs and Features, and here I can click on Turn Windows features on or off, and I'll choose Hyper-V. You can see there are multiple different options within Hyper-V. There's the management tools as well as the Hyper-V platform. I suggest you check all of them and click OK, so you have all the different tools at your disposal. Once that's installed, you'll want to restart, and you also want to make sure that virtualization is turned on in your UEFI or BIOS. The computer is restarted, and I can type in hyper-V in the search, and we'll see the Hyper-V Manager app. Once it's launched, we can go ahead and create a new virtual machine. You see the Hyper-V Manager has been expanded, and the name of our computer's there. We can choose Quick Create or we can choose New, Virtual Machine. Let's start with New, Virtual Machine, and we get a wizard that comes up, and I'll click Next. We now need to name our virtual machine, and if you want to store the virtual machine in a different location, other than the default that you see here, then you can go ahead and browse to that location and go ahead and choose it. I'm going to click Next. Next, you have the option for generation one or two. Generally, if it's a 32-bit, you're going to want to go generation one, and that would be Windows Server 2008 and older 32-bit as well as any clients. Otherwise, it's suggested that you go with generation two because you get a lot more features such as Secure Boot, then you want to pick how much startup memory you want to have. If you use dynamic memory for the machine, what that does is instead of using all the memory that can be used for the virtual machine, it will use the minimum amount and then expand as needed. It's not a bad idea to do it, but it will run a little more slowly if you choose this option. We want to check, by going into Task Manager, how much RAM you have. So I'll click on Performance, and we can see, on this computer, it has only eight gigabytes. So you probably don't want to use too much if we're already at 30%. So I'll suggest that we use no more than around three gigabytes, and now you want to use a connection. If you haven't created a virtual switch yet, you'll want to do that before you create your virtual machine. In this case, a default switch was automatically created. So I did not have to do anything with Windows 10 or 11. However, on Windows Server, you will need to manually go in and create that virtual switch first, but since this is more of a demonstration for training for a sysadmin, we can go ahead and use Windows 10 or 11, where it's automatically created. Next we want to take a look at the size. The default size is 127 gigabytes. So once again, we're going to go down to our taskbar, click on File Explorer, and then click on This PC and see how much space we have. In this case, I don't have a lot of space left. So I'm going to go ahead and choose 40 gigabytes, but you can choose whatever size you want. I don't suggest going less than 40 gigabytes, or you may have an issue after Windows updates are done, and we can choose to install an operating system now or later. If we choose to install it now, we are going to want to have an ISO file ready to be booted from. So you're going to want to browse and locate that ISO file. If you don't have one, you'll need to download one or install one from another location. Another option would be to use an operating system from a network-based installation server if you have one of those as well. I'm going to choose to install an operating system later and click Next, and then once you choose Finish, we can see our virtual machine is ready to go. However, we don't have an operating system. So it's not going to get very far. Let's take a look over on the right-hand side at some of the different settings, such as Hyper-V Settings. So if I click on that, here's where we can see the default folder to store the virtual hard disk files, and I can change that at this time if I'd like. I can also go into where it says Virtual Machines. Virtual machines is different from virtual hard disk. Virtual machines are the files that you're going to need to run your virtual machine. Whereas the virtual hard disks are the actual hard disks that are used to boot from. We have some other options here under User where it says Keyboard, Mouse Release Key, Session Mode, et cetera. I'm going to cancel this and then go into the Virtual Switch Manager. Here we have a few different options. We have External, Internal and Private. External is going to allow us to create a virtual network interface that will connect, not only to the local area network, but also will allow us to connect out to the internet, then we have the Internal option, and this gives us communication between the host as well as the virtual machines, and then the Private option allows the virtual machines to communicate with each other, and that's it. The default switch that was automatically created is using an external network interface card that we have on the computer, and it's going to be an external switch. So we can communicate with everyone, basically the internet as well as the local computers. If I click on Extensions, there are some additional extensions that we can choose that are a little bit for the more advanced crowd. So I'm going to skip that, but if we click on MAC Address Range, we can see we can take the physical network address that it's assigning our virtual machine, and we can change that if we'd like here. If I wanted to create a new virtual network switch, I could create a new switch by clicking there and choosing External, Internal or Private. If I only have one network card, I can use the card that's on the machine, and I can share that with the other services that are running on the machine itself, such as the host being able to go out to the internet. If you have multiple network cards, that is better because you can divide up the load. Now what I'm going to do is I'm going to right-click and choose Quick Create instead, and here we're given a lot of different types of virtual machines we can create. We've got several different Ubuntu packages, an MSIX Packaging Tool Environment, which explains here on the right-hand side, and then we have this Windows 11 development environment. I'll go ahead and click Create Virtual Machine from there, and we can see it's downloading all the files it needs from Microsoft in order to install this Windows 11 computer. Depending on the speed of your internet and your computer, this could take anywhere from a few minutes to possibly several hours, and once it's done, it will be able to allow us to create that virtual machine. The new Windows 11 virtual machine has completed. If I right-click on it and choose Settings, there's lots of different things that we can set, such as we can see Secure Boot is enabled. You can disable that if you'd like. There's the amount of memory. We can add additional memory or change from the enabled dynamic memory. We can add or remove processors from the virtual machine if we'd like. Another thing I like to check is the automatic start action. So when the computer restarts, what do we want to do with the virtual machine? Do we want it to just stay turned off? Do we want it to automatically start if it was running when the service stopped? And this can help if things restart, say, in the middle of the night, or do we want to always start the virtual machine automatically? It's totally up to you which one you'd like to do. Now what I want to do is I want to connect to it by double-clicking on the virtual machine, and then clicking Start. Now we see the virtual machine is starting. We can now use the virtual machine to test applications and other features of the operating system. Using Hyper-V and a Windows client is a great way to get started training for a career as a sysadmin.

Contents