制作網(wǎng)頁的的網(wǎng)站torrentkitty磁力搜索引擎
1.關(guān)閉虛擬機
打開相關(guān)選項
打開虛擬機centos7
連接xshell
測試網(wǎng)絡(luò),現(xiàn)在就是沒問題的,因為我們要使用網(wǎng)絡(luò)源
安裝 GNOME 桌面環(huán)境
安裝KVM 模塊
安裝KVM 調(diào)試工具
構(gòu)建虛擬機的命令行工具
qemu 組件,創(chuàng)建磁盤、啟動虛擬機等
輸入這條命令,只要有輸出,就是支持虛擬化
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch tpr_shadow vnmi ept vpid fsgsbas~~~~
檢查 KVM 模塊是否安裝:
將 系 統(tǒng) 的 默 認(rèn) 運 行 target 更 改 為
graphical.targe。
[root@localhost ~]# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
?
開啟 libvirtd 服務(wù),以開啟相關(guān)支持。
[root@localhost ~]# systemctl start libvirtd
[root@localhost ~]# systemctl enable libvirtd
[root@localhost ~]# virt-manager
http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
進入這個目錄
[root@localhost images]# pwd
/var/lib/libvirt/images
在這個目錄當(dāng)中上傳一個centos7鏡像,這個比較小
[root@localhost images]# ll
總用量 996352
-rw-r--r--. 1 root root 1020264448 6月 24 16:52 CentOS-7-x86_64-Minimal-2009.iso
[root@localhost images]#
然后,點擊“開始安裝”
重啟就可以了
我們已經(jīng)進入到字符界面了
使用管理員用戶登錄
發(fā)現(xiàn)迷你版的鏡像沒有ifcofig命令
yum -y install net-tools
[root@localhost ~]# virsh -h //查看命令幫助
virsh [options]... [<command_string>]
virsh [options]... <command> [args...]
? options:
? ? -c | --connect=URI ? ? ?hypervisor connection URI
? ? -d | --debug=NUM ? ? ? ?debug level [0-4]
? ? -e | --escape <char> ? ?set escape sequence for console
? ? -h | --help ? ? ? ? ? ? this help
? ? -k | --keepalive-interval=NUM
? ? ? ? ? ? ? ? ? ? ? ? ? ? keepalive interval in seconds, 0 for disable
? ? -K | --keepalive-count=NUM
? ? ? ? ? ? ? ? ? ? ? ? ? ? number of possible missed keepalive messages
? ? -l | --log=FILE ? ? ? ? output logging to file
? ? -q | --quiet ? ? ? ? ? ?quiet mode
? ? -r | --readonly ? ? ? ? connect readonly
? ? -t | --timing ? ? ? ? ? print timing information
? ? -v ? ? ? ? ? ? ? ? ? ? ?short version
? ? -V ? ? ? ? ? ? ? ? ? ? ?long version
? ? ? ? ?--version[=TYPE] ? version, TYPE is short or long (default short)
? commands (non interactive mode):
?Domain Management (help keyword 'domain')
? ? attach-device ? ? ? ? ? ? ? ? ?從一個XML文件附加裝置
? ? attach-disk ? ? ? ? ? ? ? ? ? ?附加磁盤設(shè)備
? ? attach-interface ? ? ? ? ? ? ? 獲得網(wǎng)絡(luò)界面
? ? autostart ? ? ? ? ? ? ? ? ? ? ?自動開始一個域
? ? blkdeviotune ? ? ? ? ? ? ? ? ? 設(shè)定或者查詢塊設(shè)備 I/O 調(diào)節(jié)參數(shù)。
? ? blkiotune ? ? ? ? ? ? ? ? ? ? ?獲取或者數(shù)值 blkio 參數(shù)
? ? blockcommit ? ? ? ? ? ? ? ? ? ?啟動塊提交操作。
? ? blockcopy ? ? ? ? ? ? ? ? ? ? ?啟動塊復(fù)制操作。
? ? blockjob ? ? ? ? ? ? ? ? ? ? ? 管理活躍塊操作
? ? blockpull ? ? ? ? ? ? ? ? ? ? ?使用其后端映像填充磁盤。
? ? blockresize ? ? ? ? ? ? ? ? ? ?創(chuàng)新定義域塊設(shè)備大小
? ? change-media ? ? ? ? ? ? ? ? ? 更改 CD 介質(zhì)或者軟盤驅(qū)動器
? ? console ? ? ? ? ? ? ? ? ? ? ? ?連接到客戶會話
? ? cpu-stats ? ? ? ? ? ? ? ? ? ? ?顯示域 cpu 統(tǒng)計數(shù)據(jù)
? ? create ? ? ? ? ? ? ? ? ? ? ? ? 從一個 XML 文件創(chuàng)建一個域
? ? define ? ? ? ? ? ? ? ? ? ? ? ? 從一個 XML 文件定義(但不開始)一個域
? ? desc ? ? ? ? ? ? ? ? ? ? ? ? ? 顯示或者設(shè)定域描述或者標(biāo)題
? ? destroy ? ? ? ? ? ? ? ? ? ? ? ?銷毀(停止)域
? ? detach-device ? ? ? ? ? ? ? ? ?從一個 XML 文件分離設(shè)備
? ? detach-device-alias ? ? ? ? ? ?detach device from an alias
? ? detach-disk ? ? ? ? ? ? ? ? ? ?分離磁盤設(shè)備
? ? detach-interface ? ? ? ? ? ? ? 分離網(wǎng)絡(luò)界面
? ? domdisplay ? ? ? ? ? ? ? ? ? ? 域顯示連接 URI
? ? domfsfreeze ? ? ? ? ? ? ? ? ? ?Freeze domain's mounted filesystems.
? ? domfsthaw ? ? ? ? ? ? ? ? ? ? ?Thaw domain's mounted filesystems.
? ? domfsinfo ? ? ? ? ? ? ? ? ? ? ?Get information of domain's mounted filesystems.
? ? domfstrim ? ? ? ? ? ? ? ? ? ? ?在域掛載的文件系統(tǒng)中調(diào)用 fstrim。
? ? domhostname ? ? ? ? ? ? ? ? ? ?輸出域主機名
? ? domid ? ? ? ? ? ? ? ? ? ? ? ? ?把一個域名或 UUID 轉(zhuǎn)換為域 id
? ? domif-setlink ? ? ? ? ? ? ? ? ?設(shè)定虛擬接口的鏈接狀態(tài)
? ? domiftune ? ? ? ? ? ? ? ? ? ? ?獲取/設(shè)定虛擬接口參數(shù)
? ? domjobabort ? ? ? ? ? ? ? ? ? ?忽略活躍域任務(wù)
? ? domjobinfo ? ? ? ? ? ? ? ? ? ? 域任務(wù)信息
? ? domname ? ? ? ? ? ? ? ? ? ? ? ?將域 id 或 UUID 轉(zhuǎn)換為域名
? ? domrename ? ? ? ? ? ? ? ? ? ? ?rename a domain
? ? dompmsuspend ? ? ? ? ? ? ? ? ? 使用電源管理功能掛起域
? ? dompmwakeup ? ? ? ? ? ? ? ? ? ?從 pmsuspended 狀態(tài)喚醒域
? ? domuuid ? ? ? ? ? ? ? ? ? ? ? ?把一個域名或 id 轉(zhuǎn)換為域 UUID
? ? domxml-from-native ? ? ? ? ? ? 將原始配置轉(zhuǎn)換為域 XML
? ? domxml-to-native ? ? ? ? ? ? ? 將域 XML 轉(zhuǎn)換為原始配置
? ? dump ? ? ? ? ? ? ? ? ? ? ? ? ? 把一個域的內(nèi)核 dump 到一個文件中以方便分析
? ? dumpxml ? ? ? ? ? ? ? ? ? ? ? ?XML 中的域信息
? ? edit ? ? ? ? ? ? ? ? ? ? ? ? ? 編輯某個域的 XML 配置
? ? event ? ? ? ? ? ? ? ? ? ? ? ? ?Domain Events
? ? inject-nmi ? ? ? ? ? ? ? ? ? ? 在虛擬機中輸入 NMI
? ? iothreadinfo ? ? ? ? ? ? ? ? ? view domain IOThreads
? ? iothreadpin ? ? ? ? ? ? ? ? ? ?control domain IOThread affinity
? ? iothreadadd ? ? ? ? ? ? ? ? ? ?add an IOThread to the guest domain
? ? iothreaddel ? ? ? ? ? ? ? ? ? ?delete an IOThread from the guest domain
? ? send-key ? ? ? ? ? ? ? ? ? ? ? 向虛擬機發(fā)送序列號
? ? send-process-signal ? ? ? ? ? ?向進程發(fā)送信號
? ? lxc-enter-namespace ? ? ? ? ? ?LXC 虛擬機進入名稱空間
? ? managedsave ? ? ? ? ? ? ? ? ? ?管理域狀態(tài)的保存
? ? managedsave-remove ? ? ? ? ? ? 刪除域的管理保存
? ? managedsave-edit ? ? ? ? ? ? ? edit XML for a domain's managed save state file
? ? managedsave-dumpxml ? ? ? ? ? ?Domain information of managed save state file in XML
? ? managedsave-define ? ? ? ? ? ? redefine the XML for a domain's managed save state file
? ? memtune ? ? ? ? ? ? ? ? ? ? ? ?獲取或者數(shù)值內(nèi)存參數(shù)
? ? perf ? ? ? ? ? ? ? ? ? ? ? ? ? Get or set perf event
? ? metadata ? ? ? ? ? ? ? ? ? ? ? show or set domain's custom XML metadata
? ? migrate ? ? ? ? ? ? ? ? ? ? ? ?將域遷移到另一個主機中
? ? migrate-setmaxdowntime ? ? ? ? 設(shè)定最大可耐受故障時間
? ? migrate-getmaxdowntime ? ? ? ? get maximum tolerable downtime
? ? migrate-compcache ? ? ? ? ? ? ?獲取/設(shè)定壓縮緩存大小
? ? migrate-setspeed ? ? ? ? ? ? ? 設(shè)定遷移帶寬的最大值
? ? migrate-getspeed ? ? ? ? ? ? ? 獲取最長遷移帶寬
? ? migrate-postcopy ? ? ? ? ? ? ? Switch running migration from pre-copy to post-copy
? ? numatune ? ? ? ? ? ? ? ? ? ? ? 獲取或者數(shù)值 numa 參數(shù)
? ? qemu-attach ? ? ? ? ? ? ? ? ? ?QEMU 附加
? ? qemu-monitor-command ? ? ? ? ? QEMU 監(jiān)控程序命令
? ? qemu-monitor-event ? ? ? ? ? ? QEMU Monitor Events
? ? qemu-agent-command ? ? ? ? ? ? QEMU 虛擬機代理命令
? ? reboot ? ? ? ? ? ? ? ? ? ? ? ? 重新啟動一個域
? ? reset ? ? ? ? ? ? ? ? ? ? ? ? ?重新設(shè)定域
? ? restore ? ? ? ? ? ? ? ? ? ? ? ?從一個存在一個文件中的狀態(tài)恢復(fù)一個域
? ? resume ? ? ? ? ? ? ? ? ? ? ? ? 重新恢復(fù)一個域
? ? save ? ? ? ? ? ? ? ? ? ? ? ? ? 把一個域的狀態(tài)保存到一個文件
? ? save-image-define ? ? ? ? ? ? ?為域的保存狀態(tài)文件重新定義 XML
? ? save-image-dumpxml ? ? ? ? ? ? 在 XML 中保存狀態(tài)域信息
? ? save-image-edit ? ? ? ? ? ? ? ?為域保存狀態(tài)文件編輯 XML
? ? schedinfo ? ? ? ? ? ? ? ? ? ? ?顯示/設(shè)置日程安排變量
? ? screenshot ? ? ? ? ? ? ? ? ? ? 提取當(dāng)前域控制臺快照并保存到文件中
? ? set-lifecycle-action ? ? ? ? ? change lifecycle actions
? ? set-user-password ? ? ? ? ? ? ?set the user password inside the domain
? ? setmaxmem ? ? ? ? ? ? ? ? ? ? ?改變最大內(nèi)存限制值
? ? setmem ? ? ? ? ? ? ? ? ? ? ? ? 改變內(nèi)存的分配
? ? setvcpus ? ? ? ? ? ? ? ? ? ? ? 改變虛擬 CPU 的號
? ? shutdown ? ? ? ? ? ? ? ? ? ? ? 關(guān)閉一個域
? ? start ? ? ? ? ? ? ? ? ? ? ? ? ?開始一個(以前定義的)非活躍的域
? ? suspend ? ? ? ? ? ? ? ? ? ? ? ?掛起一個域
? ? ttyconsole ? ? ? ? ? ? ? ? ? ? tty 控制臺
? ? undefine ? ? ? ? ? ? ? ? ? ? ? 取消定義一個域
? ? update-device ? ? ? ? ? ? ? ? ?從 XML 文件中關(guān)系設(shè)備
? ? vcpucount ? ? ? ? ? ? ? ? ? ? ?域 vcpu 計數(shù)
? ? vcpuinfo ? ? ? ? ? ? ? ? ? ? ? 詳細(xì)的域 vcpu 信息
? ? vcpupin ? ? ? ? ? ? ? ? ? ? ? ?控制或者查詢域 vcpu 親和性
? ? emulatorpin ? ? ? ? ? ? ? ? ? ?控制火車查詢域模擬器親和性
? ? vncdisplay ? ? ? ? ? ? ? ? ? ? vnc 顯示
? ? guestvcpus ? ? ? ? ? ? ? ? ? ? query or modify state of vcpu in the guest (via agent)
? ? setvcpu ? ? ? ? ? ? ? ? ? ? ? ?attach/detach vcpu or groups of threads
? ? domblkthreshold ? ? ? ? ? ? ? ?set the threshold for block-threshold event for a given block device or it's backing chain element
?Domain Monitoring (help keyword 'monitor')
? ? domblkerror ? ? ? ? ? ? ? ? ? ?在塊設(shè)備中顯示錯誤
? ? domblkinfo ? ? ? ? ? ? ? ? ? ? 域塊設(shè)備大小信息
? ? domblklist ? ? ? ? ? ? ? ? ? ? 列出所有域塊
? ? domblkstat ? ? ? ? ? ? ? ? ? ? 獲得域設(shè)備塊狀態(tài)
? ? domcontrol ? ? ? ? ? ? ? ? ? ? 域控制接口狀態(tài)
? ? domif-getlink ? ? ? ? ? ? ? ? ?獲取虛擬接口鏈接狀態(tài)
? ? domifaddr ? ? ? ? ? ? ? ? ? ? ?Get network interfaces' addresses for a running domain
? ? domiflist ? ? ? ? ? ? ? ? ? ? ?列出所有域虛擬接口
? ? domifstat ? ? ? ? ? ? ? ? ? ? ?獲得域網(wǎng)絡(luò)接口狀態(tài)
? ? dominfo ? ? ? ? ? ? ? ? ? ? ? ?域信息
? ? dommemstat ? ? ? ? ? ? ? ? ? ? 獲取域的內(nèi)存統(tǒng)計
? ? domstate ? ? ? ? ? ? ? ? ? ? ? 域狀態(tài)
? ? domstats ? ? ? ? ? ? ? ? ? ? ? get statistics about one or multiple domains
? ? domtime ? ? ? ? ? ? ? ? ? ? ? ?domain time
? ? list ? ? ? ? ? ? ? ? ? ? ? ? ? 列出域
?Host and Hypervisor (help keyword 'host')
? ? allocpages ? ? ? ? ? ? ? ? ? ? Manipulate pages pool size
? ? capabilities ? ? ? ? ? ? ? ? ? 性能
? ? cpu-baseline ? ? ? ? ? ? ? ? ? 計算基線 CPU
? ? cpu-compare ? ? ? ? ? ? ? ? ? ?使用 XML 文件中描述的 CPU 與主機 CPU 進行對比
? ? cpu-models ? ? ? ? ? ? ? ? ? ? CPU models
? ? domcapabilities ? ? ? ? ? ? ? ?domain capabilities
? ? freecell ? ? ? ? ? ? ? ? ? ? ? NUMA可用內(nèi)存
? ? freepages ? ? ? ? ? ? ? ? ? ? ?NUMA free pages
? ? hostname ? ? ? ? ? ? ? ? ? ? ? 打印管理程序主機名
? ? hypervisor-cpu-baseline ? ? ? ?compute baseline CPU usable by a specific hypervisor
? ? hypervisor-cpu-compare ? ? ? ? compare a CPU with the CPU created by a hypervisor on the host
? ? maxvcpus ? ? ? ? ? ? ? ? ? ? ? 連接 vcpu 最大值
? ? node-memory-tune ? ? ? ? ? ? ? 獲取或者設(shè)定節(jié)點內(nèi)存參數(shù)
? ? nodecpumap ? ? ? ? ? ? ? ? ? ? 節(jié)點 cpu 映射
? ? nodecpustats ? ? ? ? ? ? ? ? ? 輸出節(jié)點的 cpu 狀統(tǒng)計數(shù)據(jù)。
? ? nodeinfo ? ? ? ? ? ? ? ? ? ? ? 節(jié)點信息
? ? nodememstats ? ? ? ? ? ? ? ? ? 輸出節(jié)點的內(nèi)存狀統(tǒng)計數(shù)據(jù)。
? ? nodesuspend ? ? ? ? ? ? ? ? ? ?在給定時間段掛起主機節(jié)點
? ? sysinfo ? ? ? ? ? ? ? ? ? ? ? ?輸出 hypervisor sysinfo
? ? uri ? ? ? ? ? ? ? ? ? ? ? ? ? ?打印管理程序典型的URI
? ? version ? ? ? ? ? ? ? ? ? ? ? ?顯示版本
?Interface (help keyword 'interface')
? ? iface-begin ? ? ? ? ? ? ? ? ? ?生成當(dāng)前接口設(shè)置快照,可在今后用于提交 (iface-commit) 或者恢復(fù) (iface-rollback)
? ? iface-bridge ? ? ? ? ? ? ? ? ? 生成橋接設(shè)備并為其附加一個現(xiàn)有網(wǎng)絡(luò)設(shè)備
? ? iface-commit ? ? ? ? ? ? ? ? ? 提交 iface-begin 后的更改并釋放恢復(fù)點
? ? iface-define ? ? ? ? ? ? ? ? ? define an inactive persistent physical host interface or modify an existing persistent one from an XML file
? ? iface-destroy ? ? ? ? ? ? ? ? ?刪除物理主機接口(啟用它請執(zhí)行 "if-down")
? ? iface-dumpxml ? ? ? ? ? ? ? ? ?XML 中的接口信息
? ? iface-edit ? ? ? ? ? ? ? ? ? ? 為物理主機界面編輯 XML 配置
? ? iface-list ? ? ? ? ? ? ? ? ? ? 物理主機接口列表
? ? iface-mac ? ? ? ? ? ? ? ? ? ? ?將接口名稱轉(zhuǎn)換為接口 MAC 地址
? ? iface-name ? ? ? ? ? ? ? ? ? ? 將接口 MAC 地址轉(zhuǎn)換為接口名稱
? ? iface-rollback ? ? ? ? ? ? ? ? 恢復(fù)到之前保存的使用 iface-begin 生成的更改
? ? iface-start ? ? ? ? ? ? ? ? ? ?啟動物理主機接口(啟用它請執(zhí)行 "if-up")
? ? iface-unbridge ? ? ? ? ? ? ? ? 分離其輔助設(shè)備后取消定義橋接設(shè)備
? ? iface-undefine ? ? ? ? ? ? ? ? 取消定義物理主機接口(從配置中刪除)
?Network Filter (help keyword 'filter')
? ? nwfilter-define ? ? ? ? ? ? ? ?使用 XML 文件定義或者更新網(wǎng)絡(luò)過濾器
? ? nwfilter-dumpxml ? ? ? ? ? ? ? XML 中的網(wǎng)絡(luò)過濾器信息
? ? nwfilter-edit ? ? ? ? ? ? ? ? ?為網(wǎng)絡(luò)過濾器編輯 XML 配置
? ? nwfilter-list ? ? ? ? ? ? ? ? ?列出網(wǎng)絡(luò)過濾器
? ? nwfilter-undefine ? ? ? ? ? ? ?取消定義網(wǎng)絡(luò)過濾器
? ? nwfilter-binding-create ? ? ? ?create a network filter binding from an XML file
? ? nwfilter-binding-delete ? ? ? ?delete a network filter binding
? ? nwfilter-binding-dumpxml ? ? ? XML 中的網(wǎng)絡(luò)過濾器信息
? ? nwfilter-binding-list ? ? ? ? ?list network filter bindings
?Networking (help keyword 'network')
? ? net-autostart ? ? ? ? ? ? ? ? ?自動開始網(wǎng)絡(luò)
? ? net-create ? ? ? ? ? ? ? ? ? ? 從一個 XML 文件創(chuàng)建一個網(wǎng)絡(luò)
? ? net-define ? ? ? ? ? ? ? ? ? ? define an inactive persistent virtual network or modify an existing persistent one from an XML file
? ? net-destroy ? ? ? ? ? ? ? ? ? ?銷毀(停止)網(wǎng)絡(luò)
? ? net-dhcp-leases ? ? ? ? ? ? ? ?print lease info for a given network
? ? net-dumpxml ? ? ? ? ? ? ? ? ? ?XML 中的網(wǎng)絡(luò)信息
? ? net-edit ? ? ? ? ? ? ? ? ? ? ? 為網(wǎng)絡(luò)編輯 XML 配置
? ? net-event ? ? ? ? ? ? ? ? ? ? ?Network Events
? ? net-info ? ? ? ? ? ? ? ? ? ? ? 網(wǎng)絡(luò)信息
? ? net-list ? ? ? ? ? ? ? ? ? ? ? 列出網(wǎng)絡(luò)
? ? net-name ? ? ? ? ? ? ? ? ? ? ? 把一個網(wǎng)絡(luò)UUID 轉(zhuǎn)換為網(wǎng)絡(luò)名
? ? net-start ? ? ? ? ? ? ? ? ? ? ?開始一個(以前定義的)不活躍的網(wǎng)絡(luò)
? ? net-undefine ? ? ? ? ? ? ? ? ? undefine a persistent network
? ? net-update ? ? ? ? ? ? ? ? ? ? 更新現(xiàn)有網(wǎng)絡(luò)配置的部分
? ? net-uuid ? ? ? ? ? ? ? ? ? ? ? 把一個網(wǎng)絡(luò)名轉(zhuǎn)換為網(wǎng)絡(luò)UUID
?Node Device (help keyword 'nodedev')
? ? nodedev-create ? ? ? ? ? ? ? ? 根據(jù)節(jié)點中的 XML 文件定義生成設(shè)備
? ? nodedev-destroy ? ? ? ? ? ? ? ?銷毀(停止)節(jié)點中的設(shè)備
? ? nodedev-detach ? ? ? ? ? ? ? ? 將節(jié)點設(shè)備與其設(shè)備驅(qū)動程序分離
? ? nodedev-dumpxml ? ? ? ? ? ? ? ?XML 中的節(jié)點設(shè)備詳情
? ? nodedev-list ? ? ? ? ? ? ? ? ? 這臺主機中中的枚舉設(shè)備
? ? nodedev-reattach ? ? ? ? ? ? ? 重新將節(jié)點設(shè)備附加到他的設(shè)備驅(qū)動程序中
? ? nodedev-reset ? ? ? ? ? ? ? ? ?重置節(jié)點設(shè)備
? ? nodedev-event ? ? ? ? ? ? ? ? ?Node Device Events
?Secret (help keyword 'secret')
? ? secret-define ? ? ? ? ? ? ? ? ?定義或者修改 XML 中的 secret
? ? secret-dumpxml ? ? ? ? ? ? ? ? XML 中的 secret 屬性
? ? secret-event ? ? ? ? ? ? ? ? ? Secret Events
? ? secret-get-value ? ? ? ? ? ? ? secret 值輸出
? ? secret-list ? ? ? ? ? ? ? ? ? ?列出 secret
? ? secret-set-value ? ? ? ? ? ? ? 設(shè)定 secret 值
? ? secret-undefine ? ? ? ? ? ? ? ?取消定義 secret
?Snapshot (help keyword 'snapshot')
? ? snapshot-create ? ? ? ? ? ? ? ?使用 XML 生成快照
? ? snapshot-create-as ? ? ? ? ? ? 使用一組參數(shù)生成快照
? ? snapshot-current ? ? ? ? ? ? ? 獲取或者設(shè)定當(dāng)前快照
? ? snapshot-delete ? ? ? ? ? ? ? ?刪除域快照
? ? snapshot-dumpxml ? ? ? ? ? ? ? 為域快照轉(zhuǎn)儲 XML
? ? snapshot-edit ? ? ? ? ? ? ? ? ?編輯快照 XML
? ? snapshot-info ? ? ? ? ? ? ? ? ?快照信息
? ? snapshot-list ? ? ? ? ? ? ? ? ?為域列出快照
? ? snapshot-parent ? ? ? ? ? ? ? ?獲取快照的上級快照名稱
? ? snapshot-revert ? ? ? ? ? ? ? ?將域轉(zhuǎn)換為快照
?Storage Pool (help keyword 'pool')
? ? find-storage-pool-sources-as ? 找到潛在存儲池源
? ? find-storage-pool-sources ? ? ?發(fā)現(xiàn)潛在存儲池源
? ? pool-autostart ? ? ? ? ? ? ? ? 自動啟動某個池
? ? pool-build ? ? ? ? ? ? ? ? ? ? 建立池
? ? pool-create-as ? ? ? ? ? ? ? ? 從一組變量中創(chuàng)建一個池
? ? pool-create ? ? ? ? ? ? ? ? ? ?從一個 XML 文件中創(chuàng)建一個池
? ? pool-define-as ? ? ? ? ? ? ? ? 在一組變量中定義池
? ? pool-define ? ? ? ? ? ? ? ? ? ?define an inactive persistent storage pool or modify an existing persistent one from an XML file
? ? pool-delete ? ? ? ? ? ? ? ? ? ?刪除池
? ? pool-destroy ? ? ? ? ? ? ? ? ? 銷毀(刪除)池
? ? pool-dumpxml ? ? ? ? ? ? ? ? ? XML 中的池信息
? ? pool-edit ? ? ? ? ? ? ? ? ? ? ?為存儲池編輯 XML 配置
? ? pool-info ? ? ? ? ? ? ? ? ? ? ?存儲池信息
? ? pool-list ? ? ? ? ? ? ? ? ? ? ?列出池
? ? pool-name ? ? ? ? ? ? ? ? ? ? ?將池 UUID 轉(zhuǎn)換為池名稱
? ? pool-refresh ? ? ? ? ? ? ? ? ? 刷新池
? ? pool-start ? ? ? ? ? ? ? ? ? ? 啟動一個(以前定義的)非活躍的池
? ? pool-undefine ? ? ? ? ? ? ? ? ?取消定義一個不活躍的池
? ? pool-uuid ? ? ? ? ? ? ? ? ? ? ?把一個池名稱轉(zhuǎn)換為池 UUID
? ? pool-event ? ? ? ? ? ? ? ? ? ? Storage Pool Events
?Storage Volume (help keyword 'volume')
? ? vol-clone ? ? ? ? ? ? ? ? ? ? ?克隆卷。
? ? vol-create-as ? ? ? ? ? ? ? ? ?從一組變量中創(chuàng)建卷
? ? vol-create ? ? ? ? ? ? ? ? ? ? 從一個 XML 文件創(chuàng)建一個卷
? ? vol-create-from ? ? ? ? ? ? ? ?生成卷,使用另一個卷作為輸入。
? ? vol-delete ? ? ? ? ? ? ? ? ? ? 刪除卷
? ? vol-download ? ? ? ? ? ? ? ? ? 將卷內(nèi)容下載到文件中
? ? vol-dumpxml ? ? ? ? ? ? ? ? ? ?XML 中的卷信息
? ? vol-info ? ? ? ? ? ? ? ? ? ? ? 存儲卷信息
? ? vol-key ? ? ? ? ? ? ? ? ? ? ? ?為給定密鑰或者路徑返回卷密鑰
? ? vol-list ? ? ? ? ? ? ? ? ? ? ? 列出卷
? ? vol-name ? ? ? ? ? ? ? ? ? ? ? 為給定密鑰或者路徑返回卷名
? ? vol-path ? ? ? ? ? ? ? ? ? ? ? 為給定密鑰或者路徑返回卷路徑
? ? vol-pool ? ? ? ? ? ? ? ? ? ? ? 為給定密鑰或者路徑返回存儲池
? ? vol-resize ? ? ? ? ? ? ? ? ? ? 創(chuàng)新定義卷大小
? ? vol-upload ? ? ? ? ? ? ? ? ? ? 將文件內(nèi)容上傳到卷中
? ? vol-wipe ? ? ? ? ? ? ? ? ? ? ? 擦除卷
?Virsh itself (help keyword 'virsh')
? ? cd ? ? ? ? ? ? ? ? ? ? ? ? ? ? 更改當(dāng)前目錄
? ? echo ? ? ? ? ? ? ? ? ? ? ? ? ? echo 參數(shù)
? ? exit ? ? ? ? ? ? ? ? ? ? ? ? ? 退出這個非交互式終端
? ? help ? ? ? ? ? ? ? ? ? ? ? ? ? 打印幫助
? ? pwd ? ? ? ? ? ? ? ? ? ? ? ? ? ?輸出當(dāng)前目錄
? ? quit ? ? ? ? ? ? ? ? ? ? ? ? ? 退出這個非交互式終端
? ? connect ? ? ? ? ? ? ? ? ? ? ? ?連接(重新連接)到 hypervisor
? (指定 help <group> 獲取組中命令的詳情)
? (使用 --help <command> 來獲得這個命令的詳細(xì)信息)
查看 KVM 的配置文件存放目錄
查看虛擬機狀態(tài)
centos7.0 就是我們剛才安裝的虛擬機
關(guān)閉虛擬機
開啟虛擬機
強制關(guān)閉
這個時候,我們再看一下狀態(tài):
通過配置文件啟動虛擬機系統(tǒng)
看狀態(tài)
掛起虛擬機
看一下狀態(tài)
配置虛擬機實例伴隨宿主機自動啟動
恢復(fù)虛擬機
導(dǎo)出虛擬機配置
把centos7.0 的配置放到centos7.1 里面
看現(xiàn)在的配置文件
刪除虛擬機
這是的centos7.0 的配置文件已經(jīng)沒有了
現(xiàn)在沒有運行的虛擬機
進入到配置文件目錄
進行配置文件的重命名
重新定義
看現(xiàn)在的狀態(tài)
修改虛擬機配置信息(用來修改系統(tǒng)內(nèi)存大小、磁盤文件等信息)
直接通過 vim 命令修改:
或者這樣也可以
相當(dāng)于編輯上面的配置文件
安裝一下這個東西
var/lib/libvirt/images/: 這是我們放鏡像的地方
大家在做的時候看自己的情況
查看當(dāng)前磁盤格式
在宿主機上查看kvm虛擬機centos7.0 的dns地址
查看虛擬機狀態(tài)
看狀態(tài)
克隆一個機器
再看一下狀態(tài),發(fā)現(xiàn)有centos7.1
開啟這個圖centos7.1
生成快照(理解成VMware的快照)
查看虛擬機快照的版本信息
[root@localhost ~]# virsh ?snapshot-current centos7.0
<domainsnapshot>
? <name>1656584049</name>
? <state>shutoff</state>
? <creationTime>1656584049</creationTime>
? <memory snapshot='no'/>
? <disks>
? ? <disk name='vda' snapshot='internal'/>
? ? <disk name='hda' snapshot='no'/>
? </disks>
? <domain type='kvm'>
? ? <name>centos7.0</name>
? ? <uuid>8f9cd4d6-a1d1-4296-bf6e-379682af6b05</uuid>
? ? <memory unit='KiB'>1048576</memory>
? ? <currentMemory unit='KiB'>1048576</currentMemory>
? ? <vcpu placement='static'>1</vcpu>
? ? <resource>
? ? ? <partition>/machine</partition>
? ? </resource>
? ? <os>
? ? ? <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
? ? </os>
? ? <features>
? ? ? <acpi/>
? ? ? <apic/>
? ? </features>
? ? <cpu mode='custom' match='exact' check='full'>
? ? ? <model fallback='forbid'>Broadwell-IBRS</model>
? ? ? <feature policy='disable' name='md-clear'/>
? ? ? <feature policy='disable' name='ssbd'/>
? ? ? <feature policy='disable' name='hle'/>
? ? ? <feature policy='disable' name='rtm'/>
? ? ? <feature policy='require' name='spec-ctrl'/>
? ? ? <feature policy='require' name='hypervisor'/>
? ? ? <feature policy='require' name='xsaveopt'/>
? ? </cpu>
? ? <clock offset='utc'>
? ? ? <timer name='rtc' tickpolicy='catchup'/>
? ? ? <timer name='pit' tickpolicy='delay'/>
? ? ? <timer name='hpet' present='no'/>
? ? </clock>
? ? <on_poweroff>destroy</on_poweroff>
? ? <on_reboot>restart</on_reboot>
? ? <on_crash>destroy</on_crash>
? ? <pm>
? ? ? <suspend-to-mem enabled='no'/>
? ? ? <suspend-to-disk enabled='no'/>
? ? </pm>
? ? <devices>
? ? ? <emulator>/usr/libexec/qemu-kvm</emulator>
? ? ? <disk type='file' device='disk'>
? ? ? ? <driver name='qemu' type='qcow2'/>
? ? ? ? <source file='/var/lib/libvirt/images/centos7.0.qcow2'/>
? ? ? ? <target dev='vda' bus='virtio'/>
? ? ? ? <boot order='1'/>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
? ? ? </disk>
? ? ? <disk type='file' device='cdrom'>
? ? ? ? <driver name='qemu' type='raw'/>
? ? ? ? <target dev='hda' bus='ide'/>
? ? ? ? <readonly/>
? ? ? ? <boot order='2'/>
? ? ? ? <address type='drive' controller='0' bus='0' target='0' unit='0'/>
? ? ? </disk>
? ? ? <controller type='usb' index='0' model='ich9-ehci1'>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
? ? ? </controller>
? ? ? <controller type='usb' index='0' model='ich9-uhci1'>
? ? ? ? <master startport='0'/>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
? ? ? </controller>
? ? ? <controller type='usb' index='0' model='ich9-uhci2'>
? ? ? ? <master startport='2'/>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
? ? ? </controller>
? ? ? <controller type='usb' index='0' model='ich9-uhci3'>
? ? ? ? <master startport='4'/>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
? ? ? </controller>
? ? ? <controller type='ide' index='0'>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
? ? ? </controller>
? ? ? <controller type='virtio-serial' index='0'>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
? ? ? </controller>
? ? ? <controller type='pci' index='0' model='pci-root'/>
? ? ? <interface type='network'>
? ? ? ? <mac address='52:54:00:8d:e0:b0'/>
? ? ? ? <source network='default'/>
? ? ? ? <model type='virtio'/>
? ? ? ? <boot order='3'/>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
? ? ? </interface>
? ? ? <serial type='pty'>
? ? ? ? <target type='isa-serial' port='0'>
? ? ? ? ? <model name='isa-serial'/>
? ? ? ? </target>
? ? ? </serial>
? ? ? <console type='pty'>
? ? ? ? <target type='serial' port='0'/>
? ? ? </console>
? ? ? <channel type='unix'>
? ? ? ? <target type='virtio' name='org.qemu.guest_agent.0'/>
? ? ? ? <address type='virtio-serial' controller='0' bus='0' port='1'/>
? ? ? </channel>
? ? ? <channel type='spicevmc'>
? ? ? ? <target type='virtio' name='com.redhat.spice.0'/>
? ? ? ? <address type='virtio-serial' controller='0' bus='0' port='2'/>
? ? ? </channel>
? ? ? <input type='tablet' bus='usb'>
? ? ? ? <address type='usb' bus='0' port='1'/>
? ? ? </input>
? ? ? <input type='mouse' bus='ps2'/>
? ? ? <input type='keyboard' bus='ps2'/>
? ? ? <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'>
? ? ? ? <listen type='address' address='127.0.0.1'/>
? ? ? </graphics>
? ? ? <sound model='ich6'>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
? ? ? </sound>
? ? ? <video>
? ? ? ? <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
? ? ? </video>
? ? ? <redirdev bus='usb' type='spicevmc'>
? ? ? ? <address type='usb' bus='0' port='2'/>
? ? ? </redirdev>
? ? ? <redirdev bus='usb' type='spicevmc'>
? ? ? ? <address type='usb' bus='0' port='3'/>
? ? ? </redirdev>
? ? ? <memballoon model='virtio'>
? ? ? ? <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
? ? ? </memballoon>
? ? </devices>
? ? <seclabel type='dynamic' model='selinux' relabel='yes'/>
? ? <seclabel type='dynamic' model='dac' relabel='yes'/>
? </domain>
</domainsnapshot>
查看快照時間
創(chuàng)建新的快照
查看快照時間
[root@localhost ~]# virsh snapshot-list centos7.0
?名稱 ? ? ? ? ? ? ? 生成時間 ? ? ? ? ? ? ?狀態(tài)
------------------------------------------------------------
?1656584049 ? ? ? ? ? 2024-11-20?18:14:09 +0800 shutoff
?1656584521 ? ? ? ? ? 2024-11-20 18:22:01 +0800 shutoff
切換原先的狀態(tài)
看信息
好了,有關(guān)于centos7安裝部署kvm 以及kvm的基本操作就到這里了,謝謝大家!
注意:本文來源于?centos7安裝部署kvm,照做就行_centos kvm-CSDN博客