Author Archives: Paul Durrant

About Paul Durrant

I graduated in Computer Science from the University of Cambridge in 1994 and have been working on device drivers and kernels (generally in the networking subsystem) ever since. I spent many years in the Solaris kernel networking group at Sun Microsystems and joined Citrix in 2009 to work on the Windows PV drivers for XenServer.

Announcing the Windows PV Console Driver

It has long been the case that all HVM guests under Xen are provided with a PV console. You can attach to this console in the same way that you attach to the console of a PV guest, by typing in the control domain:

xl console name_of_guest

Until recently there has been no Windows PV driver interaction with this console. Starting with this commit support for logging via the PV console was added to the XENBUS driver.

I’m happy to announce that the three commits to XENBUS starting with this one added the necessary infrastructure to support a brand new XENCONS PV driver which exposes the PV console to Windows user-space as a character device.

The XENCONS driver source is hosted alongside the other PV driver sources on xenbits.xen.org and development builds are available for download here.

The XENCONS package also contains a Windows service to monitor the presence of the PV console device and invoke a command shell login process with redirected stdin/stdout. This means that, once the driver package has been installed, if you attach to the PV console and hit ENTER you’ll see a prompt something like this:

DESKTOP-KVEHAKT login:

From this prompt you can log in as any local user and you’ll then be presented with the command shell:

DESKTOP-KVEHAKT login: User
Password:
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\User>

Be aware that this shell is running in session 0 so does not have access to the interactive session, but you can still use it for many administrative tasks. For instance, you can run netsh to display aspects of your network configuration:


C:\Users\User>netsh
netsh>interface ipv4 show global
Querying active state...

General Global Parameters
---------------------------------------------
Default Hop Limit : 128 hops
Neighbor Cache Limit : 256 entries per interface
Route Cache Limit : 4096 entries per compartment
Reassembly Limit : 33420160 bytes
ICMP Redirects : enabled
Source Routing Behavior : dontforward
Task Offload : enabled
Dhcp Media Sense : enabled
Media Sense Logging : disabled
MLD Level : all
MLD Version : version3
Multicast Forwarding : disabled
Group Forwarded Fragments : disabled
Randomize Identifiers : enabled
Address Mask Reply : disabled
Minimum Mtu : 576
Locality Address Selection : disabled
Flow Label : disabled

Current Global Statistics
---------------------------------------------
Number of Compartments : 1
Number of NL clients : 7
Number of FL providers : 4

Over the coming weeks I intend to add to the functionality that the driver provides. One obvious extension would be some form of hotkey support to link into the XENBUS_DEBUG interface to enable PV drivers to register a callback to be triggered by a particuler key.

If you are interested in this then please try the XENCONS package and send feedback to the mailing list.

The Windows PV Drivers Sub-Project

by Paul Durrant

Back in 2013 Citrix made XenServer fully open source. As part of that work the previously closed Windows drivers for paravirtual devices were opened up and made available to the community on GitHub. These drivers were still very much tied to XenServer though because of assumptions that were made about the platform and reliance on certain patches carried in the XenServer patch queues.

Shortly after setting up the driver repositories on GitHub I started removing these assumptions and dependencies on the XenServer platform and produced a set of drivers that could be used on most Xen installations. This put the code in a good state to approach the project community and Xen Project Advisory Board with a proposal for an incubation sub-project. I’m happy to say that this was and we are well under way in getting things set up. There is a new with information on the driver source repositories (which are now hosted on xenbits under a new pvdrivers/win sub-directory), instructions on how to build and install the drivers, and guidelines on how to contribute to the project.

Overview

The PV drivers are split into five packages:

XenBus

This is the key package that supports all other PV drivers. It provides the XENBUS driver which binds to either the XenServer variant of the (see in the hypervisor source repository) or the ubiquitous Xen Platform PCI Device, both of which are provided to HVM guests by QEMU.
This driver establishes communication with the Xen hypervisor and enumerates the paravirtual classes specified by the toolstack in xenstore. It also provides APIs to core Xen functionality such as event channels and the grant table.

XenVif

This package contains the network class driver XENVIF. This driver makes use of the APIs provided by XENBUS to implement the PV network protocol. It enumerates PV network devices (specified in the guest area in xenstore under device/vif) and provides a simple API to use the protocol.

XenNet

This package contains the NDIS 6 network device driver XENNET. This driver binds to the devices enumerated by XENVIF and provides a relatively thin glue layer between the Microsoft-defined NDIS miniport interface and the PV network API exported by XENVIF.

XenVbd

This package contains the storage class driver XENVBD and associated crash-kernel driver XENCRSH. XENVBD makes use of the APIs provided by XENBUS and the Windows STORPORT miniport interface to provide limited SCSI HBA functionality to the OS. It is limited in the fact that it only supports the operations necessary for the Windows generic DISK driver to function on the devices exposed by the HBA.

XenIface

This package contains the XENIFACE driver which creates WMI objects providing access to xenstore (see ) and system time, and a minimal user-space guest agent which uses those objects to provide facilities to cleanly shut down or reboot a guest and also re-synchronize guest time after a VM migrate/restore.