0% found this document useful (0 votes)
10 views30 pages

Lecture Number 05

The document is a lecture on Virtual Machines, focusing on virtualization systems and networking modes such as NAT, bridged, and internal networking. It also covers the installation of Ubuntu on VirtualBox and provides useful Linux commands for file and directory management. Additionally, it discusses the Xen virtualization environment and its networking concepts.

Uploaded by

fahimanwari58
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)
10 views30 pages

Lecture Number 05

The document is a lecture on Virtual Machines, focusing on virtualization systems and networking modes such as NAT, bridged, and internal networking. It also covers the installation of Ubuntu on VirtualBox and provides useful Linux commands for file and directory management. Additionally, it discusses the Xen virtualization environment and its networking concepts.

Uploaded by

fahimanwari58
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
You are on page 1/ 30

Islamic Republic of Afghanistan

Ministry of Higher Education


Herat University
Computer Science Faculty
Communication and Operating System

Lecture title: Virtual Machines: 05


Teacher: Mohammad Arif Qarizada
Virtualization System and
Technology

10/1/2022 1
Outline
• Intro
• Networking modes
• Not attached
• Network Address Translation (NAT)
• Bridged networking
• Internal networking
• Host-only networking
• Generic networking
• Networking concept in Xen

Ah. Khalid Nasrat 2


Networking concept

• The VMM documentation indicates that “A logical network is used to organize and simplify
network assignments for hosts, virtual machines and services.

• As part of logical network creation, you can create network sites to define the VLANs, IP
subnets, and IP subnet/VLAN pairs that are associated with the logical network in each
physical location.”
Networking modes
• We can chose different networking modes in a VM:

• Not attached

• Network Address Translation (NAT)

• Bridged networking

• Internal networking

• Host-only networking

• Generic networking
Not attached
• In this mode, VirtualBox reports to the guest that a network card is
present, but that there is no connection -- as if no Ethernet cable was
plugged into the card.

• This way it is possible to "pull" the virtual Ethernet cable and disrupt
the connection, which can be useful to inform a guest operating
system that no network connection is available and enforce a
reconfiguration.
Network Address Translation (NAT)
• It does not require any configuration on the host network and guest
system.
• For this reason, it is the default networking mode in VirtualBox.
• VirtualBox networking engine acts as a router and placed between
each virtual machine and the host
• This separation maximizes security since by default virtual machines cannot
talk to each other.
• You cannot run a server this way unless you set up port forwarding

Ah. Khalid Nasrat 6


Bridged networking
• This is for more advanced networking needs such as network
simulations and running servers in a guest.
• When enabled, VirtualBox connects to one of your installed network
cards and exchanges network packets directly, circumventing your
host operating system's network stack.
• Bridging to a wireless interface is done differently because most
wireless adapters do not support promiscuous mode.
• All traffic has to use the MAC address of the host's wireless adapter, and
therefore VirtualBox needs to replace the source MAC address in the Ethernet
header of an outgoing packet to make sure the reply will be sent to the host
interface.
Internal networking
• This can be used to create a different kind of software-based network
which is visible to selected virtual machines, but not to applications
running on the host or to the outside world.
Host-only networking
• This can be used to create a network containing the host and a set of
virtual machines, without the need for the host's physical network
interface.
• Instead, a virtual network interface (similar to a loopback interface) is
created on the host, providing connectivity among virtual machines
and the host.
Generic networking
• Rarely used modes share the same generic network interface, by
allowing the user to select a driver which can be included with
VirtualBox or be distributed in an extension pack.
• At the moment there are potentially two available sub-modes:
• UDP Tunnel: This can be used to interconnect virtual machines running on
different hosts directly, easily and transparently, over existing network
infrastructure.
• VDE (Virtual Distributed Ethernet) networking: This option can be used to
connect to a Virtual Distributed Ethernet switch on a Linux or a FreeBSD host.
At the moment this needs compiling VirtualBox from sources, as the Oracle
packages do not include it.

Ah. Khalid Nasrat 10


Xen Domain
• Xen runs guests in environments known as domains which
encapsulate a complete running virtual environment
• There are two types of Domains:
• DomU:
• the “U” stands for unprivileged.
• Guest OSs run in this domain.
• Dom0:
• has elevated privileges
• Provides device drivers
• Provides tools/mechanisms to configure Virtualization environment
Xen Networking
• A Xen guest typically has access to one or more paravirtualised (PV)
network interfaces
• A paravirtualised network device consists of a pair of network devices.
• The first of these (the frontend) will reside in the guest domain while the second
(the backend) will reside in the backend domain (typically Dom0).
• A similar pair of devices is created for each virtual network interface
• The frontend devices appear much like any other physical Ethernet NIC in
the guest domain.
• creates a device ethN e.g eth0
• The backend device is typically named such that it contains both the guest
domain ID and the index of the device.
• Under Linux such devices are by default named vifDOMID.DEVID

Ah. Khalid Nasrat 12


Xen Networking concept
Network flow in Xen
Linux Bridge
• Many hypervisor based Xen Server

virtualization apply Linux (Vlan 2) (Vlan 30) (Vlan 30)

Bridge model, such as KVM, VM1 VM2 VM3 VM4


libvirt. eth0 eth1 eth0 eth1 eth0 eth1 eth0 eth1

domU
• All of bridging work are dom0
done by ‘brctl’. vif1.0 vif1.1 vif2.0 vif2.1 vif3.0 vif3.1 vif4.0 vif4.1

• Provide simple L2 switching (Vlan 1) (Vlan 2) (Vlan 30)

