银河麒麟V10创建kvm虚拟机

一、安装libvirt

libvirt提供一整套的API,用于管理KVM虚拟机,其他图形化界面(virt-manager等)可以通过libvirt管理kvm虚拟机。

1.1安装包上传至/home/kylin/libvirt(链接: https://pan.baidu.com/s/1BWAsuir3H8NCo2Rx1baKHA 密码: h5o2)

1.2更新软件源后安装依赖

sudo apt update

sudo apt install --fix-missing libxml2-utils xsltproc rst2pdf libgnutls28-dev libxml2-dev libtirpc-dev libaudit-dev libcap-ng-dev libcap-ng-utils bash-completion libdevmapper-dev libfuse-dev libglusterfs-dev libiscsi-dev libnl-3-dev libparted-dev libpcap-dev libssh-dev libssh2-1-dev libnetcf-dev libopenwsman-dev libnuma-dev libpciaccess-dev librbd-dev libreadline-dev libsanlock-dev libsasl2-dev libyajl-dev numad at-spi2-core kvmtool qemu qemu-kvm bridge-utils libapparmor-dev qemu-utils wireshark-dev gir1.2-spiceclientgtk-3.0 spice-client-gtk spice-client-glib-usb-acl-helper qemu-user qemu-system qemu-slof qemu-efi

1.3安装meson

sudo dpkg -i meson_0.55.3-1_all.deb

1.4解压libvirt-7.0.0.tar.xz并切换到解压目录下

tar xvf libvirt-7.0.0.tar.xz

cd libvirt-7.0.0

1.4.1建议在普通用户下使用meson和ninja编译安装

meson build -D secdriver_selinux=disabled -D selinux=disabled -D selinux_mount=disabled

ninja -C build

sudo ninja -C build install

1.5安装虚拟化管理工具virt-manager

sudo apt install virt-manager

启动

sudo -i

systemctl start libvirtd

virsh net-start default

virt-manager

vnc连接,提示(virt-manager:4678):Gtk-WARNING**:15:09:34.433:cannot open display: :1

执行xhost local:virt-manager 再试ok

二、创建虚拟机

2.1打开虚拟管理器,新建虚拟机

2.2选择“本地安装介质(ISO映像或者光驱)(L)”

1

2.3浏览--本地浏览--找到ISO镜像

2
11

麒麟服务器选择centos,桌面选择ubuntu,开始安装,安装略

你可能感兴趣的:(银河麒麟V10创建kvm虚拟机)