summaryrefslogtreecommitdiffstats
path: root/website/src/learning/start-vm-with-virt-manager/index.html
blob: 2fcfc51309e4d1489237e8f62e87523277b97da8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
[% topdir = "../.." -%]
[% PROCESS globals -%]
[% WRAPPER page
   title = "Starting and stopping virtual machines with virt-manager"
   h1 = "Starting and stopping virtual machines with virt-manager"
   section = "learning"
%]

<p>
In principle, <q>lifecycle management</q> (which is a fancy way of
saying <q>starting and stopping virtual machines</q>) is quite easy.
</p>

[% WRAPPER h2 h2="Starting the virtual machine" anchor="start" %]

<p>
To start a virtual machine running, select it from the list and either
press the <q>play</q> button or right click and select <q>Run</q>:
</p>

<p>
<img src="run.png" width="312" height="315"
  longdesc="Screenshot showing the right button popup menu in virt-manager" />
</p>

<p>
When the virtual machine is running, two things will change.  You
will get a small graph showing the CPU usage in the main virt-manager
window.  And if you double click on the virtual machine, virt-manager
will open another window showing you the console:
</p>

<p>
<img src="debian.png" width="946" height="677"
  longdesc="Screenshot showing virtual machine running" />
</p>

[% END %]

[% WRAPPER h2 h2="Stopping the virtual machine" anchor="stop" %]

<p>
Stopping the virtual machine is a little more complex and requires
some understanding of how real PC hardware works.
</p>

<h3>Force off</h3>

<p>
On a real PC you can just pull out the power cord (and battery
if it's a laptop).  This abruptly shuts the machine down, but
it's not usually a good thing to do since the operating system
gets no time to gracefully shut down applications and synchronize
the disk.
</p>

<p>
Nevertheless virt-manager lets you do this: From the <q>switch</q>
menu select <q>Force Off</q>:
</p>

<p>
<img src="force-off.png" width="310" height="193"
  longdesc="Screenshot showing force-off option in virt-manager" />
</p>

<h3>ACPI</h3>

<p>
The other two options on this menu are <q>Reboot</q> and
<q>Shut Down</q>.  However you cannot reboot or shut down
a machine (real or virtual) without cooperation from the
operating system.  On a real PC the power switch just sends
a signal to the operating system, and the operating system
has to be listening out for the signal and has to react
by doing the right thing.  This signal mechanism
is known as
<a href="http://en.wikipedia.org/wiki/ACPI">ACPI</a>.
The same mechanism is used to <q>wire</q> the virtual power
switch to the virtual machine.
</p>

<p>
This is why pressing the virtual power button may
open a dialog inside the VM like this one (taken
from an Ubuntu guest):
</p>

<p>
<img src="ubuntu-power-dlg.png" width="532" height="450"
  longdesc="Ubuntu power dialog" />
</p>

<p>
The precise action taken depends on:
</p>

<ul>
<li> the guest </li>
<li> how the guest has been configured to react to ACPI events </li>
<li> if the guest is listening to ACPI at all
  (it may require that an ACPI daemon is started) </li>
<li> whether the guest is listening or has crashed, is busy &amp;c. </li>
</ul>

<p>
If a guest won't shut down or reboot, it is usually caused
by a problem with ACPI and/or guest configuration.  Eventually
you may need to use the <q>Force Off</q> option on recalcitrant
guests.
</p>

[% END %]

[% END -%]