Skip to content

Qrexec Agent Starts Incorrectly and too Early on Windows 10 HVM #5462

@GWeck

Description

@GWeck

Qubes OS version
R4.0.1 fully updated

Affected component(s) or functionality
Qubes Windows Tools 4.0.1.3

Brief summary
When starting a Windows 10 (Version 1803 or 1909) HVM with QWT installed, both Qubes services start (Qubes RPC Agent and QubesDB daemeon), but most of the time Qubes complains that it cannot connect to the qrexec agent of the VM, and functions like file copy do not work. This seems to be a timing problem, as it does not always happen.
If, however, the Qubes RPC Agent start mode is set to Manual (or even disabled) and the agent was stopped (interactively or via the command net stop qrexecagent) before shutting down windows, this service does not start at the next boot. If then the service is started interactively, connection to Qubes is established immediately and the full functionality is available.

To Reproduce
Install QWT 4.0.1.3 on a freshly installed Windows 10 Pro systemrunning as HVM under Qubes. Set qvm-feature gui to 1 to get an interactive window. Set qvm-prefs qrecec_timeout to a larger value (600 or so) to reduce stress.
Reboot the VM and observe its state in the Qube manager.

Expected behavior
The state should always turn to green, and full functionality should be availabl,e like it is on Windows 7.

Actual behavior
If the state stays at yellow, which happens most of the time, the qrexec channel between host and guest is not working, although the correspondig Qubes RPC Agent service in the guest is running. If, on the other hand, the state turns to green, communication is established.

Additional context
The Qrexec Agent starts, irrespectively of its starttype, if it was active at the last shutdown before boot - even if its starttype is set to disabled. If it is running, it can be shut down interactively or via the command net stop qrexecagent. Trying to restart the service interactively or via the command net start qrexec agent crashes Windows with error 0x0000dead in xenbus.sys.
If the agent is not running at boot time, it can be started interactively. Trying to start it via the command line leads to the same crash. The VM has to be killed in order to be able to start it again.
Probably not connected to this, but still annoying: The logs complain that the RPC qubes.SetMonitorLayout fails due to File not Found. Creating a file with this name, e.g. by copying qubes.SetGuiMode under this name, in the qubes-rpc directory removes this error, but does not change the other behaviour.

Solutions you've tried
First set the starttype of Qubes RPC Agent to Manual. This can be done while it is running, even if there is no communication with the host system.
Before shutdown of the VM, stop the service Qubes RPC Agent.
After booting, start the service Qubes RPC Agent interactively - not by command, as this would crash the VM.
In most cases, you have then a fully functional system.

Relevant documentation you've consulted
Documentaion on QWT

Related, non-duplicate issues
Possibly #5332 and #3585

Log files on a successful start of Qubes RPC Agent with connection to the host
qrexec-agent-20191115-094051-6456.log
qrexec-wrapper-20191115-094051-6552.log
qrexec-wrapper-20191115-094051-6672.log
qubesdb-daemon-20191115-094014-2784.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: windows-toolsThis issue pertains to Qubes Windows Tools (QWT).P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.help wantedThis issue will probably not get done in a timely fashion without help from community contributors.

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions