TP 1
TP 1
TP 1
Name : XP-VM-1
Memory : 512 MB
Hard Disk : créer un nouveau Virtual Hard Disk
Hard Disk File Type : choisissez VDI (référez-vous à l’annexe)
Storage on physical hard disk : dynamically allocated (référez-vous à l’annexe)
File location : laisser par défaut
File size : 10 GB
4. Clonez cette machine dans une nouvelle dont les paramètres sont :
Name : XP-VM-2
Mac Adress Policy : Generate new Mac Addresses …
Additionnal options : Laisser vide
Path : laisser par défaut
5. Dans la configuration des deux machines virtuelles changer les modes des deux
machines puis testez les pings et remplissez les deux tableaux suivants :
Tableau 1 :
1
Adresse IP hôte Mode XP-VM-1 IP XP-VM-1 Ping Hôte->XP- Ping XP-VM-
VM-1 1 -> Hôte
Not Attached
NAT
Bridge
Internal
Network
Host-only
Tableau 2
Afin de pouvoir créer des partages entre les machines virtuelles, vous devez
configurer les VirtualBox Guest Additions. Les Guest Additions fournissent aux
machines virtuelles de nouvelles fonctionnalités. Pour plus de détails, visitez
https://www.virtualbox.org/manual/ch04.html#guestadd-intro
6. Installer les Guest Additions dans la machine virtuelle via le menu Device / Install
Guest Additions CD Image.
8. Puis via le menu Devices / Shared Folders / Shared Folders Setting, créez un nouveau
Shared Folder :
9. Faites des tests de partage de fichiers entre les deux machine hôte et virtuelle.
2
VBoxManage.exe modifyhd "{chemin-vers-le-disque-virtuel}" --resize {taille en Mo}
Exmple :
VBoxManage.exe modifyhd "C:\...\XP-VM" --resize 15000
11. Faites la modification sur un système linux, centos ou ubunto par exemple.
Annexe
File type :
VDI. Normally, Oracle VM VirtualBox uses its own container format for guest hard disks.
This is called a Virtual Disk Image (VDI) file. This format is used when you create a new
virtual machine with a new disk.
VMDK. Oracle VM VirtualBox also fully supports the popular and open VMDK container
format that is used by many other virtualization products, such as VMware.
VHD. Oracle VM VirtualBox also fully supports the VHD format used by Microsoft.
Concernant l’occupation de l’espace physique sur le disque de l’hôte, deux options sont
fournies par VirtualBox :
Fixed-size. If you create a fixed-size image, an image file will be created on your host
system which has roughly the same size as the virtual disk's capacity. So, for a 10 GB
disk, you will have a 10 GB file. Note that the creation of a fixed-size image can take
a long time depending on the size of the image and the write performance of your hard
disk.
Dynamically allocated. For more flexible storage management, use a dynamically
allocated image. This will initially be very small and not occupy any space for unused
virtual disk sectors, but will grow every time a disk sector is written to for the first
time, until the drive reaches the maximum capacity chosen when the drive was
created. While this format takes less space initially, the fact that Oracle VM
VirtualBox needs to expand the image file consumes additional computing resources,
so until the disk file size has stabilized, write operations may be slower than with fixed
size disks. However, after a time the rate of growth will slow and the average penalty
for write operations will be negligible.
Network :
Each of the networking adapters can be separately configured to operate in one of the
following modes:
1
https://docs.oracle.com/cd/E97728_01/E97727/html/vdidetails.html
3
Not attached. In this mode, Oracle VM VirtualBox reports to the guest that a network
card is present, but that there is no connection. This is as if no Ethernet cable was
plugged into the card. Using this mode, 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.
NAT (Network Address Translation). If all you want is to browse the Web,
download files, and view email inside the guest, then this default mode should be
sufficient for you, and you can skip the rest of this section..
NAT Network. A NAT network is a type of internal network that allows outbound
connections. See Section 6.4, “Network Address Translation Service”.
Bridged networking. This is for more advanced networking needs, such as network
simulations and running servers in a guest. When enabled, Oracle VM VirtualBox
connects to one of your installed network cards and exchanges network packets
directly, circumventing your host operating system's network stack.
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 which share the same generic network
interface, by allowing the user to select a driver which can be included with Oracle
VM VirtualBox or be distributed in an extension pack.