summaryrefslogtreecommitdiffstats
path: root/wiki/src/doc/advanced_topics/virtualization/virt-manager.mdwn
blob: de484e99254fb608342f39b805317730ec6e916a (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
[[!meta title="virt-manager"]]

[<span class="application">virt-manager</span>](http://virt-manager.org/) is a free software
virtualization solution for Linux. *virt-manager* has a more complex
interface than *VirtualBox* or *GNOME Boxes* but it also has a more
complete set of features.

[[!inline pages="doc/advanced_topics/virtualization.caution" raw="yes" sort="age"]]

<div class="tip">

<span class="application">virt-manager</span> is the only virtualization
solution that we present that allows the use of a persistent
volume.</span>

</div>

<div class="note">

<p>The following instructions have been tested on Debian Stretch.</p>

</div>

[[!toc]]

Terminology
===========

*virt-manager* is based on a set of lower level virtualization tools,
going from the user interface to the hardware interactions with the
processor. This terminology is a bit confusing and other documentation
might mention the following tools:

  - *KVM* is the module of the Linux kernel that interacts with the
    virtualization features of the processor.
  - *QEMU* is the virtualization software that emulates virtual
    processors and peripherals based on *KVM* and that starts and stops
    virtual machines.
  - *libvirt* is a library that allows *virt-manager* to interact with
    the virtualization capabilities provided by *QEMU*.
  - *SPICE* is a protocol that allows to visualize the desktop of
    virtual machines.
  - *virt-manager* is the graphical interface that allows to create,
    configure, and run virtual machines.

<a id="iso"></a>

Installation
============

To install *virt-manager* in Debian, execute the following
command:

    sudo apt install virt-manager libvirt-daemon-system

To install *virt-manager* in Ubuntu, execute the following
command:

    sudo apt install virt-manager libvirt-bin qemu-kvm

Running Tails from an ISO image
===============================

  1. Start *virt-manager*.
  1. Double-click on **localhost (QEMU)** to connect to the *QEMU*
     system of your host.
  1. To create a new virtual machine, choose
     <span class="menuchoice"> <span
     class="guimenu">File</span>&nbsp;▸ <span
     class="guimenuitem">New Virtual Machine</span></span>.
  1. In *step 1*, choose **Local install media (ISO image or CDROM)**.
  1. In *step 2*, choose:
     - **Use ISO image**, then **Browse...**, and **Browse Local** to
       browse for the ISO image that you want to start from.
     - **OS type**: **Linux**.
     - **Version**: **Debian Stretch**.
  1. In *step 3*, allocate at least 2048 MB of RAM.
  1. In *step 4*, disable storage for this virtual machine.
  1. In *step 5*:
     - Type a name for the new virtual machine.
     - Click **Finish** to start the virtual machine.

<div class="tip">

If you get the error message "<span class="guilabel">Error starting
domain: Requested operation is not valid: network 'default' is not
active</span>", then try to start the default virtual network:

<ol>
<li>Click on <span class="guilabel">localhost (QEMU)</span>.</li>
<li>Choose <span class="menuchoice">
    <span class="guimenu">Edit</span>&nbsp;▸
    <span class="guimenuitem">Connection details</span></span> to
    administer the connection to your local
    <span class="application">QEMU</span> system.</li>
<li>Click on <span class="guilabel">Virtual Networks</span> tab, then
    select the <span class="guilabel">default</span> virtual network in
    the left pane.</li>
<li>Click on the [[!img media-playback-start.png alt="Start Network"
    link=no class=symbolic]] icon on the bottom of the left pane to
    start the default virtual network.</li>
</ol>

</div>

<a id="usb_image"></a>

Running Tails from a USB image
========================================

You can also run Tails from the USB image, which allows you to create a
persistent volume on it.

Before you can run the Tails USB image in a virtual machine, you have to
increase its size so that Tails can download and apply updates and create
a persistent volume. You can do this with the following command:

    truncate -s 7200M tails-amd64-*.img

The size has to be *at least* 7200 MiB, else Tails won't boot because the
device is considered too small.

To run the resulting Tails USB image using *virt-manager*:

  1. Start *virt-manager*.
  1. Double-click on **localhost (QEMU)** to connect to the *QEMU*
     system of your host.
  1. To create a new virtual machine, choose
     <span class="menuchoice"> <span
     class="guimenu">File</span>&nbsp;▸ <span
     class="guimenuitem">New Virtual Machine</span></span>.
  1. In *step 1*, choose **Import existing disk image**.
  1. In *step 2*, choose **Browse...**, and **Browse Local** to
       browse for the USB image that you want to start from.
     As operating system, choose **Debian Stretch** or **Generic default**.
  1. In *step 3*, allocate at least 2048 MB of RAM.
  1. In *step 4*:
     - Type a name for the new virtual machine.
     - Choose **Customize configuration before install**
     - Click **Finish** to open the configuration view.
  1. In the **configuration view**, choose **VirtIO Disk 1** or **IDE Disk 1**
     - Expand the **Advanced options** and set **Disk bus** to **USB**.
     - Click **Apply**.
     - Check the **Removable** check box which should appear in the same view.
     - Click **Apply** again.
     - Click **Begin Installation** in the top left corner to start the virtual machine.

Once you started from the USB image you can [[create a persistent
volume|first_steps/persistence/configure]] on it.

<a id="usb"></a>

Running Tails from a USB stick
==============================

To run Tails from a USB stick using *virt-manager*, first
create a virtual machine running from an ISO image as described
[[above|virt-manager#iso]].

Then do the following:

  1. From the virtual machine window, choose
     <span class="menuchoice">
     <span class="guimenu">Virtual Machine</span>&nbsp;▸
     <span class="guisubmenuitem">Shut Down</span>&nbsp;▸
     <span class="guimenuitem">Force Off</span></span> to shut down the
     virtual machine.
  1. Plug in the USB stick from which you want to run Tails.
  1. Choose
     <span class="menuchoice">
     <span class="guimenu">View</span>&nbsp;▸
     <span class="guimenuitem">Details</span></span> to edit the
     configuration of the virtual machine.
  1. Click on the **Add Hardware** button on the bottom of the left
     pane.
  1. Select **USB Host Device** in the left pane.
  1. In the right pane, click on the device from which you want to run
     Tails, and click **Finish**.

You can keep the original ISO image connected as a virtual DVD to
install Tails onto the USB stick if needed.

<a id="disconnect"></a>

You can also disconnect the original ISO image and start directly from the
USB stick once Tails is already installed on it. To do so:

  1. Shut down the virtual machine.
  1. In the configuration of the virtual machine, click on **IDE CDROM
     1** in the left pane.
  1. Click on the **Disconnect** button in the right pane.
  1. To enable the USB stick as a boot option:
     1. Click on **Boot Options** in the left pane.
     1. Select the **USB** boot option corresponding to your USB device.
     1. Click **Apply**.
  1. To start the virtual machine choose
     <span class="menuchoice">
     <span class="guimenu">View</span>&nbsp;▸
     <span class="guimenuitem">Console</span></span> and then
     <span class="menuchoice">
     <span class="guimenu">Virtual Machine</span>&nbsp;▸
     <span class="guimenuitem">Run</span></span>.

Once you started from the USB device you can [[create a persistent
volume|first_steps/persistence/configure]] on it.

# Troubleshooting

<a id="graphics-issues"></a>

## Graphics issues

Issues with graphics support in Tails running inside a virtual machine
with *virt-manager* are common. The best solution can vary depending
on the version of the virtualization solution and on the virtual
machine configuration. For example:

 - The *Auto resize VM with window* feature does not work in all
   configurations.
 - The video device that provides optimal graphics performance can be
   different depending on the version of the host operating system.

To troubleshoot such issues:

1. Ensure the virtual machine has a *Spice* display and a *Spice*
   channel configured, as opposed to *VNC* ones.

2. Try various virtual video device models.

   Start with *Virtio* and *QXL* video devices: they generally give
   the best results. If they don't perform well for you, try every
   other video device model.