You are on page 1of 33

1.

Installing Ubuntu on Virtual Box or VMware raj

System Configuration of the Host Machine

In order to install Ubuntu on Virtual Box, you should have a physical computer with at
least 4 GB of RAM (Random Access Memory), a hard disk drive with at least 30 GB of free
space (SSD is preferred due to its higher performance). Your CPU (Central Processor
Unit) must support Intel VT-x or AMD-v hardware virtualization features which must also
be enabled in UEFI/BIOS. This point is especially important if you are looking for how to
install Ubuntu 64-bit on Virtual Box.

Virtual Box
Virtual Box is a free, open-source and cross-platform software that lets you create,
run, and manage virtual machines on your system. Virtual Box was originally
developed by Innotek GmbH and released in 2007. The company was later bought by
Sun Microsystems. With Oracle VM VirtualBox you can create one or more VMs on a
single physical server. Virtual machines are computers that use the hardware
components of the host computer, each running its own operating system. VB
supports the installation of MS Windows, Linux, BDS, and MS-DOS on the installed
VMs.

Install Virtual Box


Open the Virtual Box website. Go to https://www.virtualbox.org/wiki/Downloads in
your computer's Internet browser. This is the website from which you'll download the
Virtual Box setup
raj

Open the Virtual Box EXE file. Go to the location to which the EXE file downloaded
and double-click the file. Doing so will open the Virtual Box installation window.
Navigate through the installation prompts.
 Click next on the first three pages.
 Click yes when prompted.
 Click Install
 Click yes when prompted.

Click Finish when prompted. It's in the lower-right side of the window. Doing so


will close the installation window and open VirtualBox. Now that you've installed
and opened VirtualBox, you can create a virtual machine in order to run any
operating system on your PC.
raj

Downloading the Installation Image


You need to download the Ubuntu distribution for installing Ubuntu on
VirtualBox. Go to the official Ubuntu website and download the necessary
version of the Ubuntu installer. Let’s download Ubuntu 20.04.2.0 LTS – this is the
latest long term support (LTS) Ubuntu version available at this moment. Five-
year support is provided for Ubuntu LTS distributions (both Ubuntu Desktop and
Ubuntu Server). Ubuntu LTS is more widely tested, enterprise-focused and
compatible with new hardware.
Click the green Download button and save the ISO file to the custom location. In
our case, the file name is ubuntu-20.04.2.0-desktop-amd64.iso. Ubuntu 18 is
provided only as 64-bit editions.

Creating a Virtual Machine


1. Open VirtualBox. Double-click (or click once on a Mac) the VirtualBox app icon.
2. Click New. It's a blue badge in the upper-left corner of the VirtualBox window.
Doing so opens a pop-up menu.
raj

6. Enter a name for your virtual machine. Type whatever you want to name your
virtual machine (e.g., Ubuntu) into the "Name" text field that's near the top of
the pop-up menu.
7. Select Linux as the "Type" value. Click the "Type" drop-down box, then
click Linux in the resulting drop-down menu.
8. Select Ubuntu as the "Version" value. Ubuntu should be selected by default
after you set the "Type" value to Linux, but if it isn't, click the "Version" drop-
down box and click Ubuntu (64-bit) before proceeding.

4. Click Next. It's at the bottom of the menu.


5. Select an amount of RAM to use. Click and drag the slider left or right to
decrease or increase the amount of RAM that VirtualBox will have available for
your Ubuntu virtual machine.
 The ideal amount of RAM will automatically be selected when you get to this page.
 Make sure not to increase the RAM into the red section of the slider; try to keep
the slider in the green.
raj
10. Click Next. It's at the bottom of the menu.
11. Create your virtual machine's virtual hard drive. The virtual hard drive is a
section of your computer's hard drive space which will be used to store your
virtual machine's files and programs:
 Click Create
 Click Next
 Click Next
 Select an amount of space to use.
 Click Create
raj
Installing Ubuntu
1. Select your new virtual machine and click 'Settings' button.
2. Click on 'Storage' category and then 'Empty' under Controller:IDE. Click "CD/DVD"
icon on right hand side and select the ubuntu ISO file to mount.
12.
raj

3. Click Start button.
raj

5. Once the new VM is prepared for installing Ubuntu on VirtualBox, start the VM
(Machine > Start). The VM boots from the ISO Ubuntu installation image. The first
screen that you can see after booting is the Welcome screen.

4. In the left pane select Language for displaying information in the installer


interface. English is selected in the current example. Then click Install Ubuntu.
raj

6. Keyboard layout. Choose your keyboard layout. Let’s select English (US).

7. Updates and other software. There are a few options to choose from on this
screen.
Normal installation. A web browser, utilities, office applications and media players
are installed.
Minimal installation. Only the main components including a web browser and basic
utilities are installed.
Let’s select the normal installation.
8. Installation type. This screen contains options for preparing a disk for Ubuntu
installation.
Erase disk and install Ubuntu. This is the default option. All disk space will be
automatically allocated to Ubuntu. If you select Erase disk and install Ubuntu on
VirtualBox VMs, one big /dev/sda1 partition is created on /dev/sda.
This /dev/sda1 partition with ext4 file system is mounted to the / directory (root
directory), though a separate swap partition is not created. Attention: All data on
the virtual disk will be erased—there is no reason to worry about it, however,
because an empty virtual disk created previously is being used for installing
Ubuntu on VirtualBox.
9. Setting up Ubuntu
 Select a time zone.
 Enable the on-screen keyboard
 Enable the on-screen keyboard
 Enter your name, enter a username, and create a password.
 Wait for Ubuntu to finish installing.
 Restart the virtual machine.
 Log into your computer.
raj
2. Basic Linux Commands raj

1. ls
Directory listing

