OS Lab1
OS Lab1
Jinnah University,
Karachi
Fall 2022
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
• VMware
• Oracle VM Virtual Box Microsoft Hyper-V
• etc
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:
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
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
The pkill and killall commands can kill a process, given its name. Use either command to kill
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.