libvirt kvm_Linux KVM Libvirt教程

libvirt kvm

libvirt kvm

Hi today we are gonna look for managing vms especially in Linux with libvirt. Libvirt is a library and tools to manage vms. Lbivirt development is supported by Red hat and defacto tool in Linux world. In Linux Kvm/qemu is generally used for virtuulization but libvirt supports Xen, Virtualbox, Vmware, Hyperv too. To install and see info about the libvirt packet. As you see it is very little tiny packet and it install a daemon to control virtualization.

今天您好,我们将寻求管理VM,尤其是在使用libvirtLinux中。 Libvirt是用于管理虚拟机的库和工具。 Linux世界中的Red hat和defacto工具支持Lbivirt开发。 在Linux中,Kvm / qemu通常用于虚拟化,但libvirt也支持Xen,Virtualbox,Vmware和Hyperv。 要安装并查看有关libvirt数据包的信息。 如您所见,它是一个很小的小数据包,它安装了一个守护程序来控制虚拟化。

安装Libvirt软件包 (Install Libvirt Package)

Debian,Ubuntu,Mint,Kali(Debian, Ubuntu, Mint, Kali)

libvirt is named as libvirt-daemon in distributions like Debian, Ubuntu, Mint and Kali.

在诸如Debian,Ubuntu,Mint和Kali的发行版中, libvirt被命名为libvirt-daemon

$ sudo apt install libvirt-daemon

Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)

$ sudo yum -y install libvirt

禁用SeLinux (Disable SeLinux)

Some security mechanisms can prevent or block running libvirt . One of them is SELinux. We can disable SELinux with the following setsebool command.

一些安全机制可以阻止或阻止运行libvirtSELinux就是其中之一。 我们可以使用以下setsebool命令禁用SELinux。

$ sudo setsebool false

启动Libvirt守护程序 (Start Libvirt Daemon)

We will start libvirt daemon to connect server with out client virsh

我们将启动libvirt守护程序以将服务器与客户端virsh断开连接

$ sudo systemctl start libvirtd

检查Libvirt守护程序状态 (Check Libvirt Daemon Status)

We will use systemctl status  command in order to check the libvirtdaemon status.

我们将使用systemctl status命令来检查libvirt守护程序的状态。

$ sudo systemctl status libvirtd
Check Libvirt Daemon Status
Check Libvirt Daemon Status
检查Libvirt守护程序状态

使用Virsh连接到Libvirt(Connect To Libvirt with Virsh)

As stated previously libvirt runs as a daemon. We can connect libvirt with the virsh tool. virsh provides bath and interactive console to manage KVM virtualization. We generally require root privileges to connect virsh.

如前所述, libvirt作为守护程序运行。 我们可以将libvirt与virsh工具连接。 virsh提供了浴和交互式控制台来管理KVM虚拟化。 我们通常需要root特权才能连接virsh。

$ sudo virsh

将普通用户添加到虚拟化 (Add Normal User To Virtualization)

If we want to connect  virshwith the normal user we need to add this user to the virtualization group like below. So this user can connect and use virtualization without a root privilege. kvm is the virtualization group name. So we will add user ismail to this group with the usermod command.

如果要将virsh与普通用户连接,则需要将该用户添加到虚拟化组中,如下所示。 因此,该用户无需root特权即可连接和使用虚拟化。 kvm是虚拟化组名称。 因此,我们将使用usermod命令将用户ismail添加到该组。

$ sudo usermod -a -G kvm ismail

Linux KVM Libvirt教程信息图 (Linux KVM Libvirt Tutorial Infographic)

Linux KVM Libvirt Tutorial Infographic
LEARN MORE  Linux Uname Command Tutorial With Examples To List Operating System, Kernel, Machine, Processor Architecture
了解更多Linux Uname命令教程,并举例列出操作系统,内核,机器,处理器体系结构

翻译自: https://www.poftut.com/linux-kvm-libvirt-tutorial/

libvirt kvm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值