Run the sensor on Hyper-V
Create a Generation 2 virtual machine from the PollySec sensor's disk and pair it with your company.
Reviewed 13 November 2026
All guidesThe PollySec sensor runs as a virtual machine inside your network and scans the network it is connected to. It connects out to PollySec over HTTPS; nothing needs to reach it from outside. You create one virtual machine from the sensor’s disk and pair it with a code: there is no operating system to install and no password to set.
Before you start
- Hyper-V on Windows Server or Windows, and Hyper-V Manager.
- Room for the virtual machine: 2 virtual processors, 4 GB of static memory and a 16 GB dynamically expanding disk.
- An external virtual switch on the network the sensor scans (create one if the host has none). The sensor takes its address over DHCP; you can set a static address on its console instead.
- PollySec open in a browser. You open Add sensor once: it gives you the sensor’s file, stays open while you create the virtual machine, and then pairs the sensor.
Download the sensor
- In PollySec, go to Internal network > Sensors and select Add sensor.
- Choose Hyper-V and select Next.
- On the Hyper-V host, select Download, or copy the file to the host afterwards. The file is
pollysec-sensor-<version>-hyperv.vhdx.zip. - To check the file, open Verify the download. The SHA-256 there is the zip file’s: run
Get-FileHashon the zip in PowerShell and compare the two. - To check that the file is PollySec’s, download Checksums and Signature from Verify the download and copy the Signing key into a file named
signing-key.pembeside them. Then runopenssl dgst -sha256 -verify signing-key.pem -signature SHA256SUMS.sig SHA256SUMS, which must printVerified OK, and compare the zip file’s SHA-256 with its line inSHA256SUMS. The key is shown by PollySec, not served beside the file, so a file someone replaced in transit fails the check. - Select Next and leave Add sensor open while you create the virtual machine. Its next step shows the PowerShell script below, with the file’s name filled in.
Create an external virtual switch
- In Hyper-V Manager, in the Actions pane, select Virtual Switch Manager.
- Select New virtual network switch, then External and Create Virtual Switch.
- Name the switch, choose the network adapter on the network the sensor scans, and select OK, then Yes. The host’s network connection drops for a moment while Hyper-V creates the switch.
Create the virtual machine
- Move the zip file to the folder where the virtual machine’s disk should stay, right-click it and select Extract All, then Extract. The disk,
pollysec-sensor-<version>-hyperv.vhdx, is in the folder Extract All makes there. - In Hyper-V Manager, select your server, then in the Actions pane select New > Virtual Machine.
- Name it, then under Specify Generation select Generation 2. Under Assign Memory enter 4096 MB and clear Use Dynamic Memory for this virtual machine.
- Under Configure Networking choose the external virtual switch. Under Connect Virtual Hard Disk select Use an existing virtual hard disk, browse to the .vhdx file and select Finish.
- Open the virtual machine’s Settings. Under Security, clear Enable Secure Boot. Under Processor, set Number of virtual processors to 2. Under Checkpoints, clear Enable checkpoints. Then select OK.
- Start the virtual machine: right-click it, select Connect and then Start. After a minute its console shows a pairing code, its IP address and its MAC address.
If the console shows Start PXE over IPv4, turn the virtual machine off, clear Enable Secure Boot under Security in its Settings, and start it again.
Or create it with PowerShell
One script does steps 1 to 6: it unzips the download, creates the virtual machine on the host’s external virtual switch and starts it. Run it once for each sensor.
- On the Hyper-V host, select Start, type
PowerShell, right-click Windows PowerShell and select Run as administrator. - Copy the script from Add sensor, where the file’s name is filled in, or copy it here and replace
<version>with the version in the file’s name. If the zip file is not in your Downloads folder, put its full path on the$zipline.
& {
$ErrorActionPreference = "Stop"
$zip = Join-Path (New-Object -ComObject Shell.Application).NameSpace("shell:Downloads").Self.Path "pollysec-sensor-<version>-hyperv.vhdx.zip"
$switchName = ""
if (-not (Test-Path -LiteralPath $zip)) { throw "$zip is not there. Put the zip file's full path on the `$zip line." }
if (-not $switchName) {
$external = @(Get-VMSwitch -SwitchType External)
if ($external.Count -eq 0) { throw "Create an external virtual switch on the network the sensor scans, then run the script again." }
if ($external.Count -gt 1) { throw "Put the name of the switch on the network the sensor scans on the `$switchName line: $($external.Name -join ', ')." }
$switchName = $external[0].Name
}
if ((Get-VMSwitch -Name $switchName).SwitchType -ne "External") { throw "Put the name of an external virtual switch on the `$switchName line." }
$folder = Join-Path (Get-VMHost).VirtualHardDiskPath "PollySec sensor $(Get-Date -Format yyyyMMdd-HHmmss)"
Write-Host "Unzipping the disk into $folder"
Add-Type -AssemblyName System.IO.Compression.FileSystem
[IO.Compression.ZipFile]::ExtractToDirectory($zip, $folder)
$settings = @{
Name = "PollySec sensor"
Generation = 2
MemoryStartupBytes = 4GB
VHDPath = (Get-ChildItem -LiteralPath $folder -Filter *.vhdx).FullName
SwitchName = $switchName
}
$vm = New-VM @settings
Set-VMMemory -VM $vm -DynamicMemoryEnabled $false
Set-VMFirmware -VM $vm -EnableSecureBoot Off
Set-VMProcessor -VM $vm -Count 2
Set-VM -VM $vm -CheckpointType Disabled
Start-VM -VM $vm
}
- Paste the script into the PowerShell window and press Enter. If Windows asks about pasting several lines, select Paste anyway. If the host has more than one external virtual switch, the script lists them: put the name of the one on the network the sensor scans on the
$switchNameline and run it again. - In Hyper-V Manager, right-click the virtual machine named PollySec sensor and select Connect to read its console.
Pair the sensor
- Back in Add sensor, select Next until it asks for the pairing code. If you closed it, select Add sensor again and choose your platform. Under Pairing code, enter the code the sensor’s console shows, then select Next.
- Compare the MAC address and Local IP address with the sensor’s console. If they match, select Yes, this is my sensor. If they do not, select This is not my sensor.
- Under Name, give the sensor a name, or leave it empty to name it after its serial number, then select Add sensor.
- Wait while the sensor connects, usually under a minute. Add sensor goes on by itself.
- The sensor’s console now shows
CONFIRM THIS SENSOR in PollySec with code XXX-XXX. Enter those six letters under Confirmation code and select Confirm sensor. - Choose the network the sensor should scan and select Next. If that network is new to PollySec, choose what is on it and select Next again. If PollySec has no network to propose, Add sensor says why: finish it and add the network under Networks later.
- Check the summary and select Start scanning. Nothing is scanned before that. Not now adds the sensor without scanning, and you attach it to a network under Networks later.
Note
The sensor keeps its identity when its virtual machine moves to another host. Run each paired sensor once, and leave it out of checkpoints, snapshots and backup jobs: a copy is the same sensor, and an older copy starts from older state. For another sensor, create a new virtual machine from the sensor’s file and pair it.