Learn Programming in C – Lesson 0 – Compilers and Installing Ubuntu on VirtualBox

Learn Programming in C – Lesson 0 – Compilers and Installing Ubuntu on VirtualBox

Welcome to Learning Programming in C. This
is lesson 0. I call this lesson 0 because it doesn’t actually cover any actual programming
yet. However, it does cover how to setup yourself so that you can program. If you already have
a setup where you can write C Code, then you can ignore this video. Otherwise, if you’re
completely new you may want to watch this video. The title of this video probably does
not make much sense right now, but as we go along it should. C is a programming language. It’s a language
that is written by humans so that we can communicate actions to a computer. It’s a language that
is understandable by humans. Directly, through, a programming language is not understood by
a computer. What is understood is something called “Machine Code” and so, we take our
language and convert that into machine code that the computer can understand. So we write our C code and we use something
called a compiler to turn our C Code into machine code. In order to write programs in
C you will need a compiler. Now, they’re are many different types of compilers and many
compilers for C. You may use any compiler you wish as long as it’s a C compiler and
it works with the examples we have. But if you’re new to this and don’t have a compiler,
what we’re going to use for these videos is GCC on Ubuntu. And I’m going to how to install
Ubuntu and GCC. So that way, you can use it for the rest of the videos to learn C. What is Ubuntu? Ubuntu is an Operating System
just like Microsoft Windows and Mac OS X. It allows you to completely run a new system.
And, it’s completely free – which is why we are using it. All the software we are using
is free. So, you can learn without actually spending any money as long as you have a computer. You can directly install Ubuntu on your system,
but because it can be complicated and cause issues, we are actually going to install it
on a Virtual Machine. A virtual machine lets you run a a complete Operating System within
a window on your computer. So, you don’t have to restart into it, and you can just open
an application and you will have access to Ubuntu. It’s easy for us to install and for
you to use GCC on Ubuntu. Then, you’ll be able to use GCC to compile C code and write
software and programs. As I said, ubuntu is completely free and you can download ubuntu
fromubuntu.com. Just go toubuntu.com
and click “Get Ubuntu now”. Once you click that, they’re are 3 different options. You
just want the “Ubuntu Desktop” – it’s the simplest. The option for “32-bit” is the the
simplest to get, so just ignore that – leave it at “32-bit” and click “Start Download”. This will then start downloading Ubuntu on
your system. It comes in a disc image which you don’t really need to know what it is,
but it will allow us to install ubuntu on Virtual Box. Virtual Box is also free and it lets you run
Ubuntu within a window. You can get it fromVirtualBox.org.
Once your atvirtualbox.orgchoose the “Downloads” section on the left.
Now this page may look a bit complex at the beginning, but under “VirtualBox platform
packages”, this is where you choose which version of VirtualBox you need. It’s based
off of the system you are currently running. So, if you’re running windows right now, then
you choose this first one and you click this. I am using a Mac, and so I use the “OS X hosts”.
The host is the system you are running right now. So, again if you are running Windows,
click this. But I am running Mac, so I’m going to choose the second one. Once both of those are downloaded and you’ve
installed VirtualBox, and you launch it, you’ll see this window. On the side, this will normally
be empty but as you can see I’ve already installed VirtualBox. To create a new one, you just
simply click the “new” on the toolbar. It brings us to this Wizard which we can step
through. First we name it, I’m just going to call it “Ubuntu”. You may call it whatever
you want. And it automatically decides that it is Ubuntu. But, if it doesn’t, you have
to choose “Linux” and then “Ubuntu”. After clicking “Continue”, it will automatically
create a recommended size for memory. You can normally just leave this. It will ask
you for a start up disk, it’s much easier if you just create a new one. Then, just click
continue. That’s fine. “Dynamically Allocated” is fine. Most of the options here unless you
know otherwise that you want to change it, you can leave it the same. Now that I’ve created it, we have this blank
Virtual Machine that we can use – we click start. And because it’s the first time – it
automatically knows that it is the first run, so it will help us install the system. It
asks us where we want to get our CD drive from, and by default it says it’s trying to
grab the CD from the actual CD Drive on this computer. But we want to use the CD Drive
image, that we have downloaded from the Ubuntu website. So we click this icon to choose a file. And,
you choose the disc image that you downloaded. Now you can imagine that this a computer and
it is running this CD. Once the VirtualBox gets this [screen], you need to choose “Install
Ubuntu”. If you wish, you can choose “Download updates while installing”. And this will update
your Ubuntu as it is installing. Because the disc is completely empty already, you can
just leave it as is and click continue, and then “Install”. It will install Ubuntu on
the disk. While it’s installing it will ask you to choose
your timezone. Usually “US English”, if you have an alternative keyboard, you may choose
that. Put in your user information, and if you want choose your password. Because this
is on my machine, i’m just going to say “Log in automatically”. Now that’s all the options
it asked for, so now we just wait for it to install. Once you see this installation complete dialog,
click the restart now button. Once you see that it says “please remove any installation
media”, it should automatically eject the drive. Which, it has done right now, because
when I right click on this “CD Icon”, you can see that nothing is mounted. If I click
within the window, and click enter, it will then restart the computer. There is one last step we have to do before
we are completely done. To make Ubuntu run perfectly within the virtual environment,
we need to install the “Guest Addition Tools”. Which will allow it to run a lot more smoothly
within the VirtualBox. To do this, all you have to do is click devices and click “Install
Guest Additions”. Once you do this, this dialog will appear and you have to click the “Run”
button. It will then ask you for your password. This is the password that you entered when
you first installed ubuntu. Once you click “Authenticate”, it will fully install these
tools. Once it says “Press Return to close this window…”, all you have to do is press
the enter key. Once you’ve done that, restart Ubuntu one more time, by choose the gear ->Shut
Down, and click “Restart”. Now, that we’ve fully restart and installed the Guest Additions
we have a good environment to start learning programming. This is the environment that
all the rest of the videos will be using, and we will have a good environment that everyone
can use. We can equally learn C programming together.

14 thoughts to “Learn Programming in C – Lesson 0 – Compilers and Installing Ubuntu on VirtualBox”

  1. I tried downloading ubuntu from unbuntu.com and it came as a file named wubi and does not show up on VM's list of disks to open. What do I do?

  2. If you install it within VirtualBox, it will run side-by-side. If you decide to run it actually on your computer, you can either replace Windows, or, which I'd recommend is Dual-boot your computer so that when you launch your computer you may choose to boot into either Windows or Ubuntu.

  3. I'm getting an alert that says my system is running in low graphics mode, and that my screen, graphics card, and input device could not be detected…?

  4. Or Try this:
    When the message that "your system is running in low-graphics mode" appears press Ctrl+Alt+F1 to enter the termina. Then login with your credentials, and then run the following commands:

    sudo apt-get install fglrx
    sudo reboot

  5. When you say directly installing Ubuntu on a computer is complicated and can cause issues is that in the context of installing it side by side with windows or a clean install? I've never had issues installing directly or dual booting? It's much easier now than 8 years ago (which even then just took a little reading.) I do agree however, that installing it virtually is probably the best way to acquaint oneself with it before jumping headlong into it. I am enjoying the lessons..!

  6. When it says " Erase disk and install ubuntu?". What does it mean exactly? What disk is it referring to? Please do tell. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *