Help us understand the problem. What is going on with this article?

virt-managerとlibvirtを使う

More than 5 years have passed since last update.

install

$ sudo apt-get install virt-manager
$ sudo /etc/init.d/libvirt-bin start

必要なサービス起動設定

$ sudo update-rc.d dbus defaults
update-rc.d: warning: /etc/init.d/dbus missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/dbus ...
   /etc/rc0.d/K20dbus -> ../init.d/dbus
   /etc/rc1.d/K20dbus -> ../init.d/dbus
   /etc/rc6.d/K20dbus -> ../init.d/dbus
   /etc/rc2.d/S20dbus -> ../init.d/dbus
   /etc/rc3.d/S20dbus -> ../init.d/dbus
   /etc/rc4.d/S20dbus -> ../init.d/dbus
   /etc/rc5.d/S20dbus -> ../init.d/dbus
$ sudo update-rc.d libvirt-bin defaults
update-rc.d: warning: /etc/init.d/libvirt-bin missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/libvirt-bin ...
   /etc/rc0.d/K20libvirt-bin -> ../init.d/libvirt-bin
   /etc/rc1.d/K20libvirt-bin -> ../init.d/libvirt-bin
   /etc/rc6.d/K20libvirt-bin -> ../init.d/libvirt-bin
   /etc/rc2.d/S20libvirt-bin -> ../init.d/libvirt-bin
   /etc/rc3.d/S20libvirt-bin -> ../init.d/libvirt-bin
   /etc/rc4.d/S20libvirt-bin -> ../init.d/libvirt-bin
   /etc/rc5.d/S20libvirt-bin -> ../init.d/libvirt-bin
$ sudo reboot
$ virt-manager

libvirtコマンドで操作する方法

$ virsh -c lxc:/// destroy centos0
停止
$ virsh -c lxc:/// list --all
 Id    名前                         状態
 ----------------------------------------------------
  -     centos0                       シャットオフ
$ virsh -c lxc:/// start centos0
起動
$ virsh -c lxc:/// console centos0
コンソールに接続

Ubuntuでの注意点

sudo apt-get install -y \
 virt-manager libvirt0 libguestfs0
  • 現在のユーザをlibvirtdグループに追加
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away