Show Table of Contents
18.3. SPICE 日志文件
在对 SPICE 的连接问题进行故障排除时,SPICE 日志文件可以提供帮助。为了启用 SPICE 的故障排除功能,把日志的级别该为
debugging,然后指定日志的位置。
用来访问客户机的客户端和客户机本身都有 SPICE 日志文件。对于客户端的日志,如果 SPICE 客户端通过一个浏览器插件被启动,故障排除的功能通常是由环境变量控制的。如果 SPICE 客户端是通过原生的客户程序启动(一个
console.vv 文件会被下载),需要使用 remote-viewer 命令来启用故障排除功能并产生日志输出。
18.3.1. Hypervisor SPICE 服务器的 SPICE 日志
表 18.3. Hypervisor SPICE 服务器的 SPICE 日志
| 日志类型 | 日志位置 | 改变日志级别: |
|---|---|---|
|
Host/Hypervisor SPICE Server
|
/var/log/libvirt/qemu/(guest_name).log
|
在启动 guest 前,在 host/hypervisor 上运行
export SPICE_DEBUG_LEVEL=5。
|
18.3.2. 客户机的 SPICE 日志
表 18.4. 客户机的 SPICE 日志
| 日志类型 | 日志位置 | 改变日志级别: |
|---|---|---|
|
Windows 客户机
|
C:\Windows\Temp\vdagent.log
C:\Windows\Temp\vdservice.log
|
不适用
|
|
Red Hat Enterprise Linux 客户机
|
/var/log/spice-vdagent.log
| 创建一个带有这个项的 /etc/sysconfig/spice-vdagentd 文件: SPICE_VDAGENTD_EXTRA_ARGS=”-d -d” |
18.3.3. 使用浏览器插件启动的 SPICE 客户端的 SPICE 日志
对于使用浏览器插件启动的 SPICE 客户端,日志的位置,以及修改日志级别的方法会根据 OS 类型、OS 版本和系统类型的不同而有所不同。
表 18.5. 客户端机器(浏览器插件)的 SPICE 日志
| 日志类型 | 日志位置 | 改变日志级别: |
|---|---|---|
|
SPICE Client (Windows 7)
|
C:\Windows\Temp\spicex.log
|
|
|
SPICE Client (Red Hat Enterprise Linux 6)
|
~/home/.spicec/spice-xpi.log
|
编辑
/etc/spice/logger.ini 文件,把 log4j.rootCategory 变量从 INFO, R 改为 DEBUG, R。
|
|
SPICE Client (Red Hat Enterprise Linux 7)
|
~/.xsession-errors
|
使用 debug 选项在命令行中启动 Firefox:
G_MESSAGES_DEBUG=all SPICE_DEBUG=1 firefox。
创建
~/.xsession-errors 文件。
|
|
Windows 客户端上的 USB 重定向
|
C:\Windows\Temp\usbclerk.log
|
不适用。
|
18.3.4. 使用 console.vv 文件启动的 SPICE 客户端的 SPICE 日志
Linux 客户端机器:
- 使用
--spice-debug选项运行remote-viewer命令来启用 SPICE 故障排除(debug)功能。在提示时,输入连接 URL,例如,spice://[virtual_machine_IP]:[port]。# remote-viewer --spice-debug
- 要查看日志,下载
console.vv文件,使用--spice-debug选项运行remote-viewer命令,指定到console.vv文件的完全路径。# remote-viewer --spice-debug /path/to/console.vv
Windows 客户端机器:
- 下载
debug-helper.exe文件,把它移到remote-viewer.exe文件所在的目录中。例如,C:\Users\[user name]\AppData\Local\virt-viewer\bin目录。 - 执行
debug-helper.exe文件来安装 GNU Debugger(GDB)。 - 执行
debug-helper.exe文件来启用 SPICE 故障排除功能。debug-helper.exe remote-viewer.exe --spice-controller
- 要查看日志信息,连接到虚拟机,您将会看到运行 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.