Show Table of Contents
19.3. SPICE 日志文件
在对 SPICE 的连接问题进行故障排除时,SPICE 日志文件可以提供帮助。为了启用 SPICE 的故障排除功能,把日志的级别该为
debugging,然后指定日志的位置。
用于访问客户机的客户端以及客户机本身都具有 SPICE 日志文件。对于客户端一侧的日志,如果 SPICE 客户端是使用原生客户端启动的(为其下载了
console.vv 文件),请使用 remote-viewer 命令启用调试并生成日志输出。
19.3.1. Hypervisor SPICE 服务器的 SPICE 日志
表 19.3. Hypervisor SPICE 服务器的 SPICE 日志
| 日志类型 | 日志位置 | 改变日志级别: |
|---|---|---|
|
Host/Hypervisor SPICE Server
|
/var/log/libvirt/qemu/(guest_name).log
|
在主机/虚拟机管理器上运行
export SPICE_DEBUG_LEVEL=5,然后启动客户机。此变量由 QEMU 解析,在系统范围运行时将列出系统上所有虚拟机的调试信息。集群中的每一主机上都要运行此命令。此命令仅在各主机/虚拟机管理器层面上工作,而不是集群层面。
|
19.3.2. 客户机的 SPICE 日志
表 19.4. 客户机的 spice-vdagent 日志
| 日志类型 | 日志位置 | 改变日志级别: |
|---|---|---|
|
Windows 客户机
|
C:\Windows\Temp\vdagent.log
C:\Windows\Temp\vdservice.log
|
不适用
|
|
Red Hat Enterprise Linux 客户机
|
以 root 用户身份使用
journalctl。
|
若要在调试模式中运行
spice-vdagentd 服务,请以 root 用户身份创建包含以下条目的 /etc/sysconfig/spice-vdagentd 文件:SPICE_VDAGENTD_EXTRA_ARGS=”-d -d”
若要在调试模式中运行
spice-vdagent,请在命令行中运行:
$ killall - u $USER spice-vdagent $ spice-vdagent -x -d [-d] [ ∣& tee spice-vdagent.log ] |
19.3.3. 使用 console.vv 文件启动的 SPICE 客户端的 SPICE 日志
Linux 客户端机器:
- 使用
--spice-debug选项运行remote-viewer命令来启用 SPICE 故障排除(debug)功能。在提示时,输入连接 URL,例如,spice://[virtual_machine_IP]:[port]。# remote-viewer --spice-debug
- 若要利用调试参数运行 SPICE 客户端并向它传递 .vv 文件,请下载
console.vv文件,再运行remote-viewer并使用--spice-debug选项,同时指定console.vv文件的完整路径。# remote-viewer --spice-debug /path/to/console.vv
Windows 客户端机器:
- 在 virt-viewer 2.0-11.el7ev 和更高版本中,
virt-viewer.msi会安装 virt-viewer 和 debug-viewer.exe。 - 使用
spice-debug参数运行 remote-viewer 命令,再将命令指引到控制台的路径:remote-viewer --spice-debug path\to\console.vv
- 要查看日志信息,连接到虚拟机,您将会看到运行 GDB 的命令提示,它会显示标准输出和 remote-viewer 的标准错误信息。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.