1 00:00:00,570 --> 00:00:03,483 Instructor: Okay, so what is a virtual machine? 2 00:00:04,410 --> 00:00:06,870 This is something that I mentioned in the previous video, 3 00:00:06,870 --> 00:00:11,043 but it is important for us to fully understand what it is. 4 00:00:12,030 --> 00:00:14,759 I can just give you a definition and say, 5 00:00:14,759 --> 00:00:17,850 a virtual machine is a machine within our physical computer 6 00:00:17,850 --> 00:00:21,030 that is using its hardware resources. 7 00:00:21,030 --> 00:00:23,130 But for most of you, this will be a new term 8 00:00:23,130 --> 00:00:25,440 that you haven't really encountered before. 9 00:00:25,440 --> 00:00:28,320 So I would like to explain it further more for you 10 00:00:28,320 --> 00:00:31,800 as well as mention why are we going to use it. 11 00:00:31,800 --> 00:00:33,780 Let me start like this. 12 00:00:33,780 --> 00:00:36,750 All of us are running an operating system, 13 00:00:36,750 --> 00:00:41,460 and 99.9% of us are running one of the three 14 00:00:41,460 --> 00:00:42,933 main operating systems. 15 00:00:43,848 --> 00:00:48,540 You either have Windows, macOS, or Linux. 16 00:00:48,540 --> 00:00:51,660 Most of you will have Windows or macOS. 17 00:00:51,660 --> 00:00:55,020 I doubt anyone will be running Linux, but nonetheless, 18 00:00:55,020 --> 00:00:56,523 these are the three main ones. 19 00:00:57,540 --> 00:01:01,920 But what if we wanted to run two different operating systems 20 00:01:01,920 --> 00:01:03,750 on the same machine? 21 00:01:03,750 --> 00:01:05,160 Can we do that? 22 00:01:05,160 --> 00:01:08,220 For example, let's say you have Windows installed 23 00:01:08,220 --> 00:01:12,510 on your physical machine, but you want to install Linux too. 24 00:01:12,510 --> 00:01:13,800 Or even better case, 25 00:01:13,800 --> 00:01:16,740 you want to install five operating systems 26 00:01:16,740 --> 00:01:19,950 running on different virtual machines. 27 00:01:19,950 --> 00:01:21,150 Can you do that? 28 00:01:21,150 --> 00:01:22,200 You can. 29 00:01:22,200 --> 00:01:23,370 How would that work? 30 00:01:23,370 --> 00:01:25,740 Well, picture it like this. 31 00:01:25,740 --> 00:01:30,060 Imagine these four lines representing our computer, 32 00:01:30,060 --> 00:01:33,240 and we already know that any computer will have 33 00:01:33,240 --> 00:01:35,553 one of the three main operating systems, 34 00:01:36,761 --> 00:01:38,850 Windows, macOS, or Linux. 35 00:01:38,850 --> 00:01:41,910 But the operating system is not the only thing 36 00:01:41,910 --> 00:01:44,220 defining our machine. 37 00:01:44,220 --> 00:01:47,850 Our machine also has its computer parts. 38 00:01:47,850 --> 00:01:52,590 We have hard disk, processor, RAM memory, motherboard, 39 00:01:52,590 --> 00:01:55,020 and many more computer parts 40 00:01:55,020 --> 00:01:59,310 that with the operating system, make our machine work. 41 00:01:59,310 --> 00:02:02,673 These computer parts are also known as hardware. 42 00:02:04,050 --> 00:02:05,910 But wait a second, Alexa. 43 00:02:05,910 --> 00:02:07,830 Why are you telling us this? 44 00:02:07,830 --> 00:02:08,940 Thought this was a lecture on 45 00:02:08,940 --> 00:02:10,770 explaining how virtual machines work, 46 00:02:10,770 --> 00:02:13,590 and not on hardware components. 47 00:02:13,590 --> 00:02:15,750 Well, hang on for just a second. 48 00:02:15,750 --> 00:02:18,030 We are slowly getting there. 49 00:02:18,030 --> 00:02:21,600 Picture a virtual machine to be this smaller rectangle 50 00:02:21,600 --> 00:02:25,860 within our physical machine, which is this larger rectangle. 51 00:02:25,860 --> 00:02:28,590 And let's imagine that our physical machine 52 00:02:28,590 --> 00:02:31,620 is running Windows operating system. 53 00:02:31,620 --> 00:02:33,930 But if you took a look at this course content, 54 00:02:33,930 --> 00:02:36,960 you would probably notice that we are going to be doing 55 00:02:36,960 --> 00:02:40,050 all of our hacking stuff over Linux. 56 00:02:40,050 --> 00:02:40,883 Does that mean 57 00:02:40,883 --> 00:02:44,160 that we must delete our Windows and install Linux? 58 00:02:44,160 --> 00:02:45,270 Nope. 59 00:02:45,270 --> 00:02:48,210 We will install Linux as a virtual machine, 60 00:02:48,210 --> 00:02:50,370 and for this machine to work, 61 00:02:50,370 --> 00:02:54,270 it'll need to have access to our hardware components. 62 00:02:54,270 --> 00:02:55,650 What does this mean? 63 00:02:55,650 --> 00:02:57,450 Well, since a virtual machine will act 64 00:02:57,450 --> 00:02:58,683 as a machine of its own, 65 00:02:59,601 --> 00:03:02,040 it must have its own computer parts. 66 00:03:02,040 --> 00:03:04,260 And what we will do is we're going to 67 00:03:04,260 --> 00:03:08,130 borrow our physical machine's CPU power, RAM memory, 68 00:03:08,130 --> 00:03:10,540 hard disk memory to our virtual machine, 69 00:03:10,540 --> 00:03:13,740 so it can run just like our physical machine. 70 00:03:13,740 --> 00:03:15,900 In other words, we're splitting the power 71 00:03:15,900 --> 00:03:19,740 of our physical machine into two different machines, 72 00:03:19,740 --> 00:03:22,170 or more if we decide that we want to create 73 00:03:22,170 --> 00:03:24,093 multiple virtual machines. 74 00:03:25,110 --> 00:03:26,850 Does that mean that they will be slower 75 00:03:26,850 --> 00:03:29,670 since they will be splitting hardware resources? 76 00:03:29,670 --> 00:03:34,290 Well, technically yes, but it will not be noticeable for us. 77 00:03:34,290 --> 00:03:36,480 However, the more powerful your PC is, 78 00:03:36,480 --> 00:03:40,410 more virtual machines it'll be able to run effectively. 79 00:03:40,410 --> 00:03:42,660 Another important thing is that once you shut 80 00:03:42,660 --> 00:03:45,750 down your virtual machine, all the hardware resources 81 00:03:45,750 --> 00:03:47,730 used by it will get freed back 82 00:03:47,730 --> 00:03:49,863 for a physical machine to use. 83 00:03:50,820 --> 00:03:51,653 Okay, good. 84 00:03:51,653 --> 00:03:53,670 But what are other benefits that we have 85 00:03:53,670 --> 00:03:55,353 if we create a virtual machine? 86 00:03:56,370 --> 00:03:57,780 Well, since we are hackers 87 00:03:57,780 --> 00:03:59,460 and we'll be doing a lot of things 88 00:03:59,460 --> 00:04:02,520 and running a lot of programs on that virtual machine, 89 00:04:02,520 --> 00:04:05,370 we want to make sure that we are doing it first 90 00:04:05,370 --> 00:04:08,760 in a safe environment, at least while we learn. 91 00:04:08,760 --> 00:04:11,220 The good thing about virtual machines is that if, 92 00:04:11,220 --> 00:04:15,570 for example, our machine starts getting some unknowing error 93 00:04:15,570 --> 00:04:18,660 or we get locked out of our files 94 00:04:18,660 --> 00:04:21,870 or simply we delete a file that we shouldn't have deleted 95 00:04:21,870 --> 00:04:24,690 and it crashes our virtual machine. 96 00:04:24,690 --> 00:04:26,253 But what if we, for example, 97 00:04:27,140 --> 00:04:29,673 get infected by a malware or virus by accident? 98 00:04:30,630 --> 00:04:33,210 Or we simply just installed the wrong version 99 00:04:33,210 --> 00:04:36,600 of operating system, which we don't need? 100 00:04:36,600 --> 00:04:37,530 Don't worry. 101 00:04:37,530 --> 00:04:40,950 With two clicks, we can delete the entire virtual machine 102 00:04:40,950 --> 00:04:42,060 with all of its files, 103 00:04:42,060 --> 00:04:45,960 and it will have no effect on our physical machine. 104 00:04:45,960 --> 00:04:48,180 Then we can proceed to create a new one 105 00:04:48,180 --> 00:04:50,610 for as many times as we want. 106 00:04:50,610 --> 00:04:52,980 We can also create something called a snapshot 107 00:04:52,980 --> 00:04:55,200 which will allow us to save the current state 108 00:04:55,200 --> 00:04:58,530 of a virtual machine and with it, we can revert it back 109 00:04:58,530 --> 00:05:01,260 to that state whenever we want. 110 00:05:01,260 --> 00:05:03,090 This could be used if we, for example, 111 00:05:03,090 --> 00:05:06,300 run into some errors with our virtual machine. 112 00:05:06,300 --> 00:05:07,413 Sounds cool, right? 113 00:05:08,280 --> 00:05:10,620 Now that we know how virtual machines work 114 00:05:10,620 --> 00:05:12,270 and why are we going to use one, 115 00:05:12,270 --> 00:05:16,710 you must be wondering, how can we create a virtual machine? 116 00:05:16,710 --> 00:05:19,050 Actually, this is pretty easy. 117 00:05:19,050 --> 00:05:21,090 All we need are two things. 118 00:05:21,090 --> 00:05:24,570 We need an operating system that we want to install 119 00:05:24,570 --> 00:05:26,280 in that virtual machine, 120 00:05:26,280 --> 00:05:30,960 and we also need something called virtualization software. 121 00:05:30,960 --> 00:05:32,730 Now, what is this? 122 00:05:32,730 --> 00:05:35,880 Even though it sounds harsh saying virtualization software, 123 00:05:35,880 --> 00:05:37,620 what it essentially is 124 00:05:37,620 --> 00:05:40,410 is a program that will allow our physical machine 125 00:05:40,410 --> 00:05:44,364 to borrow hardware components to our virtual machine. 126 00:05:44,364 --> 00:05:45,480 Or we can also define it 127 00:05:45,480 --> 00:05:48,540 as a program that will allow us to run multiple 128 00:05:48,540 --> 00:05:53,540 operating systems on a single host or a single machine. 129 00:05:53,670 --> 00:05:57,450 So with these two combined, we can create a virtual machine. 130 00:05:57,450 --> 00:05:59,010 And in the next few lectures, 131 00:05:59,010 --> 00:06:02,070 we are going to see exactly how to do that. 132 00:06:02,070 --> 00:06:02,903 See you there.