en	[[!meta title="virt-manager"]]

en	[*virt-manager*](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.
zh-tw	[virt-manager](http://virt-manager.org/) Linux　可用 旳虛擬器自由軟體。 *virt-manager* 的介面比 *VirtualBox* 或 *GNOME Boxes* 更為複雜 但它的功能也更為充足強大。

en	[[!inline pages="doc/advanced_topics/virtualization.caution" raw="yes" sort="age"]]
zh-tw	[[!inline pages="doc/advanced_topics/virtualization.caution.zh_TW" raw="yes" sort="age"]]

en	<div class="tip">

en	<p><i>virt-manager</i> is the only virtualization solution that allows to use a Persistent Storage. See [[running Tails from a USB image|virt-manager#usb_image]].</p>
zh-tw	<span class="application">virt-manager</span> 是唯一的可 使用永久磁區的虛擬器 方案。</span>

en	</div>

en	<div class="note">

en	The following instructions have been tested on Debian 12 (Bookworm).
zh-tw	以下的指示已經過 Debian Stretch 環境測試

en	Terminology
zh-tw	術語

en	*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:
zh-tw	*virt-manager* 是一組低階的虛擬工具， 其包含用戶介面到與處理器之間的 互動作用。這個術語聽來令人迷惑而其它的文件 可能會提到以下的工具：

en	*KVM* is the module of the Linux kernel that interacts with the virtualization features of the processor.
zh-tw	*KVM* 是 Linux kernel 核心模組用在與處理器虛擬功能上的互動。

en	*QEMU* is the virtualization software that emulates virtual processors and peripherals based on *KVM* and that starts and stops virtual machines.
zh-tw	*QEMU* 為一套虛擬軟體可模擬虛擬處理器和基於 *KVM* 的週邊設備，它用來啟動與停止虛擬器。

en	*libvirt* is a library that allows *virt-manager* to interact with the virtualization capabilities provided by *QEMU*.
zh-tw	*libvirt* 是一個資源庫可讓 *virt-manager*　和 *QEMU* 的虛擬效能進行互動。

en	*SPICE* is a protocol that allows to visualize the desktop of virtual machines.
zh-tw	*SPICE* 協議可以虛擬化虛擬器的桌面環境。

en	*virt-manager* is the graphical interface that allows to create, configure, and run virtual machines.
zh-tw	*virt-manager* 是一個圖形介面可用來建立、設定和執行虛擬器。

en	Installation

en	To install *virt-manager* in Debian, execute the following command:
zh-tw	欲在 Debian 下安裝 *virt-manager*，請執行以下指令：

en	sudo apt install virt-manager libvirt-daemon-system

en	To install *virt-manager* in Ubuntu, execute the following command:
zh-tw	要在 Ubutun 下安裝 *virt-manager* ，請執行以下指令：

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

en	Running Tails from an ISO image
zh-tw	從虛擬 USB 儲存來執行 Tails

en	[[Download Tails as an ISO image|install/download-iso]], instead of a USB image.

en	Start *virt-manager*.
zh-tw	啟用 *virt-manager*。

en	Double-click on **QEMU/KVM - Not Connected** to connect to the *QEMU* system of your host.

en	To create a new virtual machine, choose <span class="menuchoice"> <span class="guimenu">File</span>&nbsp;▸ <span class="guimenuitem">New Virtual Machine</span></span>.
zh-tw	選擇<span class="menuchoice"> <span class="guimenu">View</span>&nbsp;▸ <span class="guimenuitem">Details</span></span>以編輯虛擬器的設定。

en	In *step 1*, choose **Local install media (ISO image or CDROM)**.

en	In *step 2*:

en	**Choose ISO image**, then **Browse...**, and **Browse Local** to browse for the ISO image that you want to start from.

en	Unselect **Automatically detected from the installation media / source**.

en	Specify **Debian 11** in the field **Choose the operating system you are installing**.

en	In *step 3*, allocate at least 2048 MB of RAM.

en	In *step 4*, unselect **Enable storage for this virtual machine**.
zh-tw	關閉虛擬器。

en	In *step 5*:

en	Type a name of your choice for the new virtual machine.
zh-tw	關閉虛擬器。

en	Click **Finish** to start the virtual machine.
zh-tw	關閉虛擬器。

en	If you get the error message "Error starting domain: Requested operation is not valid: network 'default' is not active", then try to start the default virtual network:
zh-tw	如果看到錯誤訊息 "Error starting domain: Requested operation is not valid: network 'default' is not active"，那麼請打開默認的虛擬網路：

en	<ol> <li>Click on <span class="guilabel">QEMU/KVM - Not Connected</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 lib/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>
zh-tw	<ol> <li>點選 <span class="guilabel">localhost (QEMU)</span>。</li> <li>選取 <span class="menuchoice"> <span class="guimenu">Edit</span>&nbsp;▸ <span class="guimenuitem">Connection details</span></span> 來 本地<span class="application">QEMU</span> </li> 　系統的連接。 <li>點選 <span class="guilabel">Virtual Networks</span> 分頁，再 由左側面板 　挑選<span class="guilabel">default</span> virtual network</li> <li>在左側面板下方 　點選 [[!img media-playback-start.png alt="Start Network" link=no class=symbolic]] 圖示 以啟動預設的虛擬器。</li> </ol>

en	Running Tails from a USB image
zh-tw	從虛擬 USB 儲存來執行 Tails

en	Running Tails from a USB image is the only virtualization software that allows you to use a Persistent Storage in a virtual machine.
zh-tw	<span class="application">virt-manager</span> 是唯一的可 使用永久磁區的虛擬器 方案。</span>

en	[[Download Tails as a USB image|install/download]], instead of an ISO image.

en	Increase the size of the USB image to be at least 8 GB. This creates space for automatic upgrades and the Persistent Storage.

en	truncate -s size tails.img

en	size has to be at least `7200M`.

en	tails.img is the file name of the USB image that you want to resize.

en	In *step 1*, choose **Import existing disk image**.

en	Choose **Browse...**, and **Browse Local** to browse for the USB image that you want to start from.

en	In *step 4*:

en	Choose **Customize configuration before install**.

en	Click **Finish** to open the configuration view.
zh-tw	關閉虛擬器。

en	In the configuration view, choose **VirtIO Disk 1** or **IDE Disk 1**

en	Set **Disk bus** to **USB**.

en	Click **Apply**.

en	Expand the **Advanced options**.

en	Enable **Removable**.

en	Click **Apply** again.

en	Click **Begin Installation** in the top left corner to start the virtual machine.
zh-tw	關閉虛擬器。

en	After you start on the USB image, you can [[create a Persistent Storage|persistent_storage]] on it.
zh-tw	自USB 設備啟動後，可以用它來[[建立一個永久磁區|first_steps/persistence/configure]] 。

en	Running Tails from a USB stick
zh-tw	從虛擬 USB 儲存來執行 Tails

en	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]].
zh-tw	要來虛擬 USB 設備使用*virt-manager*來執行 Tails，請先依 [[之前|virt-manager#iso]] 的介紹從 ISO 映像檔來建立一個虛擬器。

en	Then do the following:
zh-tw	接著進行以下動作：

en	From the virtual machine window, choose **Virtual Machine**&nbsp;▸ **Shut Down**&nbsp;▸ **Force Off** to shut down the virtual machine.
zh-tw	由虛擬器視窗下，選擇<span class="menuchoice"> <span class="guimenu">Virtual Machine</span>&nbsp;▸ <span class="guisubmenuitem">Shut Down</span>&nbsp;▸ <span class="guimenuitem">Force Off</span></span> 來關閉虛擬器。

en	Plug in the USB stick from which you want to run Tails.
zh-tw	在右側面板中選取用於執行 Tails 的設備然後按 **Finish**。

en	Choose **View**&nbsp;▸ **Details** to edit the configuration of the virtual machine.
zh-tw	選擇<span class="menuchoice"> <span class="guimenu">View</span>&nbsp;▸ <span class="guimenuitem">Details</span></span>以編輯虛擬器的設定。

en	Click on the **Add Hardware** button on the bottom of the left pane.
zh-tw	在左側面板下方選取 **Add Hardware**按鍵。

en	Select **USB Host Device** in the left pane.
zh-tw	在左側面板選取 **USB Host Device**。

en	In the right pane, click on the device from which you want to run Tails, and click **Finish**.
zh-tw	在右側面板中選取用於執行 Tails 的設備然後按 **Finish**。

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

en	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:
zh-tw	也可以切斷 ISO 映像檔，直接利用已安裝 Tails 的 USB 隨身碟來開機，其方式為：

en	Shut down the virtual machine.
zh-tw	關閉虛擬器。

en	In the configuration of the virtual machine, click on **SATA CDROM 1** in the left pane.

en	Click on the **Disconnect** button in the right pane.
zh-tw	在左側面板下方選取 **Add Hardware**按鍵。

en	To enable the USB stick as a boot option:

en	Click on **Boot Options** in the left pane.
zh-tw	在左側面板中選取 **USB Disk 1**。

en	Select the **USB** boot option corresponding to your USB device.

en	To start the virtual machine choose **View**&nbsp;▸ **Console** and then **Virtual Machine**&nbsp;▸ **Run**.

en	After you start on the USB device, you can [[create a Persistent Storage|persistent_storage]] on it.
zh-tw	自USB 設備啟動後，可以用它來[[建立一個永久磁區|first_steps/persistence/configure]] 。

en	Troubleshooting

en	Graphics issues

en	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 software and on the virtual machine configuration. For example:

en	The *Auto resize VM with window* feature does not work in all configurations.

en	The video device that provides optimal graphics performance can be different depending on the version of the host operating system.

en	To troubleshoot such issues:

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

en	Try various virtual video device models.

en	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.

en	Try enabling or disabling the OpenGL and 3D acceleration options of the display and video device.