Getting virtual machine images for each lab
- Last Updated: 08/12/2020
Getting the proper virtual machine images for each lab¶
For each lab, you will need a set of images and files:
KVM Intro: guest.xml, guest.img
Static Routing: spoke1.img, spoke1.xml
Firewall: pfsense_guest.img, fios.img, fios.xml, google.img, google.xml
Firewall OpenBSD: fw-lab.img, fw-lab.xml
VOIP: guest.img, guest.xml
The url to each of these files follows the pattern "http://dropbox.ipengines.net/kvmtraining/<filename>" where <filename> is replaced with your desired file.
Option 1 Getting images over the internet¶
To get all the virtual machine images needed, first make sure the server is connected to the internet using the steps above. To grab each file, follow these steps:
root@labsrv1 13:53:31 > ~ # cd /data/ root@labsrv1 13:53:36 > /data # wget <url_of_file>
Do this wget statement for each required file.
Option 2 Copying images from a flash drive to a server¶
If you don't want to/can't plug the servers directly into school ethernet, you can use a flash drive to transfer the virtual machine images from another computer. Before downloading each file, however, ensure that the flash drive is large enough to hold the virtual machine images.
3cx-guest.img: 10 gb
pfsense_guest.img: 3.8 gb
All other images are 3 gb in size.
Once you have the desired images on the flash drive, plug the flash drive into the servers, and follow these steps:
1. Log into the server
Use the "root" username and either the default password or whatever password you created.
2. Identify which device on the server is your flash drive
To identify your flash drive among all the other disks on the server, use this command to go through all the disks:
root@labsrv1 17:40:48 ~ > fdisk -l | less
This will let you scan through all the disks and find the flash drive. Look for the device that has a size close to that of your flash drive and has a partition formatted in either the FAT or HPFS/NTFS/exFAT filesytem format. Here is an example of a 32 gb flash drive:
Disk /dev/sdg: 29.4 GiB, 31591497728 bytes, 61702144 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xf1f96fe6 Device Boot Start End Sectors Size Id Type /dev/sdg1 2048 61702143 61700096 29.4G 7 HPFS/NTFS/exFAT
As you can see, it is clearly identifiable by its size and file format.
3. Make the directory for the flash drive
Before mounting the flash drive, we need something to actually mount it on. To do this, use the mkdir command to create a directory on /mnt/media:
root@labsrv1 17:44:27 > ~ # mkdir -p /mnt/media/
4. Mount the flash drive
The output of fdisk above shows us that the disk /dev/sdg has a single partition, /dev/sdg1. That partition is what needs to be mounted, not the entire disk. To mount the disk, use this command, replacing /dev/sdg1 with your appropriate disk:
root@labsrv1 17:44:19 > ~ # mount /dev/sdg1 /mnt/media/
5. Copy the files
Now you have the hard part out of the way. You can now just copy over the files. Don't be worried if this takes a while. These are big files we're moving and might take a few minutes.
root@labsrv1 17:50:15 > /mnt/media # ls spoke1.img root@labsrv1 17:50:16 > /mnt/media # cp spoke1.img /data/
6. Unmount and unplug the flash drive
Finally, exit the directory, unmount the flash drive, and unplug it.
root@labsrv1 17:51:21 > /mnt/media # cd root@labsrv1 17:52:04 > ~ # umount /mnt/media/