Virtualization Commands

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hello, Cybrarians,
00:00
welcome back to the Linux plus course here Cybrary.
00:00
I'm your instructor, Rob Goelz.
00:00
In today's lesson,
00:00
we're going to cover virtualization commands.
00:00
Upon completion of the lesson today,
00:00
you're going to be able to use the
00:00
verse commands that are used in libvirt.
00:00
We'll also understand why we would use a VMM.
00:00
Brief message about libvirt.
00:00
Libvirt is a utility that was
00:00
created by Red Hat to work with hypervisors.
00:00
Then the Linux world,
00:00
we're going to use libvirt if we want to work with
00:00
a KVM hypervisor more or less,
00:00
that's generally what it's used for.
00:00
KVM stands for Kernel-based virtual machine.
00:00
The KVM hypervisor is akin to an open source VMware.
00:00
Now the virsh command line utility is
00:00
just a command line interface that
00:00
we use to work with libvirt.
00:00
It's not installed by default,
00:00
it only gets installed when you install KVM or you
00:00
can install it manually if for
00:00
some reason, it doesn't come along.
00:00
It's installed in the package
00:00
called libvirt-client or clients,
00:00
depending upon whether or not you're
00:00
installing in Ubantu or CentOS.
00:00
On Ubantu, you would install it
00:00
with apt-get install libvirt-clients.
00:00
But on CentOS, you install it with yum
00:00
install libvirt-client, singular.
00:00
Now common virsh commands that you need to know about.
00:00
Well, these are useful to know about for the exam,
00:00
but I'll tell you as well that they're
00:00
useful to know if you're going to have
00:00
a Linux interview because a lot of people are
00:00
using these and I have personally
00:00
blanked on some of these.
00:00
Definitely try to memorize these if you're going to be
00:00
going into the exam or sitting for an interview,
00:00
both good times to know this information.
00:00
The first command you're going to want to know about is
00:00
the virsh list command.
00:00
Really, what that does is it lists
00:00
domains and domains are
00:00
just another word for virtual machines
00:00
or VMs in libvirt speak.
00:00
Now you can run virsh list with
00:00
the -all flag or -all option.
00:00
It'll show you all the VMs,
00:00
even those that are inactive.
00:00
You can use virsh console to connect to a VM,
00:00
and actually see the console as if you
00:00
were standing in front of a physical machine,
00:00
and you had a keyboard video and mouse plugged into it.
00:00
The virsh create command is used to
00:00
create a VM from an XML file.
00:00
This is similar to what we saw
00:00
before when we talked about Cloud-init.
00:00
A lot of times, we have XML files that provide
00:00
the configuration or the environment settings
00:00
for the VM that we're going to be creating.
00:00
The virsh reboot command is used to reboot a VM.
00:00
Then finally, the virsh shutdown command
00:00
gracefully shuts down the VM.
00:00
Now the virtual machine manager or
00:00
VMM is just another way to work with virtual machine.
00:00
Just like we have virsh for command line,
00:00
the virt-manager command is used to bring up
00:00
a graphical user interface that we could use
00:00
to manage virtual machines when we're in KVM.
00:00
You can see on the right-hand side,
00:00
that's an example of a virtual machine manager of
00:00
VMM that we launched with virt-manager.
00:00
But with that in this lesson,
00:00
we've covered the libvirt
00:00
management utility and using virsh.
00:00
There's a command line for libvirt and KVM.
00:00
Then we also talked a little bit about
00:00
the virt-manager GUI interface,
00:00
the VMM that is used for libvirt and KVM.
00:00
Thank you so much for being here and I look
00:00
forward to seeing you in our next lesson.
Up Next