functions. xenbr0 xenbr1 xapi1 xapi2 xapi30 xenbr2 Xenbr3

• The default (and most eth1.1 eth1.2


(insert vlan tag)
eth1.30

common) Xen configuration (untagged


traffic)
(tagged traffic)

uses bridging within the eth0 eth1 eth2 eth3

backend domain (typically


domain 0) to allow all
domains to appear on the XenMgmt
DataNetwork (vlan)
(172.v.v.h/16)
Internet
(192.168.0.0/16)
VmMgmt
(10.5.0.0/16)

network as individual hosts.


Switch
(trunk port)
Ah. Khalid Nasrat 16
Ah. Khalid Nasrat 17
VMware Infrastructure 3

VMware Infrastructure provides a rich set of networking capabilities that


integrate well with sophisticated enterprise networks
VirtualBox Installation
• Oracle VM VirtualBox is the best free virtual machine software.
• Windows
• Mac
• Linux
• Whether you want to test a version of Windows or test a bootable ISO file, VirtualBox is the best software
out there for the job.
• Installing an operating system in VirtualBox is relatively easy.
Step-by-step Installation of Ubuntu on VirtualBox
• Step 1. download an install VirtualBox:
• Download virtualbox “.exe”
• Install it by simply few clicks of next.
• Step 2. download Ubuntu ISO file
• Step 3. Launch VirtualBox. Click the Newbutton to open Create Virtual Machine
wizard.
Step-by-step Installation of Ubuntu on VirtualBox
• Step 4. Enter a name for the virtual machine, select the type of operating system
you want to install by selecting an entry from the drop-down list, and then select
the version before clicking on the Next button to continue.
Step-by-step Installation of Ubuntu on VirtualBox
• Step 5. In the resulting screen, you need to allocate a portion of the RAM to
the virtual machine. Depending on the amount of RAM installed on your PC
and the operating system you have selected in the previous step, Virtual
Machine recommends you allocate x MB of RAM. You can either go with the
recommended amount or allocate a little more but make sure you don’t
allocate less than the recommended amount.
Step-by-step Installation of Ubuntu on VirtualBox
• Step 5. In the resulting screen, you need to allocate a portion of the RAM to the
virtual machine. Depending on the amount of RAM installed on your PC and the
operating system you have selected in the previous step, Virtual Machine
recommends you allocate x MB of RAM. You can either go with the recommended
amount or allocate a little more but make sure you don’t allocate less than the
recommended amount.

• After selecting the RAM, click


Next button.
• NOTE: One shouldn’t allocate
more than half the size of physical
RAM to the virtual machine.
Step-by-step Installation of Ubuntu on VirtualBox
• Step 6. In this step, you need to create a virtual hard drive. To do so, click on
the Create button to open Create Virtual Hard Drive wizard. Here, select VDI or
VHD as the virtual hard drive type. Click Next button.
Step-by-step Installation of Ubuntu on VirtualBox
• Select Dynamically allocated or Fixed size be carefully reading the available
description. In short, if you select Dynamically allocated option, the virtual
hard drive will grow as you use it, whereas Fixed size means that the virtual
machine will use all allocated space from right now.
Step-by-step Installation of Ubuntu on VirtualBox
• Step 7. Next, select a location to save the virtual hard drive and also select the
size of virtual hard drive, and click create.
• Step 8. Now that you have the virtual hard drive, it’s time to select an ISO
image file that you want to use to install the operating system. Please note that
the ISO must be bootable.
• Right-click on the newly created virtual machine entry (in the left pane of
VirtualBox Manager) and then click Settings button.

• Step 9. In the left-pane of Settings, click


Storage, double-click on the Controller
(located under Storage tree) to expand the
same and see newly created virtual hard
drive entry.
Step-by-step Installation of Ubuntu on VirtualBox
• Click on Empty (see picture), then click the small icon next to CD/DVD drive,
click Choose a virtual CD/DVD disk file option to browse to the location of the
ISO file. Select the ISO file and then click OK button. That’s it!
• You can now select the virtual machine entry on the home screen of VirtualBox
Manager and then click Start button to boot from the selected ISO file and
install your new operating system like a normal Ubuntu installation.
• After installation is completed, start using your operating system. Good luck.
Sharing folder between host and guest OS
• On the guest operating system go to settings -> general -> advanced: Select bidirectional for both “Shared
Clipboard” and “Drag’n Drop”.
• Go to settings ->Shared Folders: click on Add New Shared Folder icon and set the path and name for the
folder you want to share. Check “Auto-mount” and “Make Permanent” boxes.
• Start the guest OS.
• Add your user to the vboxfs group:
• Reboot the guest OS:
• After restart, the shared folder should be mounted to “/media/sf_<shared_folder_name>”.
Linux’s useful commands
• print working directory ($pwd): shows the current working directory. Current
working directory is a default location in which any file operations will take
place.
• Change directory ($cd): is used to change the current directory.
• “/” is the sign of root directory. The root directory is the base of Linux file
system. From there everything else branches out to form a tree of directories
and subdirectories.
• From the root directory, the command “$cd home”will move you into the
"home" directory (which is an immediate subdirectory of "/").
• Going to a parent directory ($cd ..): will take you back to the parent directory
form within a child directory. You can use multiple “..” to change multilevel of
directories. Example : $cd ../..
• “~” is the sign of home directory. “$cd ~” will take you to your home directory.
Creating files and folders
• $mkdir : is used to create directories
• $ls : is used to list the content of a directory
• To create a file:
• $cat filename.txt
• $touch filename.txt
• $> filename.txt

You might also like