2. ls –al
Formatted listing with hidden filesDirectory listing

3. cd dir
Change directory to dir
raj

4. ls -lt
Sorting the Formatted listing by time modification

6. Cd
Change to home directory

5. pwd
Show current working directory
raj

7. mkdir dir
Creating a directory dir

8. cat >file
Places the standard input into the file

9. more file
Output the contents of the file
raj

10. head file


Output the first 10 lines of the file

11. tail file


Output the last 10 lines of the file
12. tail -f raj

file Output the contents of file as it grows,starting with the last


10 lines
raj

14. touch file


Create or update file

13. rm file
Deleting the file
15. rm -r dir raj

Deleting the directory

16. rm -f file
Force to remove the file

18. rm -rf dir


Force to remove the directory dir

17. cp file1 file2


Copy the contents of file1 to file2
raj
19. cp -r dir1 dir2
Copy dir1 to dir2;create dir2 if not present

25.mv file1 file2


Rename or move file1 to file2,if file2 is an existing directory

20.date
Show the current date and time

21. cal
Show this month's calender

22. uptime
Show current uptime

23.w
Display who is on line

24.whoami
Who you are logged in as
raj

26.uname -a
show kernel information
27. cat /proc/cpuinfo
cpu information
28.man command
show the manual for command
raj
3. Advance Linux Commands raj

1. ps
To display the currently working processes

2. top
Display all running process
raj

3. kill pid
Kill the process with given pid

5. File permission
chmod octal file
Change the permission of file to octal,which can be found
separately for user,group,world by adding,
• 4-read(r)
• 2-write (w)
• 1-execute(x)

4. Searching
grep pattern file
Search for pattern in file
raj

6. grep -r pattern dir


Search recursively for pattern in dir

7. grep -r pattern dir


Search recursively for pattern in dir
raj
4. Install and work with c & c++ raj

System Requirement
Operating System Pre-Requirement
Windows 10, 8.1 and 8 No Pre-Requirement
Windows 7, Vista and XP .NET 4.5 Framework Required

Install turbo c & c++


1. Download turbo c++ exe file
https://turboc.me/download-turbo-c-file/
2. Double click on exe file
3. Click next to continue
4. Accept the terms
5. Click next
6. Then select destination folder
7. Click on install
8. After install click finish
raj
5. Working with file and directories permissions raj

View Check Permissions in Linux


To start with file permissions, you have to find the current Linux permission settings.
There are two options to choose from, depending on your personal
preference: checking through the graphical interface or using the command.

Check Permissions using GUI


Finding the file (directory) permission via the graphical user interface is simple.

1. Locate the file you want to examine, right-click on the icon, and select Properties.

2. This opens a new window initially showing Basic information about the file.


Navigate to the second tab in the window, labeled Permissions.

3. There, you’ll see that the permission for each file differs according to three
categories:

Owner (the user who created the file/directory)

Group (to which the owner belongs to)

Others (all other users)


raj

Check Permissions in Command-Line with Ls Command


If you prefer using the command line, you can easily find a file’s permission settings
with the ls command, used to list information about files/directories. You can also
add the –l option to the command to see the information in the long list format.
To check the permission configuration of a file, use the command:

ls –l [file_name]

For instance, the command for the previously mentioned file would be:

ls –l raj.txt

As seen in the image above, the output provides the following information:

 file permission

 the owner (creator) of the file

 the group to which that owner belongs to

 the date of creation.

It shows the permission settings, grouped in a string of characters (-, r, w, x)


classified into four sections:

1. File type. There are three possibilities for the type. It can either be a regular file
raj

The characters r, w, and x stand for read, write, and execute.


The categories can have all three privileges, just specific ones, or none at all
(represented by  –, for denied).

Users that have reading permission can see the content of a file (or files in a
directory). However, they cannot modify it (nor add/remove files in a directory). On
the other hand, those who have writing privileges can edit (add and remove) files.
Finally, being able to execute means the user can run the file. This option is mainly
used for running scripts.

Using Chmod Command to Change File Permissions 


As all Linux users, you will at some point need to modify the permission settings of a
file/directory. The command that executes such tasks is the chmod command.

The basic syntax is:

chmod [permission] [file_name]

There are two ways to define permission:

1. using symbols (alphanumerical characters)

2. using the octal notation method

Define File Permission with Symbolic Mode


To specify permission settings using alphanumerical characters, you’ll need to define
accessibility for the user/owner (u), group (g), and others (o).

Type the initial letter for each class, followed by the equal sign (=) and the first letter
of the read (r), write (w) and/or execute (x) privileges.

To set a file, so it is public for reading, writing, and executing, the command is:

chmod u=rwx,g=rwx,o=rwx [file_name]

To set permission as in the previously mentioned test.txt to be:


• read and write for the user
• read for the members of the group
• read for other users
raj

Use the following command:

chmod u=rw,g=r,o=r raj.txt

Another way to specify permission is by using the octal/numeric format. This option is
faster, as it requires less typing, although it is not as straightforward as the previous
method.

Instead of letters, the octal format represents privileges with numbers:


 r(ead) has the value of 4
 w(rite) has the value of 2
 (e)x(ecute) has the value of 1
 no permission has the value of 0

The privileges are summed up and depicted by one number. Therefore, the
possibilities are:
 7 – for read, write, and execute permission
 6 – for read and write privileges
 5 – for read and execute privileges
 4 – for read privileges

As you have to define permission for each category (user, group, owner), the
command will include three (3) numbers (each representing the summation of
privileges).
For instance, let’s look at the test.txt file that we symbolically configured with
the chmod u=rw,g=r,o=r test.txtcommand.

The same permission settings can be defined using the octal format with the
command:

chmod 644 raj.txt


raj
raj
raj

You might also like