Hello and welcome to this demo. In this demo we're going to discuss how to set up a lab environment. 1
A local lab environment on our laptop. 2
So this time I'm going to use Oracle virtual box to set up a local lab with a virtual machine and 3
Ubuntu virtual machine installed. 4
It doesn't really necessarily have to be Oracle virtual box. You could use any virtualization technology 5
that you're comfortable with. 6
If you have other ideas in setting up your lab environment, maybe in your private cloud Net environment 7
or on a public cloud set up, that is fine. 8
You don't have to do this. But this is for those who do not have access to such environments and 9
really want to set up a lab using virtual machines on their local machines or laptops. 10
In this demo, we're going to look at how to install virtual box on your laptop and how to deploy 11
an Ubuntu software on it. 12
OK. 13
So we are at the download page for VirtualBox. 14
If you go to www.virtualbox.org, you will get to this page and this is the Web site for downloading 15
Oracle virtual box. As you can see, Oracle VirtualBox is supported on Windows, Linux, Macintosh and Solaris 16
hosts. 17
If you go to the downloads section, you will be able to see the various options for downloading and installing 18
Oracle VirtualBox. I'm going to choose the windows option and I'm going to click it. When I click 19
it gives me the option to download the executable, which is the installer. I'm going to save it in one 20
of the local folders. 21
It's about 100 MB. Once it's downloaded, 22
I'm going to run the executable and it runs through the setup wizard. In the setup wizard, 23
I'm going to click next and then click next to select the location. We're going to set the default values 24
for the options. 25
And finally read this warning about network interfaces it's going to reset the network connection which 26
is fine and then I'm going to click install and it goes through the installation process and is finally 27
finished installing. 28
Once I click on finish, it brings up the Oracle VirtualBox manager user interface and this is the interface 29
that we will be using to set up new machines. 30
If you click on new, 31
You'll actually get to see the options available for deploying a new virtual machine. 32
So to deploy a new virtual machine, we need an image. 33
So we do not have an operating system with us right now or we donot have a disk and so we can actually 34
download a readily available operating system image from the Internet. 35
And if you go to the website osboxes.org, you can actually find various images available for 36
various operating systems. 37
And so this site gives you readily available images for Oracle virtualbox or VMware based virtualization 38
platforms. 39
So if you go to VM images at the top and select virtualbox images, it will take you to this page where 40
it lists all the various flavors of operating systems available as you can see there are many. 41
And for our purposes I'm going to go with Ubuntu. 42
So click on Ubuntu and click on Virtualbox VDI image that will take you to the download page for Ubuntu. 43
Under this page, 44
Scroll down to various versions of Ubuntu operating system. 45
And I'm going to go with 16. 46
Version 16.04 47
And as you can see it has various options for virtualbox and VMware, virtualbox being the default. 48
And that's what I have so I'm going to go with that and I'm going to go with the 64 bit version. So click 49
on download and it actually downloads a .7z file. 50
So remember that this is a compressed file. 51
.7z and it takes about 1GB of disk space. So be aware of that. 52
And if you look at it, it's a .7z file. 53
So it's a zip file. So you need to extract it to use it. 54
So I' gonna use the 7zip extractor and I'm going to extract the image. 55
And now I have the image extracted into a folder by the name Ubuntu. 56
And under that I have a folder 64 bit under which I have the actual image. 57
Image File which is with the extension .VDI 58
Now I could go back to my Oracle virtualbox manager user interface and deploy a new machine. 59
I'm going to click on new to create a new virtual machine and it brings up this user interface. 60
And this is where you have to specify the name for your new virtual machine. 61
I'm going to specify Ubuntu and as you can see it automatically sets the type to Linux and the version to 62
Ubuntu 64 bit. 63
Now if you look at the version, you see that it automatically selected the 64 bit which is 64
what I wanted. 65
But there's also a 32 bit. 66
And as you can see for each operating system flavors you see a 32 bit as well as a 64 bit option. 67
Now in some cases you may not see the 64 bit option and that is because you most probably don't have 68
the virtualization support on your system enabled. 69
So most of the laptops have the vistualization support disabled by default and you have to actually 70
explicitly enable it. So in my previous courses, a lot of students have reached out to me saying that 71
they don't see the 64 bit option and that is really because you do not have the virtualization technology 72
enabled on your laptop. 73
So in order to do that, you actually need to go to the BIOS and enable it from there. 74
So for most laptops, It's actually a BIOS setting and if you do not know how to do that you could simply 75
search in Google. Search enabling virtualization technology and it'll come up with a lot of options. 76
Put the model of your laptop and you might see the one specific to your laptop. 77
In most of the cases, it's in the BIOS and it's an advanced featuring bios where you see the virtualization 78
technology. 79
And that's where you go in and enable it. 80
So this is another. 81
So these are some examples of how the virtualization technology option looks in the in the BIOS. 82
And once you do that, when you come back and look at your screen, you should be able to see the 64 bit 83
option available. 84
So I'm going to select the 64 bit Ubuntu version and go ahead and if you look at the memory size, 85
I'm going to set a 2 GB of memory and then I'm going to go ahead and select the hard disk. 86
So for this, you need to click the Use an existing hard disk because we're not actually going to start 87
with a blank hard disk. 88
We actually have the image downloaded. 89
So that's going to be our hard disk whatever we downloaded and extracted. 90
That's going to be our hard disk. 91
So click on browse and browse the file that you just downloaded and extracted with the extension 92
.VDI and it has to be a 64 bit version. 93
So make sure you select that and then click on OK. 94
Now it is deployed the Ubuntu image or the Ubuntu virtual machine and before powering it up, as you 95
can see it's currently powered off and before powering it up, 96
I would like to go into the settings page and set a few things, so specifically around network. So 97
I'd like to enable, go to the network page and set the network type to bridged. By default 98
it is NAT and I want to change that and set it to Bridged adapter and the adapter that is going to 99
bridge to is my Wi-Fi router, 100
My wifi adapter. So I'm going to bridge the network interface on the Ubuntu virtual machine to the 101
network, the wireless network adaptor on my laptop. 102
Before powering it up, I'm just going to take a snapshot. 103
This is something I do. 104
I just take a snapshot whenever I can just so in case I had to come back, I could do that. 105
I just took a snapshot named Before initial set up and I'm just now going to start my virtual machine. 106
So my virtual machine is now powered up. 107
I'm going to log in using the user osboxes.org and the password is also osboxes.org 108
all lowercase. 109
That's actually the name of the site where we downloaded the image from. 110
And once we are in, I'm going to open up a terminal and the first thing that I would like to 111
do is identify the IP address of the VM. 112
So if I run the ifconfig command I can see that the IP address is 192.168.1.84 113
. 114
That's the IP that was assigned to the virtual machine by my wireless router because I bridged the 115
network connection from the VM to my wireless router. 116
I'm now going to try an SSH into it. 117
So I'm going to use a terminal. 118
The one that I'm using here is called MobaXterm. 119
It's a free software, actually kind of like it because I can do a lot of configurations on my SSH sessions 120
with this. 121
You don't really have to use it. 122
You could use any SSH terminal just like putty for example. 123
You could simply use putty to SSH into the virtual machines. 124
I'm going to use the IP address 192.168.1.84. Before going into them, I'm just going 125
to look at my IP address. So my laptop has an IP 192.168.1.70 on the same network. 126
So my laptop and the virtual machine are on the same network which is created by my wifi my router and 127
so I should be able to rely SSH into it. 128
So I'm going to try to do that right now. 129
I'm going to put in the IP of the host and then the user name is osboxes. 130
And when I click on OK and as you can see it doesn't really connect. 131
It says connection refused. So if I go back to my Ubuntu VM and see the SSH service because this is most likely 132
an issue with the SSH service as I'm going to try and see if the SSH service is enable and if it's running, 133
we run the 134
service sshd status command and as you can see it doesn't really see, it say there is no such file or directory. 135
So the SSH service is not set up, I'm going to do that right now so I'm going to run the apt get update 136
command to update my internal repositories followed by the command to install SSH service on my 137
Ubuntu VM. 138
So I'm going to run the apt-get install open SSH server. Open SSH server is a package that 139
installs SSH service on my Ubuntu VM. 140
And as you can see it's finished successfully and if I now run the service SSH status command, I 141
can see that it's active and in a running state. 142
So that is good. 143
I can now go back and try to restart my session. I'm going to press the R key to restart the session. 144
And as you can see I'm at a log in prompt now. 145
I'm gonna type in the password which is osboxes.org 146
And there you go. 147
I'm logged into my Ubuntu VM from my laptop using an SSH. 148
That's it for this demo. 149
We'll see you in the next demo.