kvm web管理 webvirtmgr

[toc]

reference

  1. https://blog.csdn.net/yangshihuz/article/details/104055288
  2. https://blog.csdn.net/u010856284/article/details/89018195

webvirtmgr

準(zhǔn)備工作

# 拉取鏡像
docker pull primiano/docker-webvirtmgr

# 設(shè)置環(huán)境
mkdir -p /data/vm
groupadd -g 1010 webvirtmgr
useradd -u 1010 -g webvirtmgr -s /sbin/nologin -d /data/vm webvirtmgr
chown -R webvirtmgr:webvirtmgr /data/vm

啟動

docker run -d -p 8090:8080 -p 6090:6080 --name webvirtmgr \
--mount type=bind,source=/data/vm,target=/data/vm  --restart=always primiano/docker-webvirtmgr

主機(jī)配置

  1. Libvirtd服務(wù)監(jiān)聽配置
    修改/etc/sysconfig/libvirtd文件,去掉下面一行的注釋,使Libvirt服務(wù)處于監(jiān)聽狀態(tài):
    vim /etc/sysconfig/libvirtd
LIBVIRTD_ARGS="--listen
  1. 配置Libvirt服務(wù),允許通過tcp方式通訊,修改vim /etc/libvirt/libvirtd.conf
#允許tcp監(jiān)聽
listen_tcp = 1
#配置tcp通過sasl認(rèn)證
auth_tcp = sasl
#取消CA認(rèn)證功能
listen_tls = 0

啟動服務(wù):
service libvirtd start

  1. 配置賬號密碼
saslpasswd2 -a libvirt 你的賬號
Password: 你的密碼
Again (for verification): 再次確認(rèn)你的密碼

查看賬號:

[root@dell ylsjw]# sasldblistusers2 -f /etc/libvirt/passwd.db
admin@dell: userPassword

驗證設(shè)置

[root@dell ylsjw]# virsh -c qemu+tcp://192.168.1.34/system nodeinfo
Please enter your authentication name: admin
Please enter your password: 
CPU model:           x86_64
CPU(s):              256
CPU frequency:       1500 MHz
CPU socket(s):       1
Core(s) per socket:  64
Thread(s) per core:  2
NUMA cell(s):        2
Memory size:         263587912 KiB

啟動登錄

  1. 啟動webvirtmgr web登錄頁面http://192.168.1.249:8090
  2. 登錄初始用戶名/密碼:admin/1234

頁面添加連接

Label                   192.168.1.34
FQDN / IP         192.168.1.34
用戶名                 admin
密碼                     123456

修改啟動webvirtmgr登錄密碼

root@initial:/data/vm# docker exec -it webvirtmgr bash
root@18fa11b229e1:/# ping 192.168.1.34 -c 2
root@18fa11b229e1:/# cd /webvirtmgr/
root@18fa11b229e1:/webvirtmgr# python manage.py changepassword admin
Changing password for user 'admin'
Password: 
Password (again): 
Password changed successfully for user 'admin'

Q&A

1. No route to host

Q: kvm unable to connect to server at '192.168.1.34:16509': No route to host

A:firewall-cmd --zone=public --add-port=16509/tcp --permanent or close filewall temporary

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容