Securing Windows VM Guest Access on Hyper-V -- Least Privilege, Application Aware Backup, Generation 2 Security, and Network Exposure
Microsoft Hyper-V | Security | Audience: Hyper-V Administrators, Infrastructure Engineers
This one came directly from a conversation I had with someone in the community. They were doing what a lot of people do: creating a domain account, adding it as local admin on the VM, enabling network discovery, and using that to get application aware backup working. It works. And they already knew the problem with it. That account, with local admin on every VM and network discovery open, is an attack surface you created to solve a backup problem. There's a better way to do it, and the better way also happens to be more secure across the board, not just for backup.
This article covers how to properly manage guest access on Windows VMs running on Hyper-V: what the least privilege model looks like in practice, how to get application aware backup working without a domain admin credential sitting on every VM, Generation 2 security features that most environments aren't using, and the network exposure decisions that matter more than people realize.
1. The Problem with the Common Approach
Creating one shared domain account, adding it as local admin on all VMs, and enabling network discovery solves several problems at once. Backup tools can reach the VMs. Remote management works. Application aware processing works. Everything that needs to talk to the guest can talk to it.
The problem is what that setup actually is. A single credential that, if compromised, grants local admin access to every VM in your environment. Network discovery enabled means VMs are actively broadcasting their presence on the network. And local admin on a domain account means an attacker who gets that credential can use it to move laterally across every machine that credential touches. You've traded convenience for a single credential whose compromise touches every machine it's on.
The security principle that fixes this is least privilege: every account should have only the minimum access it needs to do its specific job, and nothing more. Applied to Hyper-V guest management it means separate accounts for separate purposes, scoped as tightly as possible, with network access limited to what's actually required.
2. Separate Accounts for Separate Purposes
The fix is to stop using one account that does everything and build around what each account actually needs. Three roles with three different access levels:
| Role | What It Needs | What It Doesn't Need |
|---|---|---|
| Backup service account | Local admin on VMs for VSS and application aware processing. Read access to relevant services. | Domain admin rights. Interactive logon rights. Access to management consoles. Rights on the Hyper-V host itself. |
| VM administration account | Local admin on VMs you manage. RDP access if you manage them interactively. | Rights on VMs you don't manage. Host level access. Service account functions. |
| Hyper-V host admin | Hyper-V Administrators group membership (or full admin if required). Rights to manage VM configuration, snapshots, networking. | Local admin rights inside guest VMs. Backup service functions. End user access to applications running in VMs. |
The key separation is between host administration and guest administration. Someone who needs to manage the Hyper-V host, create VMs, configure virtual switches, and manage snapshots doesn't need local admin rights inside the guest operating systems. Someone who needs to manage applications inside the guest VMs doesn't need rights to reconfigure the host. Keep those access paths separate and you've significantly reduced the blast radius of any single credential compromise.
3. Application Aware Backup Without Overprovisioning
This is the specific problem from the conversation. Getting application aware backup working without a shared domain admin credential on every VM.
Application aware processing for most backup tools, including Veeam, requires a credential that has local admin rights on the guest. That's a real requirement for VSS coordination and log truncation. You can't get around it. The question isn't whether local admin is needed, it's whether that credential needs to be a domain account with local admin on every VM, or something more scoped.
- Create a dedicated backup service account in Active Directory. Not a user account, a service account. Disable interactive logon for it. Set a long, complex password and store it in your password manager. This account's only purpose is backup operations.
- Add it to the local Administrators group only on VMs that need application aware processing. Not every VM. VMs running SQL Server, Exchange, or other VSS aware applications that produce inconsistent backups without application awareness. File servers and web servers with no stateful application data often don't need application aware processing at all. Don't add the backup account to VMs where it doesn't need to be.
- Use Group Policy to restrict what the account can do. Deny it interactive logon rights via GPO (Deny log on locally, Deny log on through Remote Desktop Services). The account needs to be local admin for VSS, but it doesn't need to be able to log in interactively. A credential that can't be used to open a session is significantly less useful to an attacker even if it's compromised.
- Don't enable network discovery for backup purposes. Backup tools reach VMs by IP or hostname, not by browsing the network. Network discovery serves endpoint users browsing for shared resources. It doesn't help backup tools and it expands your network attack surface. Keep it off on servers.
# Run on each VM that needs application aware backup # Or deploy via Group Policy Preferences for scale # Add the backup service account to local Administrators $backupAccount = "DOMAIN\svc-veeam-backup" Add-LocalGroupMember -Group "Administrators" -Member $backupAccount # Verify the addition Get-LocalGroupMember -Group "Administrators" # The interactive logon restriction is best done via Group Policy: # Computer Configuration > Windows Settings > Security Settings > # Local Policies > User Rights Assignment # "Deny log on locally" - add the backup service account # "Deny log on through Remote Desktop Services" - add the backup service account # # This allows the account to be used for VSS/backup operations # while preventing anyone from using it for interactive sessions # Alternatively, set it directly via secedit on individual VMs # (GPO is preferred for consistency across many VMs)
4. Generation 2 VMs and the Security Features Most People Skip
If you're creating new Windows VMs on Hyper-V and choosing Generation 1, stop. Generation 2 is the right choice for every supported Windows guest OS (Windows Server 2012 and later, Windows 8 and later). The security features that come with Generation 2 are genuinely useful and aren't available on Generation 1.
Secure Boot
Secure Boot prevents unauthorized code from running during the VM's boot sequence. It verifies that the bootloader is signed by a trusted certificate authority before allowing the OS to start. On Generation 2 VMs, Secure Boot is enabled by default for Windows guests. Don't disable it. The reason most people disable it is that it breaks when they try to boot non standard media or install unsigned drivers. The right response to that is to fix the unsigned driver or media situation, not to disable Secure Boot.
Virtual TPM
Adding a virtual TPM to a Generation 2 VM enables BitLocker inside the guest operating system, among other security features that rely on TPM presence. BitLocker on the guest VM's virtual disk means the VHDX file on the Hyper-V host is encrypted. Even if someone gains access to the host filesystem and copies the VHDX file, they can't read its contents without the BitLocker key that's bound to the virtual TPM state.
To enable a virtual TPM: in Hyper-V Manager, open the VM's settings, go to Security, check Enable Trusted Platform Module. The VM must be Generation 2 and must not be running when you make this change. After enabling, BitLocker can be configured inside the guest the same way it is on a physical machine.
Shielded VMs
Shielded VMs are the highest security level available in Hyper-V. A shielded VM encrypts its state, migration traffic, and saved state. It can only run on hosts approved by a Host Guardian Service. Even a Hyper-V host administrator can't access the memory or disk of a shielded VM. For most environments this level of protection is overkill, but for VMs handling sensitive regulated data, healthcare records, financial data, or anything with strict compliance requirements, it's worth understanding and potentially implementing.
5. Network Exposure: What Actually Matters
Network discovery is one of three network exposure decisions that matter for guest VM security. The others are virtual switch isolation and Windows Firewall configuration inside the guest.
Virtual Switch Isolation
Not every VM needs to be on the same virtual switch. Production VMs, management VMs, backup infrastructure, and development VMs should be on separate virtual switches with separate VLANs. A VM that gets compromised on the production network should not be able to reach backup infrastructure or management systems on the same flat network. VLANs don't prevent lateral movement on their own, but combined with firewall rules between VLANs, they significantly slow an attacker who's trying to move from a compromised guest to your backup servers or Hyper-V management interfaces.
Windows Firewall Inside the Guest
The Windows Firewall inside a guest VM is not redundant with your network firewall. They serve different purposes. The network firewall controls what traffic reaches your environment from outside. The Windows Firewall inside the guest controls what processes inside the VM can accept connections from other VMs on the same network. A compromised VM that can freely connect to other VMs on the same internal network because all firewalls are disabled is a significant lateral movement risk. Keep Windows Firewall enabled on all guest VMs and configure it via Group Policy to allow only the specific ports and protocols each VM's role actually requires.
Management Interface Separation
If you're managing Hyper-V hosts remotely, the management traffic should travel on a dedicated management network that production VMs can't reach. The Hyper-V management NIC and the VM traffic NIC should be separate physical interfaces on separate VLANs. This means a compromised guest VM can't reach the Hyper-V host's management interface even if it's on the same physical host. This is a fundamental network design principle for any hypervisor environment and it applies directly to Hyper-V.
6. Credential Hygiene Across Guest VMs
A few things that matter more than most people act on:
- Local Administrator accounts. Rename the built-in Administrator account on each VM and disable it. It's the first account attackers try. Renaming it doesn't prevent compromise but it removes a trivially known target. Use Microsoft LAPS (Local Administrator Password Solution) to randomize local admin passwords across VMs so that a credential harvested from one VM doesn't work on all the others.
- PowerShell Direct is a host level access path. PowerShell Direct lets a Hyper-V host administrator run PowerShell commands inside a guest VM without any network connection, by communicating through the VM bus. This bypasses all guest firewalls and network controls. Understand who has host level Hyper-V admin access because those people can access guest VM internals through PowerShell Direct regardless of guest firewall configuration.
- Integration Services and their attack surface. Hyper-V Integration Services run inside the guest and provide communication between guest and host. They're required for heartbeat, time sync, shutdown, and VSS backup. Disable the integration components you don't need. Guest services (file copy service) is rarely needed for production VMs and presents an unnecessary channel between host and guest. Only enable the integration components the VM actually uses.
# Run on the Hyper-V host to see which integration services are enabled per VM
Get-VM | ForEach-Object {
$vm = $_
$services = Get-VMIntegrationService -VM $vm
Write-Host "`n$($vm.Name):"
$services | Select-Object Name, Enabled, PrimaryStatusDescription |
Format-Table -AutoSize
}
# To disable the Guest Services (file copy) integration component
# on VMs that don't need it:
# Get-VM "VMName" | Disable-VMIntegrationService -Name "Guest Service Interface"
# Recommended enabled components for most production VMs:
# - Heartbeat (required for backup health checks)
# - Key Value Pair Exchange (VM metadata)
# - Shutdown (graceful shutdown from host)
# - Time Synchronization (optional - disable if VM has another time source)
# - VSS (required for application aware backup)
#
# Usually safe to disable:
# - Guest Service Interface (file copy from host to guest)
Key Takeaways
- One shared domain account with local admin everywhere solves the management problem and creates a single credential that, if compromised, hands an attacker lateral access to every VM it touches. Separate accounts for separate purposes with minimum required access is the right model.
- Application aware backup needs local admin on the guest VM for VSS. It doesn't need an account that can log in interactively. Create a dedicated backup service account, scope it to the VMs that actually need application aware processing, and deny it interactive logon rights via Group Policy.
- Network discovery is for endpoint users browsing file shares. Turn it off on servers. Backup tools don't need it and it expands your network exposure with no operational benefit for server VMs.
- Generation 2 VMs give you Secure Boot and virtual TPM. Use both. Secure Boot is on by default, don't disable it. Virtual TPM enables BitLocker inside the guest and encrypts the VHDX file on the host. Keep BitLocker recovery keys backed up separately from the VMs they protect.
- Virtual TPM and restore have a specific interaction: restoring a vTPM protected VM to a different host leaves BitLocker in recovery state. The restored VM won't boot without a recovery key. Know where your recovery keys are before you need them in a crisis.
- PowerShell Direct is a host level access path into guest VMs that bypasses all guest firewalls. Understand who has Hyper-V host admin access because those people have an unblockable path into any guest on that host through PowerShell Direct.
- Use Microsoft LAPS to randomize local administrator passwords across VMs. A credential harvested from one compromised VM shouldn't work on every other VM in the environment.
- Disable the Guest Service Interface integration component on VMs that don't need file copy from host to guest. Disable only what you don't use. VSS, Heartbeat, Shutdown, and Key Value Pair Exchange are needed for normal operation and backup.