Virtual Machine Learning Activity – VMs
Linux Training Architect I in Content
In this lab, we're going to be using the provisioned servers to practice managing Virtual Machines in a RHEL7 environment. We'll start one, and investigate the settings to discover and troubleshoot issues.
Virtual Machine Learning Activity
In this lab, we're going to be using the provisioned servers to practice managing Virtual Machines in a RHEL7 environment.
We'll start one, and investigate the settings to discover and troubleshoot issues.
Get logged in
Use the credentials and server IP in the hands-on lab overview page to log into our lab server. Once we're in, we can get moving. We're going to need
root access right off, so as soon as we're logged in, we'll run a quick
sudo -i and get the privileges required.
Find the Name of the Virtual Machine on the Server
To get a list of any running virtual machines, we'll run:
[root@host]$ virsh list
At the moment, we don't have any running, so nothing will show up in that list. To see the ones that are installed (whether they're running or not), we can run:
[root@host]$ virsh list --all
We'll see one named
Start the VM
[root@host]$ virsh start centos7.0
Note that when we see
Domain centos7.0 started, the word Domain is synonymous with Virtual Machine.
Now when we run
virsh list, we'll see it.
Determine the Location and Names of the Files that the VM is Storing
We can look at the configuration of an individual VM by running:
[user@host]$ virsh edit centos7.0
This essentially dumps us into a Vim session, and we're looking at an XML file containing all of the configuration for this
disk contain the source file (something like
var/lib/libvirt/images/centos7.0.qcow2) for all the disks allocated to the VM.
If we get out of the file (it's Vim, so hit Esc, then type
q!, and hit Enter) we can look at how big these disks are. In this case, we'd run
ls -l /var/lib/libvirt/images.
This was just a tour really, but we made it through. We've got a little better idea of how to look at VM details, including where they store files. Congratulations!