 Hey everybody, this is Brian and this is a viewer requested video, how to set up a virtual machine for recording video tutorials. Now I use a virtual box. If you don't know what virtualization is, it's putting a computer inside of your computer. It's actually like running an entire computer as a software application, much like you would like Chrome or Microsoft Word or you know, Outlook, whatever. Basically it is that simple. You're running an entire operating system inside of your machine. There are other virtual hypervisors out there and when you hear the word hypervisor, really it's just software that runs the operating systems. For example, Proxmox and VMware. They can get quite pricey though, especially if you get into VMware. Proxmox is free, virtual box does exactly what I need it to do. I don't need like a whole network or anything like that. I just need to run one virtual machine and I need to be able to share a clipboard between my main computer and the virtual machine itself. Before we dive in, you should have a definite reason for doing this. And for me, it's very simple. I do development tutorials and I specialize in some technologies, for example, Qt and some of those settings wouldn't really mesh well with my desktop computer and I don't want to start playing around with my desktop and potentially breaking it. Now I had an old virtual machine, but the new version of the software I work with came out and it requires a newer version of Linux. So I've completely deleted my old virtual machine and we're going to start from scratch. I'm going to do this step by step. The very first step is of course you need to download things. So at a minimum, you should download three things, virtual box. So just go to virtualbox.org, click the download button, run the executable and follow the directions on the screen. It's going to be slightly different for every single operating system. So for example, on my Linux machine, I have a dev file which I can just run this package, but off Windows it would be an EXE Mac, of course it would be a DMG and you just run it for your operating system. I'm not going to cover the individual steps because it is ridiculously simple and it just walks you right through it. Anybody can do this. Also you're going to want OBS Studio. I'm going to assume if you're watching this video, you already know how to use OBS Studio and I'm using OBS Studio to record this video. Again we're not going to do a step by step exhaustive, elaborative tutorial on OBS, but just a couple little gotchas and tweaks that you need to know to record a virtual box. And lastly you're going to need, well, the operating system that you want to run as a virtual machine. This is going to be an ISO file and I've already got this downloaded. You can see I've got Linux Mint, Cinnamon, 64-bit.ISO. Key takeaway here is it should be an ISO file. Once you have those three things, basically go ahead and fire up virtual box and you need to be able to get to this screen right here where it says welcome to virtual box. Now we need to configure the host and for Windows and Mac you can probably safely skip this step, but just in case you have a problem pay attention, Linux you're definitely going to need to do this step. And what we're talking about is configuring your group memberships so you can use the shared clipboard feature. Now what is a shared clipboard? So we have a host which is your current machine and I've got this text editor on the host. We have a guest which we have not yet created that we want to copy and paste into. This is extremely cool. It's called a shared clipboard. So you can copy and paste from the host to the guest and from the guest to the host and back and forth. It makes it very cool. So what I typically do is I have this text editor off the edge of the screen on another monitor or just off to the side. I'm actually only recording a small segment of a very large monitor. I'll talk about that a little bit later in OBS Studio. But in order for any of this to work you have to have the guest additions installed which we'll cover in the next segment. But also for Linux you need to be a part of the VBox users group. So go to users and groups, select your name, click on groups and scroll all the way down to the bottom and make sure you are in the VBox users group, hit OK and then go ahead and reboot your machine or log in, log out for that to take full effect. If you don't do that, if you skip that step, you're going to try things and then nothing will work as far as shared clipboard. It's extremely frustrating and their documentation is a little lacking. Again, Windows and Mac, you may find this just works without any configuration but Linux, that's a step you're going to want to take. Let's go ahead and configure our guest operating system. To start off you need to actually click New or go to Machine New. It doesn't matter which way you get there as long as you get this screen. Now this is the operating system we're going to create. You notice how it says Windows and this might be a little confusing if you're on Windows, but yes, you can install Windows and Windows. You can install Linux, whatever you want. So the first thing you need is the type. I'm going to be installing Linux Mint, so I'm going to go down to Linux and I want a bone to 64 because under the hood, Linux Mint is actually a bone to 90 to give it a name. Once you have the name, the operating system and the specific version it next and you're given this very confusing screen. If you don't understand computers, this just looks nuts. You don't know what you're supposed to do here. It says the recommended memory size is 1024. That is absolute rubbish. You want way more than that. So what is memory? Well, it determines basically how fast your computer is going to go in very, very simplistic terms. Memory is where programs run along with your CPU. The bigger this number, the faster it's going to go. So you're automatically inclined to just max it out. Don't do that. See how it turns red right here? This is the amount of physical RAM you have in your box and your number is going to be different. I have 32 gigs in this box. You don't want to do that much because you have things like, well, virtual box and Chrome and calculators and notepads and things like that running that also use RAM. So you want to find a nice balance between what you need versus what you have. So how do you know what you need? Well, consult the documentation of the operating system you're installing. Linux can run with next to nothing. That's why it's saying the recommended is 1024. If I did like Windows or something like that, it'd be a different number. If you want a custom number, simply take whatever number, multiply it by 1024 and you get that number. For example, eight gigs would be 8192. 20 would be 20480. I'm going to go with eight gigs, which is 8192. So I'm just going to type it in. And that gives me plenty of room to grow. The great thing about memory in virtual environments is you can always adjust this number later. So I'm going to hit next. We want to create a virtual hard disk. If you're not a computer savvy person, a hard disk is where it gets installed too. This is going to be a giant file out on your hardware. Says the recommended size of the hard disk is 10 gig. Now notice that is very low. 10 gigs is basically for the operating system and a few minor applications. Let's go ahead and create a disk and you're given this confusing screen. I'm going to leave it as VDI or virtual box disk image. If you plan on migrating to like a VMware or Proxmox or something else, you might need a different format, consult their documentation, but I'm only going to use virtual box. So I'm going to leave it as a VDI. And then of course, another confusing screen, dynamic versus fixed. This takes a little bit of explaining, but basically you are going to make a file and put the operating system in that file. You need to tell this how you want that file to be created. If you do fixed and you said you wanted a 10 or a 20 gig file, it's going to make that file immediately that size. That's why it's called fixed. It'll take longer to create it, but it's faster once you actually get it up and going. I'm going to do dynamically allocated. So what this means is it will create a file of zero bytes, meaning nothing in it. And then as I add things into it, the file will grow. It's a little bit slower, but it saves me some disk space. For example, if I say I want a 20 gig disk, it will allow this to grow up to 20 gigs and not further. Now you can adjust this later on. However, not every operating system is going to allow you to readjust the hard disk. Again, consult the documentation of your operating system. I know I say that a lot, but every operating system is slightly different. So I've got it dynamic, just in case, double check dynamic. Now how much space do you need? 10 gigs is recommended for my specific setup. I'm actually going to bump that up to, let's just do 25 gigs. Notice how you can put this into the terabytes, which is massive, you don't really need that. I'm going to be installing a lot of development tools, so I need that little extra space, but 25 gigs should be enough. Again, I can always attach more storage to it later. And let's go ahead and hit create. Ta-da, your virtual box is powered off, but it is ready to rock and roll. The next step is to install the guest operating system. So let's go ahead and right click this, go to settings. And these are the settings for your virtual machine. I'm not going to step through all of these, they're pretty simple, but just some main takeaways here. If you use disk encryption, it's going to slow this down drastically. And for your system, I wouldn't really tweak around with any of this too much. These are those magical steps that virtual box takes when you select your operating system and your version, it figures out what you need automatically. Display, you might be inclined to try to video capture the display, but I've not had much luck with this. It actually slows it way, way down. So I'll use an external video capture, for example, OBS studio. Storage, this is the primary step we need to look at here. Notice this little DVD icon is empty. If we try to start this virtual machine without some sort of bootable media, it's just going to basically say operating system not found and it'll do absolutely nothing. So we want to go and select an ISO file. I've already done it, but I'm going to go ahead and hit choose and select the ISO you downloaded. For me, it's Linux Mint 20 Cinnamon 64 bit. For you, it may be something totally different, but you want that ISO file you downloaded in the very first section. Hit open, and it's going to give you the location and you can just hit okay. Once you get to this point, you notice how it's powered off. We need to actually start this. And it's going to pop open the window and it's going to start that virtual machine. And this is where everything's going to be totally different depending on what you're doing. For me, I get the Linux Mint installer, you're going to see like maybe a Microsoft logo or whatever you're doing here. And it's going to just start the installation process. You get this menu across the top and this is not the guest operating system. This is the hypervisor itself. So for example, we've got our disk in there and we have different inputs. We have different views, things like that. This is actually incredibly cool. One note though, if you do full screen, you might get a little confused about what you're actually doing. So I try to avoid full screen and you have your different machine settings and you can hard power this thing off. So be a little bit careful. If you click into the virtual machine, you may actually capture the mouse. You might get like a popup saying you've captured the mouse and then you'll lose your mouse cursor. If that's the case, hold down the right control and home and it'll pop up a menu and then you can move the mouse around freely. Notice how I have two mice. This one that I'm moving is the host, this one is the guest, but when you click in, magically they become one and that's why it gets a little confusing. If you find you go to move the mouse off the screen and you don't get it back on the host, then you got to do that little control home trick that I showed you and then it works. All right, you'll get some annoying popups. You can go ahead and close these out. This is going to be different for everyone. I'm installing Linux Mint, so this is what I see. You may see like the Microsoft installation wizard or whatever you're working on. I'm going to install Linux Mint. Feel free to continue watching this section or jump ahead. Just going to double click the install icon because I'm running as a live desk here. I'm going to choose English because that's my native language and English again. I'm going to install the multimedia codecs. This part's a little bit scary, erase disk. You may panic and go, I don't want to erase my hard drive. It's not actually your hard drive. It's the virtual disk. So we're going to hit install. It's going to tell you where you're going to do it. Just hit continue. Select the appropriate time zone. I'm in Detroit and let's go ahead and give it a name. It's going to name it appropriately. You can change the name of everything you want. I've always in the past tried to make this look like my desktop, but it's confused people. So I'm just going to leave it as virtual box. And let's go ahead and give it a password. This is where I would caution you. Do not use the same password you use for your host system because if you're recording and you enter your password, everybody in the entire universe now knows your password. Oh, that is frustrating. So I'm going to just make a password. And this is where you got to be a little bit careful and make sure they match. Once you have a good strong password and they match, go ahead and select require my password to log in. Remember what your password is or you're going to have to pretty much reinstall your whole OS. And the rest of it is coffee time. You just sit back and watch progress bar. Okay, so just about every operating system has one thing in common. When you're done, they're going to want you to restart. Before we do that, there's a couple of key things. If yours is telling you to remove the installation media, you're going to want to go to devices, optical devices and remove. If I try to do that, it's going to tell me, hey, unable to eject because Linux is going to want to do that for me automatically. So just know if it's saying remove the media, go to devices, optical and then remove. Also, you notice how this is very, very small. It's got this small kind of screen. I want to go to view and I want to go to virtual screen one and I want to put this, well, at the size I want. And I tend to record at 1280 by 720. So I'm going to go ahead and resize that. Now it takes up most of the space. However, it's got this annoying menu bar up here. So we're going to go ahead and we're going to get rid of that. So I'm going to say menu bar and uncheck show. Now it takes the entire recording area. If you ever want that menu bar back, you can simply right control and home and it pops open this menu, you go to view and then go back to menu bar and show menu bar. So I'm going to go ahead and hide that again. And I'm going to go ahead and restart. All right, once you have got your operating system installed, you should have a beautiful virtual machine staring back at you, but we're not done yet. We need to install the guest add-ons. So go ahead and log in using the password you used during the setup process. If you forgot your password, I'm sorry, you probably need to now reinstall this. So make sure you wrote that password down. Now every operating system is going to be a little bit different. So just kind of ignore a bunch of these pop-ups that just pop up randomly. All right, once we've gotten to this point, this is a full operating system. And this is actually really, really cool that you can use this technology. Now, if you skip the last section, you notice that there's no menu bar and you're probably going, where did that go? So it is on your keyboard, the right control button and home at the same time pops open to this menu. You can go to view and menu bar and show menu, but you can access all of those same things through this little context menu that pops up. It just may be a little cumbersome to navigate through. So for example, you may be sitting here trying to find your devices, but you're looking for this insert guest addition CD image. And I'm going to actually show it on the menu. All right, let's go to devices and it's down at the bottom, insert guest addition CD image. The first time you click this, it may pop up and say, it's not found, it'll want you to download it. Just hit yes and it'll download and do everything for you. For example, could not find, what do you want to do? Let's go ahead and download it, download again. And then we're going to go ahead and click insert. And what this does is takes that ISO file, it just downloaded and inserts it into the operating system and your operating system should automatically detect it. For example, mine says this is intended to be automatically started, would you like to run it? Some operating systems may just run it for you. I'm going to click run and you'll need whatever password you put in. And this is going to be different for every operating system, but basically you want to follow the installation process. Now I think Windows and Mac, it pops up a nice beautiful graphic interface where you can just click next, next, next. Linux of course, you've got to do it off the command line, which is really not a big deal. The major takeaway here is you want to get it to the point where it's installed. And you'll know when you're done, because it'll tell you. I'm just going to let this run in the background. If you're on a different operating system, feel free to jump to the next section. Okay, as promised, once it's done, you'll know it tells you right on the screen, we are done. Most other operating systems, if you have a graphical prompt is just going to say you're complete and you can just close it out. I'm going to do that. And then you need to unmount this desk. Now, some operating systems, you can go to devices, optical, and then remove, I'm on Linux. So I'm just going to right click and we're going to go ahead and eject this. Okay, the final step in the configuration of the guest here is we're going to go to devices and shared clipboard. Notice this is disabled. Basically what we're doing is we want to be able to share the clipboard between your virtual machine and your computer. So for example, I have some notes off the screen. I will read these notes and once in a while, I want to copy and paste something into the VM or from the VM back into my notes. So we're going to go to devices, shared clipboard, and you can do from your computer to the virtual machine or from the virtual machine to your computer. I like doing bi-directional. And then we're just going to open up a text editor and test this out. So I'm going to say guest and I'm going to copy and I'm going to bring my text editor here and we're going to paste. And then just to show you that we're not playing around, I'm going to copy the host, go in here and boom, we have bi-directional copy and paste. This is extremely cool if you have notes off the screen. So for example, if I were doing a full tutorial, I could just grab something off the screen and say, ta-da. And to the end user, it just looks like magic, but really all we're doing is bi-directional copy and pasting. Spoiler alert, if you haven't rebooted your machine after installing the guest add-ons, you're going to want to do that or it just won't work. And again, Linux users, I did put a note in there, you're going to be a part of that virtual box group or this simply won't work. The guest add-ons are mandatory for this to work. So if you skip that step, it also won't work. It's kind of like a three-legged table, you need all three of those steps in there. And finally to wrap this up, here's some last minute recording tips. So I am not recording the entire screen. It may look like it as I'm recording, but I'm not. I'm only recording a chunk of it. This is just a window inside of my screen. I'm going to put this at the top left. So it's all the way up in the top left corner of my computer and then we're going to configure the menus, the status bar and OBS. So the first thing's first, view menu is your best friend, go to status bar, you can hide that, go to menu bar, go ahead and hide that. You probably didn't see the status bar disappear because it's off the edge of where I'm recording. And now I have this nice seamless window because it's in top left, I don't see it. Now you are probably picking up this top bar here right here where it says running Oracle VM virtual box. How do you get rid of that? Highly dependent on your recording software, I'm going to assume you are using OBS Studio. So I've got a scene set up in OBS Studio called 1280 by 720 screen, which is recording my computer screen and picking up my Yeti microphone. Here you can see I'm actually talking in real time as I'm recording this. So right click on your computer screen, go to properties and instead of doing the whole screen you're going to crop this. This is a little bit of trial and error and what I did is I screenshot my entire screen imported into an imaging editing program and figured out 1280 by 720, how much of my screen was left over. So for example, let's say it looks something like this. I would take this edge here and I would determine how much of the screen was left over and I would take this top and determine how big that was. When I say this top, I mean this guy right here. Measuring that that was about 30 pixels. So when I crop top and I move this up to the top it disappears out of the recording area. Now cropping right and cropping bottom, it was about 640 pixels to the edge and then about 330 to the bottom. Now I get this nice seamless recording. You cannot even tell that this is not even my main desktop. I hope you enjoyed this video. You can find the source code out on github.com. If you need additional help, myself and thousands of other developers are hanging out in the Voidromes Facebook group. This is a large group with lots of developers and we talk about everything technology related, not just the technology that you just watched. And if you want official training, I do develop courses out on udemy.com. This is official classroom style training. If you go out there and the course you're looking for is just simply not there, drop me a note. I'm either working on it or I will actually develop it. I will put a link down below for all three of those. And as always, help me help you. Smash that like and subscribe button. The more popular these videos become, the more I'll create and publish out on YouTube. Thank you for watching.