linux:qemu-kvm:virsh

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:qemu-kvm:virsh [2022/08/30 04:26] – [CPU モデルの表示] ともやんlinux:qemu-kvm:virsh [2023/09/07 09:16] (現在) ともやん
行 1: 行 1:
 ====== virsh による仮想マシンの操作 ====== ====== virsh による仮想マシンの操作 ======
 +
 ===== ゲストの一覧表示 ===== ===== ゲストの一覧表示 =====
-<code+<WRAP color_term
-$ sudo virsh list --all+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh list <b class=HIK>--all</b> 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
  Id    名前                         状態  Id    名前                         状態
 ---------------------------------------------------- ----------------------------------------------------
行 9: 行 13:
      Fedora_17_x86_64_001           シャットオフ      Fedora_17_x86_64_001           シャットオフ
  
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの自動起動 ===== ===== ゲストの自動起動 =====
- +<WRAP color_term> 
-<code+<WRAP color_command><html><pre
-$ sudo virsh autostart CentOS_6_x86_64_001 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh autostart CentOS_6_x86_64_001  
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 が自動起動に設定されました ドメイン CentOS_6_x86_64_001 が自動起動に設定されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの自動起動解除 ===== ===== ゲストの自動起動解除 =====
-<code+<WRAP color_term
-$ sudo virsh autostart --disable CentOS_6_x86_64_001 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh autostart <b class=HIK>--disable</b> CentOS_6_x86_64_001  
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 が自動起動設定が解除されました ドメイン CentOS_6_x86_64_001 が自動起動設定が解除されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの起動 ===== ===== ゲストの起動 =====
-<code+<WRAP color_term
-$ sudo virsh start CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh start CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 が起動されました ドメイン CentOS_6_x86_64_001 が起動されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの休止 ===== ===== ゲストの休止 =====
-<code+<WRAP color_term
-$ sudo virsh suspend CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh suspend CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 は一時停止されました ドメイン CentOS_6_x86_64_001 は一時停止されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの復帰 ===== ===== ゲストの復帰 =====
-<code+<WRAP color_term
-$ sudo virsh resume CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh resume CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 が再開されました ドメイン CentOS_6_x86_64_001 が再開されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの状態を保存して停止 ===== ===== ゲストの状態を保存して停止 =====
-<code+<WRAP color_term
-$ sudo virsh save CentOS_6_x86_64_001 savefile +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh save CentOS_6_x86_64_001 savefile 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 が savefile に保存されました ドメイン CentOS_6_x86_64_001 が savefile に保存されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストを保存ファイルから復帰 ===== ===== ゲストを保存ファイルから復帰 =====
-<code+<WRAP color_term
-$ sudo virsh restore savefile+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh restore savefile 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメインが savefile から復元されました ドメインが savefile から復元されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストのシャットダウン ===== ===== ゲストのシャットダウン =====
-<code+<WRAP color_term
-$ sudo virsh shutdown CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh shutdown CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 をシャットダウンしています ドメイン CentOS_6_x86_64_001 をシャットダウンしています
-</code+</pre></html></WRAP
 +</WRAP>
  
 ===== ゲストの再起動 ===== ===== ゲストの再起動 =====
-<code+<WRAP color_term
-$ sudo virsh reboot CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh reboot CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 を再起動しています ドメイン CentOS_6_x86_64_001 を再起動しています
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ゲストの強制停止 ===== ===== ゲストの強制停止 =====
-<code+<WRAP color_term
-$ sudo virsh destroy CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh destroy CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 ドメイン CentOS_6_x86_64_001 は強制停止されました ドメイン CentOS_6_x86_64_001 は強制停止されました
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ドメインのディスプレイ接続URI ===== ===== ドメインのディスプレイ接続URI =====
-<code+<WRAP color_term
-$ sudo virsh domdisplay CentOS_6_x86_64_001+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> virsh domdisplay CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 spice://localhost:5906 spice://localhost:5906
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
 ===== ドメインの編集 ===== ===== ドメインの編集 =====
-<code+<WRAP color_term
-$ sudo virsh edit CentOS_6_x86_64_001 +<WRAP color_command><html><pre> 
-</code>+<b class=GRN>$</b> <b class=HIY>sudo</b> virsh edit CentOS_6_x86_64_001 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +</pre></html></WRAP> 
 +</WRAP> 
  
 ==== ハイパーバイザーの変更 ==== ==== ハイパーバイザーの変更 ====
 kvm -> qemu kvm -> qemu
-<code xml>+<WRAP color_term> 
 +<WRAP color_mincode><code xml>
 <domain type='kvm'> <domain type='kvm'>
   <name>CentOS</name>   <name>CentOS</name>
行 97: 行 149:
   <uuid>bb538efe-0218-4be1-ac29-fc74138dcf85</uuid>   <uuid>bb538efe-0218-4be1-ac29-fc74138dcf85</uuid>
   <memory unit='KiB'>2097152</memory>   <memory unit='KiB'>2097152</memory>
-</code>+</code></WRAP> 
 +</WRAP>
  
 ===== CPU モデルの表示 [cpu-models] ===== ===== CPU モデルの表示 [cpu-models] =====
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ virsh cpu-models x86_64+<b class=GRN>$</b> <b class=HIY>virsh</b> cpu-models x86_64
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result_long><html><pre> <WRAP color_result_long><html><pre>
行 169: 行 222:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ virsh help+<b class=GRN>$</b> <b class=HIY>virsh</b> help
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result_long><html><pre> <WRAP color_result_long><html><pre>
  • linux/qemu-kvm/virsh.1661801192.txt.gz
  • 最終更新: 2022/08/30 04:26
  • by ともやん