- KVM Virtualization Cookbook
- Konstantin Ivanov
- 274字
- 2021-07-02 22:07:10
How to do it...
To install libvirt from packages and source follow the following steps:
- On Ubuntu, install the package by running:
root@kvm:~# apt update && apt install libvirt-bin
root@kvm:~#
- Ensure that the libvirt daemon is running by executing:
root@kvm:~# pgrep -lfa libvirtd
36667 /usr/sbin/libvirtd
root@kvm:~#
- Examine the default configuration:
root@kvm:~# cat /etc/libvirt/libvirtd.conf | grep -vi "#"
| sed '/^$/d'
unix_sock_group = "libvirtd"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"
root@kvm:~#
- Disable the security driver in QEMU by editing the qemu configuration file as follows:
root@kvm:~# vim /etc/libvirt/qemu.conf
...
security_driver = "none"
...
root@kvm:~#
- Restart the libvirt daemon:
root@kvm:~# /etc/init.d/libvirt-bin restart
libvirt-bin stop/waiting
libvirt-bin start/running, process 1158
root@kvm:~#
Depending on your Linux distribution, the name of the libvirt service may be different. On RHEL/CentOS, the name of the service is libvirtd; to restart it, run service libvirtd restart.
- Examine all configuration files in the libvirt directory:
root@kvm:~# ls -la /etc/libvirt/
total 76
drwxr-xr-x 5 root root 4096 Mar 22 14:27 .
drwxr-xr-x 90 root root 4096 Mar 21 23:17 ..
drwxr-xr-x 2 root root 4096 Feb 5 2016 hooks
-rw-r--r-- 1 root root 518 Feb 5 2016 libvirt.conf
-rw-r--r-- 1 root root 13527 Feb 5 2016 libvirtd.conf
-rw-r--r-- 1 root root 1176 Feb 5 2016 lxc.conf
drwxr-xr-x 2 root root 4096 Mar 21 23:16 nwfilter
drwxr-xr-x 3 root root 4096 Mar 21 23:57 qemu
-rw------- 1 root root 16953 Mar 21 23:18 qemu.conf
-rw-r--r-- 1 root root 2170 Feb 5 2016 qemu-lockd.conf
-rw-r--r-- 1 root root 2213 Feb 5 2016 virtlockd.conf
-rw-r--r-- 1 root root 1217 Feb 5 2016 virt-login-shell.conf
root@kvm:~#
推薦閱讀
- DB2 V9權威指南
- Java多線程編程實戰指南:設計模式篇(第2版)
- C#程序設計(慕課版)
- AngularJS深度剖析與最佳實踐
- Kali Linux Wireless Penetration Testing Beginner's Guide(Third Edition)
- R大數據分析實用指南
- UML 基礎與 Rose 建模案例(第3版)
- 區塊鏈技術與應用
- Web性能實戰
- Beginning C++ Game Programming
- 單片機原理及應用技術
- jQuery for Designers Beginner's Guide Second Edition
- Laravel Design Patterns and Best Practices
- 微信小程序開發邊做邊學(微課視頻版)
- 軟件測試技術