Complete Guide to Creating Shared Folders Between Host and Guest via Internal Network in Hyper-V

Nov 21, 2025 · Programming · 16 views · 7.8

Keywords: Hyper-V | Internal Network | File Sharing | Virtual Machine | Windows 10

Abstract: This article provides a comprehensive technical guide for implementing file sharing between host and virtual machine in Windows 10 Hyper-V environment through internal network configuration. It covers virtual switch creation, network adapter setup, IP address assignment, network connectivity testing, and folder sharing permissions, while comparing the advantages and disadvantages of enhanced session mode versus network sharing approaches.

Technical Background and Requirements Analysis

In modern virtualization environments, Hyper-V as Microsoft's mainstream virtualization platform is widely used in development testing, system deployment, and resource isolation scenarios. Achieving efficient file sharing between host and virtual machine is a common requirement in virtualization environment management, particularly important in continuous integration, data backup, and development debugging scenarios.

Traditional file transfer methods such as USB device sharing or network downloads suffer from inefficiency and security risks. Establishing dedicated communication channels through Hyper-V internal networks can not only provide stable file transfer services but also ensure data transmission security. This article systematically elaborates on the technical details of implementing file sharing through internal networks based on practical engineering experience.

Environment Preparation and Prerequisites

Before starting configuration, ensure the following basic requirements are met: host system is Windows 10 Enterprise edition, virtual machine runs Windows 10 Professional operating system, and Hyper-V functionality is properly enabled. Verify that Hyper-V Manager can start normally and recognize the target virtual machine.

Regarding network environment, it's recommended to disable unnecessary firewall rules and ensure network policies don't block internal communication. Simultaneously check the virtualization feature status in BIOS/UEFI to confirm complete hardware virtualization support.

Internal Virtual Network Configuration

First, create a dedicated internal virtual switch in Hyper-V Manager. Open Hyper-V Manager, select "Virtual Switch Manager" from the right-side action panel. When creating a new virtual switch, choose the "Internal Network" type and name it "Internal Network Connection" or other meaningful identifier.

The main difference between internal network mode and external network is that internal network only allows communication between host and virtual machines, without connecting to physical network adapters, providing better isolation and security. After configuration completes, the system creates a new virtual network adapter in host network connections.

Virtual Machine Network Adapter Setup

Add a new network adapter to the target virtual machine or modify existing adapter configuration. In the virtual machine settings interface, select the "Network Adapter" option and set the virtual switch to the newly created "Internal Network Connection".

Important note: If the virtual machine is running, it needs to be shut down or operations paused before modifying network configuration. After configuration completes, start the virtual machine, and the new network interface should be visible in network connections within the operating system.

IP Address Planning and Configuration

Assigning static IP addresses to host and virtual machine is crucial for ensuring network stability. It's recommended to use private IP address ranges, such as 192.168.1.0/24. Specific allocation scheme: host IP set to 192.168.1.1, virtual machine IP set to 192.168.1.2, subnet mask uniformly set to 255.255.255.0.

On the host side, access the corresponding virtual network adapter through Control Panel's Network and Sharing Center, manually set the IP address. Perform the same operation in the virtual machine, ensuring both machines are on the same subnet. Code examples as follows:

# Host IP configuration example
netsh interface ip set address "vEthernet (Internal Network Connection)" static 192.168.1.1 255.255.255.0

# Virtual machine IP configuration example  
netsh interface ip set address "Ethernet" static 192.168.1.2 255.255.255.0

Network Connectivity Verification

After configuration completes, network connectivity testing is required. Open command prompt on both host and virtual machine, use ping command to verify bidirectional communication. Execute on host:

ping 192.168.1.2

Execute on virtual machine:

ping 192.168.1.1

If ping test fails, possible reasons include: firewall blocking, network adapter not enabled, IP configuration errors, etc. Solutions include: checking Windows firewall settings to ensure file and printer sharing rules are enabled; disabling then re-enabling network adapter in network connections; verifying IP address and subnet mask configuration accuracy.

