Creating a Virtual Machine Using VirtualBox
Now, it's time to sit down and create a Virtual Machine. When I work, I like to put on some music on YouTube like "Young the Giant" or some lo-fi, you know... the 24/7 live streams, grab some hot coffee and dive right into it.
Feel free to do the same: play some music (don't make it too loud!), grab a drink (anything you want), turn on that dinky desk lamp your funny uncle bought you last Christmas, and let's get this done!
There are a lot of methods for creating a virtual machine (VM), but I found that the best and easiest way to create one is to use an application called "VirtualBox." There are many guides out there that make this process way harder than it needs to be, so I'll to keep it simple.
This is a pretty straight-forward guide on how to use VirtualBox for creating VMs.
If you want, you can also access the accessory rich parts of the software. I will cover a few of these features.
VirtualBox is an open-source hypervisor for computers with x86 architecture developed by Oracle Corporation. Currenly, VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts. The technology behind the program is incredible--hats off the Oracle. They make a lot of impressive tech.
Hypervisor is just a software that creates and runs VMs, and the hosts that I mentioned just means what OS your system is running. Your normal OS, not the VMs!
Some of the words I'm using are technical, but I'll explain them as I go along.
I'll create my VM on a Windows 10 host machine and run Ubuntu (guest machine) on it.
There are a few tools that need to be downloaded to properly create a VM. Here's a list, but I'll also walk you through set-up when the time comes to download these tools.
Feel free to do the same: play some music (don't make it too loud!), grab a drink (anything you want), turn on that dinky desk lamp your funny uncle bought you last Christmas, and let's get this done!
There are a lot of methods for creating a virtual machine (VM), but I found that the best and easiest way to create one is to use an application called "VirtualBox." There are many guides out there that make this process way harder than it needs to be, so I'll to keep it simple.
This is a pretty straight-forward guide on how to use VirtualBox for creating VMs.
If you want, you can also access the accessory rich parts of the software. I will cover a few of these features.
VirtualBox is an open-source hypervisor for computers with x86 architecture developed by Oracle Corporation. Currenly, VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts. The technology behind the program is incredible--hats off the Oracle. They make a lot of impressive tech.
Hypervisor is just a software that creates and runs VMs, and the hosts that I mentioned just means what OS your system is running. Your normal OS, not the VMs!
Some of the words I'm using are technical, but I'll explain them as I go along.
I'll create my VM on a Windows 10 host machine and run Ubuntu (guest machine) on it.
There are a few tools that need to be downloaded to properly create a VM. Here's a list, but I'll also walk you through set-up when the time comes to download these tools.
The VM will be created in a few steps:
- Downloading VirtualBox
- Installing VirtualBox
- Creating the VM
- The Operating System
- Initial Run
- VirtualBox Guest Additions
Step 1: Download VirtualBox from Oracle
You can download the software by clicking the big button in the center or you can click on the "downloads" button on the side bar.
After you click the button, you need to choose a platform package. Since I am using Windows 10, I will choose the "Windows" option.
Navigate to where you downloaded VirtualBox and run it. This will open up the installation wizard.
You can go through the set-up process with the default settings, but I'll explain every page in case you want to experiment later on.
You can choose next or cancel, but only one of these options will let you continue. (Spoiler: It's the next button.)
Here, you can choose where you want the VirtualBox features to go. You can stick with the default or move it to where ever you want. It can even go onto a separate hard disk. I'll stick with the default location.
Now you have to choose where the shortcuts that start the software go. You can just stick with the defaults on this one.
Make sure to read all the pages. This is not a big deal, but you can pause your downloads if you have any.
And finally, hit install. You're done with the installation!
You can choose to start the software in the wizard once it's done installing, or you can come back to it. No rush.
Now for the fun part.
Now that you have the software, you're only a few clicks away from creating your own VM!
Start VirtualBox
To create a new machine, you need to click on the "new" button on the top left.
Now, you get to choose your operating system and your VM's name. What's really awesome about this software is that if you type the name of the operating system you want to use in the "name" field, the "type" and the "version" fields are filled out automatically! If you need to adjust the settings, do so.
I'm going to create an Ubuntu machine.
Hit next after you decide.
Here is where you decide how much RAM you want to give to the machine. This depends on what you want to do on your machine. If your task is really intensive, give it more RAM. I am going to give it 2 Gigs* of RAM; I would normally give more, but I am at school and don't have access to my desktop 😢.
*Remember: 1024 MB == 1 Gig
Once you decide how much you need, hit next.
It's time to create a virtual hard disk. You can use one that already exists, but I'm assuming that you don't have one since you're already this far into the post.
Choose "create a disk" and hit "next."
Now you need to choose what type of hard disk you want:
Step 2: Installing VirtualBox
Navigate to where you downloaded VirtualBox and run it. This will open up the installation wizard.
You can go through the set-up process with the default settings, but I'll explain every page in case you want to experiment later on.
You can choose next or cancel, but only one of these options will let you continue. (Spoiler: It's the next button.)
Here, you can choose where you want the VirtualBox features to go. You can stick with the default or move it to where ever you want. It can even go onto a separate hard disk. I'll stick with the default location.
Now you have to choose where the shortcuts that start the software go. You can just stick with the defaults on this one.
Make sure to read all the pages. This is not a big deal, but you can pause your downloads if you have any.
And finally, hit install. You're done with the installation!
You can choose to start the software in the wizard once it's done installing, or you can come back to it. No rush.
Now for the fun part.
Step 3: Creating a Virtual Machine
Now that you have the software, you're only a few clicks away from creating your own VM!
Start VirtualBox
To create a new machine, you need to click on the "new" button on the top left.
Now, you get to choose your operating system and your VM's name. What's really awesome about this software is that if you type the name of the operating system you want to use in the "name" field, the "type" and the "version" fields are filled out automatically! If you need to adjust the settings, do so.
I'm going to create an Ubuntu machine.
Hit next after you decide.
Here is where you decide how much RAM you want to give to the machine. This depends on what you want to do on your machine. If your task is really intensive, give it more RAM. I am going to give it 2 Gigs* of RAM; I would normally give more, but I am at school and don't have access to my desktop 😢.
*Remember: 1024 MB == 1 Gig
No matter how much memory you give the machine, it will only take up to the limit you set. Once you start your machine, it won't take all the memory you allocated. It will only take as needed.
Once you decide how much you need, hit next.
It's time to create a virtual hard disk. You can use one that already exists, but I'm assuming that you don't have one since you're already this far into the post.
Choose "create a disk" and hit "next."
Now you need to choose what type of hard disk you want:
- VDI
- Native format (I pretty much only use this.)
- VDH
- Native format for Microsoft Virtual PC
- VMDK
- Developed for VMWare, however, it is supported by VritalBox and others
- Increases compatibility with other VM software
All three types use dynamic sizing. That means if you want to give your VM 100 gigabytes of storage, it won't take all it at once. Rather, the machine will take from the memory reservoir as needed, depending on the size of the files being created or downloaded.
And all three types allows you take a snapshot of your machine. It's like making a backup of your machine. You can mess up your machine after you take a snapshot, and then restore it to the snapshot.
Here, you can choose "dynamic" or "fixed." "Dynamic" takes storage up to your limit when it needs it, but you don't get the space back if you free up space on the VM (you will get everything back when you delete to VM). "Fixed" takes up all the space you give it immediately.
I will choose "dynamic" size.
Choose the size and location of your hard disk. I will give my VM 50 gigs of storage,
which is a bit overkill. And I'll leave it in the default location.
Yay! You created your first Virtual Machine.
Step 4: The Operating System
Now it's time to install the operating system onto your VM.
First, you need to download the operating system. Download the ISO file for the OS you want to install. For Ubuntu, the ISO file is located here.
Click the "download" button.
It's a pretty big file, so you can go ahead and refill your cup of coffee. Depending on your wi-fi, you can catch a movie or that next episode of "The Office" that's been itching in the back of your mind.
After your ISO is done downloading, go back to VirtualBox.
Click on your machine and select settings.
Click on the storage tab on the left. You will now mount your ISO file onto the VM. It's like putting a disk into a computer but virtually.
To load the disk you downloaded, click on the "Empty" disk under "Controlled: IDE" or click on the CD with the plus sign next to "Controlled: IDE." That button creates a new space to load in to instead of the default one that's already listed.
To find your ISO file, click on the CD button next to "Optical Drive." Find your ISO file and click "ok."
You're done loading your OS!
Now it's time to run your machine.
Step 5: Initial Run
Select your machine and hit "run."
Give it a second. It's like a baby taking its first steps. It needs a bit of time. Hopefully not too long, though. Some babies need a little push.
To make the machine full screen, click the right "CTRL" (host key) and "f" at the same time.
Choose your language and hit "install."
Choose your keyboard layout. You can choose to detect keyboard layout, if you want. Click "continue."
Do the normal installation. You can also install third party apps here. Click "continue."
Choose the first* option. You can encrypt and choose other options, if you want, but it's unnecessary if you're just learning.
*This will not erase the information on your physical computer. It will do all this the virtual hard disk you created.
Hit "install."
Hit "OK" on the partitions. You don't need to worry about that now.
Choose your time zone.
Create your account. There are other accounts that are already created. Such as the "root" user. Root has access and total power over everything on your machine. The account that you create does not have total power. There are privileges for accounts (which I will address in other posts).
Now let the system install.
Restart the machine after it's done installing.
Yay! You have now created a VM with Ubuntu on top of your current OS.
Step 6: Guest Additions
You might notice that the screen is a little weird and some capability is restricted. To fix this, we need to install VirtualBox guest additions. Guest additions allow for better video, mouse integration, folder sharing, and more.
First you need to login to your system after it restarts.
After you log in, you need to give the user you created root access. This will allow you to install guest additions using this account. You should be wary of giving power permissions to users. Linux is built this way for security and safety.
To open the terminal, right-click and choose "Open Terminal."
Type the command "sudo adduser USERNAME sudo" Replace "USERNAME" with your user name. This will give your user root access, if you don't have it already. I will talk more about commands on other posts.
After you run the command, click on the "devices" tab, (either at the top when you're not on full screen or bottom when you are) and choose "Insert Guest Additions CD Image"
Click "run" after it asks you to install.
Enter your password, if prompted.
Restart the system. You do this by clicking on the top right and choosing the power option. Here, you can restart or shutdown.
And finally, you're done.
Now you can log on normally and use the system however you want.
To shut the machine off, you click on the power button and choose "shutdown." To restart the machine, you need to open VirtualBox, select your machine, and hit run.
You will certainly hit problems, especially if this is your first time using Ubuntu. But I will address these problems in small posts as they arise.
I will be using this machine to work on projects, and we will learn commands and tools as we go along.
Congratulations!
If you found this blog helpful, sharing it would be great.
If you don't want to use the Ubuntu GUI, you can ssh into the machine. I'll talk about how to do this in my next post. Don't worry, it's easy.
After that, and maybe some other helper posts, i'll talk about how to create a model with tenosrflow (that means artificial intelligence!).
I need more coffee.






































Comments
Post a Comment