0% found this document useful (0 votes)
59 views16 pages

Virtual Machine Setup and Linux Commands

The document provides instructions for installing and using VMware Workstation to run multiple operating systems simultaneously on a single computer. It outlines the steps to install VMware Workstation, create a new virtual machine, and install a guest operating system. It also introduces 9 common Linux commands: top, htop, ps, pstree, kill, pgrep, pkill, renice, and xkill and briefly explains what each command is used for.

Uploaded by

M Asghar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views16 pages

Virtual Machine Setup and Linux Commands

The document provides instructions for installing and using VMware Workstation to run multiple operating systems simultaneously on a single computer. It outlines the steps to install VMware Workstation, create a new virtual machine, and install a guest operating system. It also introduces 9 common Linux commands: top, htop, ps, pstree, kill, pgrep, pkill, renice, and xkill and briefly explains what each command is used for.

Uploaded by

M Asghar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Muhammad Ali

Jinnah University,
Karachi

Department Of Computer Science

Fall 2022

Operating System Lab

Instructor Sajid Ali


LAB 01 Linux Installation and Commands

Objective: After completing this lab, students should be able to understand:

How to install guest OS o Steps to


install VMware Basic Linux
commands

Guest OS/Host OS

Virtualization aficionados perhaps know Guest OS/Host OS as classic or hosted virtualization. This
type of virtualization relies on an existing operating system (the host operating system), a third-party
virtualization software solution, and creation of various guest operating systems. Each guest runs on
the host using shared resources donated to it by the host.

Guests usually consist of one or more virtual disk files and a VM definition file. VMs are centrally
managed by a host application that sees and manages each VM as a separate application.

Guest systems are fully virtualized in this scenario and have no knowledge of their virtual status.
Guests assume they are standalone systems with their own hardware. They are also not aware of
other guests on the system

Examples of Virtualization Packages are

• VMware
• Oracle VM Virtual Box Microsoft Hyper-V
• etc

Run Multiple OSs on a Single PC Using VMware


1. Secure and Isolate Environments
2. Develop and Test for Any Platform
VMware Workstation allows you to run multiple operating systems at once on the same Windows or
Linux PC. Create real Linux and Windows VMs and other desktop, server, and tablet environments,
complete with configurable virtual
networking and network condition
simulation, for use in code development,
solution architecting, application testing,
product demonstrations and
more.

Steps to Install VMware

1. Run the Setup file.

2. Welcome Screen appears.


Click Next to continue Installation

3. Accept License Agreement.


4. Choose destination for
VMware and
click Next

5. Set User Experience


Settings and Click
Next.
6. Select Shortcut Options and Click Next.
Steps To
Create a
Guest

Operating System Using Virtualization Package


Ubuntu tour and Basic commands
1. top

The top command is the traditional way to view your system’s resource usage and see the
processes that are taking up the most system resources. Top displays a list of processes, with the
ones using the most CPU at the top.

2. htop

The htop command is an improved top. It’s not installed by default on most Linux
distributions — here’s the command you’ll need to install it on Ubuntu:

sudo apt-get install htop

3. ps

The ps command lists running processes. The following command lists all processes running
on your system:

ps -A

This may be too many processes to read at one time, so you can pipe the output through
the less command to scroll through them at your own pace:

ps -A | less

Press q to exit when you’re done.

You could also pipe the output through grep to search for a specific process without using any
other commands. The following command would search for the Firefox process:

ps -A | grep firefox

4. pstree

The pstree command is another way of visualizing processes. It displays them in tree format.
So, for example, your X server and graphical environment would appear under the display
manager that spawned them.
5. kill

The kill command can kill a process, given its process ID. You can get this information from
the ps -A, top or pgrep commands.
kill PID

Technically speaking, the kill command can send any signal to a process. You can use kill -
KILL or kill -9 instead to kill a stubborn process.

6. pgrep

Given a search term, pgrep returns the process IDs that match it. For example, you could use
the following command to find Firefox’s PID:

pgrep firefox

7. pkill & killall

The pkill and killall commands can kill a process, given its name. Use either command to kill
Firefox:

pkill firefox killall firefox

8. Renice

The renice command changes the nice value of an already running process. The nice value
determines what priority the process runs with. A value of -19 is very high priority, while a value
of 19 is very low priority. A value of 0 is the default priority.