Folder Sharing Configuration

Create a folder for sharing in the virtual machine, named "VMShare" or according to actual requirements. Right-click the folder, select "Properties", enter the "Sharing" tab, click the "Advanced Sharing" button.

Check the "Share this folder" option, set the share name. Click the "Permissions" button, in the permissions settings dialog, ensure at least granting the "Everyone" user group "Full Control" permission, or set more granular permission control as needed.

Permission configuration code logic as follows:

# Folder sharing permission settings pseudocode
if (folder.exists()) {
    shareSettings = new ShareSettings();
    shareSettings.setShareName("VMShare");
    shareSettings.addPermission("Everyone", Permission.FULL_CONTROL);
    folder.applyShareSettings(shareSettings);
}

Accessing Shared Folder from Host

Open File Explorer on the host side, enter the virtual machine's UNC path in the address bar:

\\192.168.1.2\VMShare

The system will prompt for access credentials. Since it's a workgroup environment, need to select the "Other User" option. Add ".\" prefix before username to specify local account, for example:

.\username

After entering the correct password, the shared folder becomes accessible. After successful first access, consider mapping network drive for subsequent quick access.

Alternative Approach: Enhanced Session Mode

Besides network sharing method, Hyper-V also provides enhanced session mode as an alternative approach. This method implements file transfer through VMConnect client, with relatively simple configuration but connection dependency.

Enabling enhanced session mode requires allowing enhanced session mode policy in Hyper-V settings, and enabling Guest Service functionality in virtual machine integration services. When connecting to virtual machine, select drives to share in local resource settings.

The limitation of enhanced session mode lies in: file transfer depends on active VMConnect session, when session disconnects, sharing terminates. This method isn't suitable for scenarios requiring continuous background file access, but is more convenient for temporary file exchange requirements.

Technical Solution Comparison Analysis

The advantage of internal network sharing solution lies in providing persistent file access capability, independent of client connection status, suitable for production environments and automation scripts. Network performance typically surpasses enhanced session mode, especially in large file transfer scenarios.

The advantage of enhanced session mode lies in simple configuration, without complex network setup, suitable for temporary file transfer requirements. But its dependency on connection status limits application scenarios.

Actual selection should be determined based on specific requirements: if continuous file access or automation integration is needed, recommend using internal network sharing solution; if only occasional file exchange, enhanced session mode might be more convenient.

Troubleshooting and Optimization Recommendations

Common issues include network connection failures, permission denial access, performance degradation, etc. Network connection problems typically stem from IP configuration errors or firewall blocking, recommend re-verifying configuration according to previous steps.

Permission issues might result from incorrect user credentials or improper sharing permission settings. Ensure using correct username and password, and explicitly grant access permissions in sharing permissions.

Regarding performance optimization, consider adjusting virtual machine memory and CPU allocation to ensure sufficient resources for network IO processing. For transferring large numbers of small files, consider enabling SMB signing and encryption features to improve security.

Security Considerations and Best Practices

When implementing file sharing, security is an important factor that cannot be overlooked. Recommend adopting the following security measures: using complex access passwords, regularly updating system patches, restricting shared folder access permissions, enabling network audit logs.

For sensitive data transmission, recommend enabling SMB encryption functionality. Configure corresponding security policies in group policy to ensure only authorized users can access shared resources.

Regularly check sharing permission settings, promptly revoke access permissions no longer needed. Establish complete security audit mechanisms to monitor abnormal access behaviors.

Summary and Outlook

Implementing file sharing between host and virtual machine through Hyper-V internal networks provides stable and efficient solutions. This article details the complete process from network configuration to permission settings, and provides practical troubleshooting guidelines.

With the development of virtualization technology, more convenient file sharing mechanisms might emerge in the future. But solutions based on internal networks remain among the most reliable and flexible choices in current technical environments. Mastering these core technologies holds significant importance for virtualization environment management and maintenance.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.