The renice command requires a process’s PID. The following command makes a process run
with very low priority:

renice 19 PID

If you’re making a process run at a higher priority, you’ll require root permissions. On Ubuntu,
use sudo for that:
sudo renice -19 #

9. xkill

The xkill command is a way of easily killing graphical programs. Run it and your cursor will
turn into an x sign. Click a program’s window to kill that program. If you don’t want to kill a
program, you can back out of xkill by right-clicking instead.

Common questions

Powered by AI

The 'ps' command lists running processes and can display detailed information about each process, which is essential for comprehensive process management . 'pstree' provides a hierarchical tree visualization of processes, making it easier to understand parent-child relationships and the structure of process execution in a system . 'pkill', on the other hand, allows users to terminate processes by name rather than by PID, simplifying process termination tasks . While 'ps' and 'pstree' focus more on process visualization and structure, 'pkill' is centered around process termination, enhancing administrative control over processes.

The 'top' command is the traditional utility for viewing a system's resource usage, showing a list of processes with the most CPU usage at the top . 'htop' is an improved version that provides a more user-friendly and interactive interface, allowing users to navigate through processes more easily and perform actions such as killing processes directly from the interface. It is not included by default on most Linux distributions, requiring installation .

The 'pkill' command simplifies managing running applications by allowing users to terminate processes based on their name instead of needing to find and use the process ID, as required by the 'kill' command. This method streamlines the process of terminating applications, making it more user-friendly and faster, particularly in environments with numerous processes running simultaneously .

Commands like 'kill', 'pgrep', and 'renice' are crucial for maintaining system stability. The 'kill' command can terminate a process using its process ID, which is essential for stopping misbehaving processes that disrupt system performance . 'pgrep' simplifies the process of identifying process IDs by providing them based on the process name, facilitating easier process management . 'renice' adjusts the priority of a running process, which can help manage CPU resources effectively by ensuring higher priority tasks receive more attention . These tools together allow for robust management and stabilization of system performance by control over process execution and priorities.

The 'xkill' command offers a streamlined approach for managing graphical programs by allowing users to kill an application simply by clicking its window. This graphical interaction is more intuitive and quicker for terminating unresponsive applications compared to traditional methods like 'kill', which require identifying the process ID . This ease of use is particularly advantageous in desktop environments where users interact directly with graphical interfaces and may not be familiar with terminal-based process management, thus enhancing user accessibility and convenience .

The 'renice' command significantly impacts process scheduling by adjusting the 'nice' value of processes, thereby influencing their CPU scheduling priority. A lower nice value increases process priority, leading to greater CPU resource allocation, which is beneficial for time-sensitive applications. Conversely, setting a higher nice value reduces priority, allowing more critical processes to receive CPU attention . By precisely controlling process priorities, 'renice' can optimize CPU utilization, balance workloads, and improve overall system performance, particularly in multi-user or multi-process environments.

Guest operating systems are integral to virtualization, running within a host system using shared resources such as CPU, memory, and disk space . These systems function as independent machines with the host system managing them as separate applications. They have no awareness of their virtual nature, assuming standalone operation. This allows for secure and isolated execution of applications across different OS environments, fostering an efficient multi-OS environment on a single hardware platform .

Secure and isolated execution of applications in a virtualized environment is crucial to safeguarding host system integrity and data security. Using VMware, virtual machines provide isolated environments that contain potential system crashes or security breaches within the virtualized layer, preventing them from affecting the host system and other virtual machines . This isolation allows for secure testing and deployment of applications without the risk of cross-system contamination or unauthorized data access, enhancing security and reliability in software development and IT operations .

Installing a virtual machine using VMware involves running the setup file, accepting the License Agreement, choosing the destination for VMware, setting user experience settings, and selecting shortcut options . These steps help in creating a controlled environment by configuring user-specific settings, managing security permissions through the License Agreement, and isolating the virtual network from the rest of the applications on the host, which ensures security and isolation .

Virtualization using VMware allows the creation of multiple isolated virtual environments within a single physical machine. This setup offers software developers and testers the flexibility to work on different operating systems and configurations without needing separate hardware, promoting efficient resource use . Virtual machines can simulate complex network environments and conditions, necessary for comprehensive testing scenarios. This isolation also prevents software bugs and crashes from affecting the host system, enhancing stability and security during development and testing .

You might also like